Skip to content

第3章告警处理的“屏蔽告警通知”表述有严重问题 #41

@qichaoch

Description

@qichaoch

抑制描述中:“当已经发送的告警通知匹配到target_match和target_match_re规则,当有新的告警规则如果满足source_match或者定义的匹配规则,并且已发送的告警与新产生的告警中equal定义的标签完全相同,则启动抑制机制,新的告警不会发送。“
应该刚好相反,source_match是用来匹配已经存在的告警的,而target_match是用来匹配新发的待抑制的告警的。
正确的表述是:规则开始启用后,已经存在/发送的告警通知匹配到source_match和source_match_re规则,当有新的告警满足source_match或者定义的匹配规则,同时已发送的告警与新产生的告警中equal定义的标签完全相同,则启动抑制机制,新的告警不会发送。

可参见Prometheus官方文档中的注释:

# 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>, ... ] ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions