Hi,
Thanks for your reply.
Exactly, I develop a API which accept prometheus rule from web.
When user create a new rule, I want to add a fixed matcher(xxId="xxx"),
which label name is fixed and label value is various.
eg.
cpu_usage / avg_over_time(cpu_usage[5m] offset 24h) > 2 ->
cpu_usage{xxId="xxx"} / avg_over_time(cpu_usage{xxId="xxx"}[5m] offset
24h) > 2
Kind regards,
Allenzh li
在2020年12月3日星期四 UTC+8 下午4:23:13<Christian Hoffmann> 写道:
> Hi,
>
> On 12/2/20 4:51 AM, Allenzh li wrote:
> > Hi, recently, I want to add a label to all alerting expr, is there any
> > way to acheive that?
>
> What exactly are you trying to do? Technically, you can use alert
> relabeling to add a static (or at least deterministic) label to each
> outgoing alert.
> Depending on what you want to accomplish, there may be better ways though.
>
> Kind regards,
> Christian
>
--
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/5e2a2f13-a3d7-4e71-a4dd-fdaf3ac719e0n%40googlegroups.com.