Hi,
It is not same.
What I want to do is limit the rule to eval metrics which have the spcified label.
Kind regards, Allenzh li
--
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/tencent_C7312B3EC100B4BCD59505CC%40qq.com.
Hi,
Thanks for your reply.
The problem is how to add the matcher to a exist rule expr.
Eg.
Now the rule expr is :
cpu_usage / avg_over_time(cpu_usage[5m] offset 24h) > 2Which is desired:cpu_usage{xxId="xxx"} / avg_over_time(cpu_usage{xxId="xxx"}[5m] offset 24h) > 2Yes.
That’s exactly what I was looking for.
Thank you very mach.
Kind regards, Allenzh li
The problem is how to add the matcher to a exist rule expr.
Eg.
Now the rule expr is :
cpu_usage / avg_over_time(cpu_usage[5m] offset 24h) > 2Which is desired:cpu_usage{xxId="xxx"} / avg_over_time(cpu_usage{xxId="xxx"}[5m] offset 24h) > 2
Thanks for your reply.
It is great. I will import the enforce code.
https://github.com/prometheus-community/prom-label-proxy/blob/master/injectproxy/enforce.go
Kind regards, Allenzh li