首页 > 解决方案 > Prometheus - 当同一警报处于严重状态时禁止警告警报

问题描述

我尝试抑制警报,因此严重的相同警报可以抑制警告警报。以下配置不起作用...请提出此配置的问题..

inhibit_rules:
- source_match:
    alertname: Inhibit
    severity: critical
  target_match:
    severity: warning
    alertname: KubePodNotReady
  equal: ['alertname', 'namespace', 'pod', 'prometheus']

inhibit_rules:
- source_match:
    severity: 'critical'
  target_match:
    severity: 'warning'
  equal: ['alertname', 'namespace', 'pod','prometheus']

标签: prometheus-alertmanager

解决方案


下面的配置对我有用。

inhibit_rules:
 - source_match:
       severity: critical
       alertname: KubePodNotReady
   target_match:
       severity: warning
       alertname: KubePodNotReady
   equal: ['namespace', 'pod', 'prometheus']

推荐阅读