percona / mongodb_exporter

A Prometheus exporter for MongoDB including sharding, replication and storage engines
Apache License 2.0
1.16k stars 425 forks source link

Multi target without need for specifying --mongodb.uri #878

Open andreav opened 1 month ago

andreav commented 1 month ago

With Prometheus multitarget scraping, it is possible to setup a configuration combining:

to have a completely dynamic multi instance scraping.

Here is an example for Redis Exporter with static_configs and file_sd_configs but it can be realized also with dockerswarm_sd_config to make it completely dynamic. Redis Exporter adopted a --redis.addr= (note empty value) for indicating multi instance scraping.

This would be a powerful improvement in situations where you need a dynamic configuration.