I am writing a node_exporter text_file export using python client library.
I have metrics with the same metric name but different label values like
below
TPL{dc="tlv1",instance="core2.tlv1",job="cisco_ipsla",link_id="PL2_31.0",region="sjc2"}
19.0
TPL{dc="ash1",instance="core1.ash1",job="cisco_ipsla",link_id="PL2_100.0",region="sjc2"}
119.0
when I try to write this I get the below error.
```ValueError: Duplicated timeseries in CollectorRegistry: {'TPL'}```
Below is my script
registry = CollectorRegistry()
for query in queries:
for val in query:
metric_name = list(val.keys())[1]
key = list(val["metric"].keys())
g = Gauge(metric_name, 'weekly report of link status', val["metric"].keys(),
registry=registry)
g.labels(**val["metric"]).set(val[metric_name][1])
write_to_textfile('/tmp/link.prom', registry)
how do I expose metric with the same name but different label value using
python client_library
Regards
Vishnu
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/f2ec9df7-b0a3-40c4-8abe-d6d665aa5038%40googlegroups.com.