Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
qichaoch opened this issue Sep 3, 2019 · 1 comment
Open

Comments

@qichaoch
Copy link

qichaoch commented Sep 3, 2019

抑制描述中:“当已经发送的告警通知匹配到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>, ... ] ]
@buptzhoutian
Copy link

抑制描述中:“当已经发送的告警通知匹配到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>, ... ] ]

"正确表述"里有个地方写错了,是笔误吧~
最后那个 source_match 应该是 target_match

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants