Alertmanager 的 Inhibition 和 Silences 配置说明
Inhibition:抑制是指当警报发出后,停止重复发送由此警报引发其他错误的警报的机制。抑制规则,是存在另一组匹配器匹配的情况下,静音其他被引发警报的规则。这两个警报,必须有一组相同的标签。
# Matchers that have to be fulfilled in the alerts to be muted.
## 必须在要需要静音的警报中履行的匹配者
target_match:
[ <labelname>: <labelvalue>, ... ]
target_match_re:
[ <labelname>: <regex>, ... ]
# Matchers for which one or more alerts have to exist for the
# inhibition to take effect.
# 必须存在一个或多个警报以使抑制生效的匹配者。
source_match:
[ <labelname>: <labelvalue>, ... ]
source_match_re:
[ <labelname>: <regex>, ... ]
# Labels that must have an equal value in the source and target
# alert for the inhibition to take effect.
# 在源和目标警报中必须具有相等值的标签才能使抑制生效
[ equal: '[' <labelname>, ... ']' ]
例子:
inhibit_rules:
- source_match:
severity: 'critical'
target_match:
severity: 'warning'
equal:
- alertname
- instance
Silences:是快速地通过Web配置,使警报暂时静音的一种方法。在尝试解决严重的生产问题时,这对避免收到垃圾邮件很有用。