Cool, thanks! Julius Volz <julius.v...@promlabs.com> 于2022年11月25日周五 04:47写道:
> 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 <chens...@gmail.com> 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 prometheus-users+unsubscr...@googlegroups.com. >> 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 > -- 以上 ———————————— 陳水榮 (代號CSR) -- 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-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAHDDX-cqv_gg7wNceLdmjh1uSf3bbRaV%2Bm_vJD0KhxmGkcM-4g%40mail.gmail.com.