There's no way to get at the rule group name unfortunately.

There is a pending PR however to allow you to set common labels for alerts
within a group: https://github.com/prometheus/prometheus/pull/11474. If
that was merged (looking into it), then you could set a common severity
label and route on that.

On Wed, Nov 23, 2022 at 11:21 AM chen sr <[email protected]> wrote:

> I want to defined serverity level by group name , for example:
> rule file:
>     groups:
>      - name: *critical_for_xxx*
>         rules:
>          - alert: xxxx
>      - name: waring_for_xxx
>
> alerting:
>     alert_relabel_configs:
>      - source_labels: [ ... ]
>         regex: (*critical*).+
>         target_label: serverity
>         replacement: critical
> what it needs in source_labels [  ] to regex rule name to match?
>
> --
> 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/7a235498-d3a6-4fb6-9847-3488edc31f04n%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/7a235498-d3a6-4fb6-9847-3488edc31f04n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Julius Volz
PromLabs - promlabs.com

-- 
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/CAObpH5wpctho%3DH%2B%2BhJhHp7q_WpT8Nw5VzT%2B7i2DGcBr4F1%2B%2Bag%40mail.gmail.com.

Reply via email to