Hi Vishnu,
Did you have any luck in fixing this issue? Any solution?
I'm having a similar problem and still couldn't find an answer.
Regards,
Daniel

On Tuesday, April 28, 2020 at 3:05:11 PM UTC-4 [email protected] wrote:

> 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/34c6fa99-51ae-49ab-8df8-bb64f2f702b0n%40googlegroups.com.

Reply via email to