忽略 prometheus alertmanager 禁止规则

Ignore prometheus alertmanager inhibit rule

我有以下禁止规则:

######## INHIBIT RULES ########
# Inhibit Rules: https://prometheus.io/docs/alerting/latest/configuration/#inhibit_rule
inhibit_rules:
- source_match:
    severity: 'critical'
  target_match:
    severity: 'warning'
  # Apply inhibition if the alertname is the same on the same host.
  equal: ['alertname', 'instance', 'url']
###############################

这项工作在 99% 的时间内都按预期工作,但是,一些成员希望他们的受监控设备忽略禁止规则。

有什么方法可以为那些 targets/rules 添加标签,以便:

if label ignore_inhibit is true

do not inhibit

else

proceed as planned

(我知道如何添加标签,我只是不知道如何让 alertmanagere 尽可能忽略该标签)

使用以下 inhibit_rules:

inhibit_rules:
- source_match:
    severity: 'critical'
  target_matchers:
    matchers: [ severity = warning, ignore_inhibit != true ]
  equal: ['alertname', 'instance', 'url']