未验证 提交 18a9288b 编写于 作者: T Tripitakav 提交者: GitHub

fix mute bug (#1025)

Co-authored-by: Ntripitakav <chengzhi.shang@longbridge.sg>
上级 fe82886f
......@@ -30,8 +30,9 @@ func matchMute(event *models.AlertCurEvent, mute *models.AlertMute, clock ...int
if ts < mute.Btime || ts > mute.Etime {
return false
}
return matchTags(event.TagsMap, mute.ITags)
tg := event.TagsMap
tg["alertname"] = event.RuleName
return matchTags(tg, mute.ITags)
}
func matchTags(eventTagsMap map[string]string, itags []models.TagFilter) bool {
......
......@@ -314,6 +314,7 @@ func (r RuleEval) judge(vectors []conv.Vector) {
TriggerTime: vectors[i].Timestamp,
TagsMap: tagsMap,
GroupId: r.rule.GroupId,
RuleName: r.rule.Name,
}
bg := memsto.BusiGroupCache.GetByBusiGroupId(r.rule.GroupId)
......@@ -321,7 +322,7 @@ func (r RuleEval) judge(vectors []conv.Vector) {
event.GroupName = bg.Name
}
// isMuted only need TriggerTime and TagsMap
// isMuted only need TriggerTime RuleName and TagsMap
if isMuted(event) {
logger.Infof("event_muted: rule_id=%d %s", r.rule.Id, vectors[i].Key)
continue
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册