WMI-exporter expose absolutely no metrics when a textfile has duplicate metric. e.g the http://localhost:/metrics has single metric, only a message d'error is displayed (see below).
Error message on the /metrics page:
An error has occurred during metrics gathering:
collected metric wmi_zzz_test_duplicate_metric_name label:<name:"name" value:"foo" > untyped:<value:13 > was collected before with the same name and label values
Expected result :
.prom file with invalid / duplicate entry should be ignored.wmi_textfile_scrape_error should equal 1.prom file in the textfile directory should be publishedStep to reproduce:
Exemple invalid .prom file :
wmi_zzz_test_duplicate_metric_name{name="foo"} 1
wmi_zzz_test_duplicate_metric_name{name="foo"} 13
Hi @finkr,
Thanks for reporting! Agree that this isn't great. The enforcement of duplicates is actually done by the Prometheus client library, so handling this better isn't completely straight-forward. We'll need to add some tracking of seen metric/label combinations and then avoid passing the metrics to the client library at all.
Node-exporter had the same issue:
Actually no, I think that was a different bug (although with the same symptoms). The textfile collector in wmi_exporter was copied from node_exporter in April this year, when the fix was already merged.
Anyway. I've implemented a fix now which tracks duplicate metrics. I'm doing some benchmarking to ensure this doesn't come with a too large hit to performance or memory usage, but will hopefully open a PR tonight.
Most helpful comment
Actually no, I think that was a different bug (although with the same symptoms). The textfile collector in wmi_exporter was copied from node_exporter in April this year, when the fix was already merged.
Anyway. I've implemented a fix now which tracks duplicate metrics. I'm doing some benchmarking to ensure this doesn't come with a too large hit to performance or memory usage, but will hopefully open a PR tonight.