Adding same metric with different label values

19 views
Skip to first unread message

Ankit Kumar

unread,
May 22, 2020, 1:31:09 AM5/22/20
to Prometheus Users
Hi Guys,

I was trying to add the same metric with different label values using the following querry:

metric_total{label1="label1", label2="label2"} + ignoring(label2) metric_total(label2="label3")

However, I get "No Data". Not sure what is the issue, can someone help?

Julien Pivotto

unread,
May 22, 2020, 1:35:16 AM5/22/20
to Ankit Kumar, Prometheus Users
With such a low level of details I am afraid it will be difficult to help.

Can you provide a sample of actual metrics?


You can also try https://promlens.com/ which could help you understand what is going on.

--
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 prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/5dbbf44a-b12b-443c-8327-8df8bea95485%40googlegroups.com.

Ankit Kumar

unread,
May 22, 2020, 3:56:50 AM5/22/20
to Prometheus Users
Hi Julien,

Thanks for letting me know about promlens. Got to know the issue. Im so lame!!

To summarise:

my metric was defined as 
metric(label1,label2,label3,label4) value

When label2 changed label4 was also changing 

Hence, metric_total{label1="label1", label2="label2"} + ignoring(label2) metric_total(label2="label3") was not able to find a match (since both label2 and label4 changed but only label2 was ignored)

Fixed it by adding label4 to the ingoring list

metric_total{label1="label1", label2="label2"} + ignoring(label2,label4) metric_total(label2="label3") 

Regards
Ankit

On Friday, 22 May 2020 13:35:16 UTC+8, Julien Pivotto wrote:
With such a low level of details I am afraid it will be difficult to help.

Can you provide a sample of actual metrics?


You can also try https://promlens.com/ which could help you understand what is going on.

Le ven. 22 mai 2020 à 07:31, Ankit Kumar <ankit....@gmail.com> a écrit :
Hi Guys,

I was trying to add the same metric with different label values using the following querry:

metric_total{label1="label1", label2="label2"} + ignoring(label2) metric_total(label2="label3")

However, I get "No Data". Not sure what is the issue, can someone help?

--
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 promethe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages