dcu / mongodb_exporter

MongoDB exporter for prometheus.io
MIT License
353 stars 216 forks source link

Race condition when requesting `/metrics` more than once at the same time #70

Open snarlysodboxer opened 6 years ago

snarlysodboxer commented 6 years ago

If you start up the exporter and run curl http://localhost:9001/metrics & curl http://localhost:9001/metrics you will get back at least one 500 error.

The error messages all look like

collected metric mongodb_db_indexes_total label:<name:"db" value:"my-db" > label:<name:"shard" value:"" > gauge:<value:2 >  was collected before with the same name and label values

This is a problem for us because our HA Prometheus setup tends to hit the exporter again while the exporter is still processing a request for another Prometheus instance.

Thanks!