fix mute bug (#1025)
Co-authored-by: tripitakav <chengzhi.shang@longbridge.sg>
This commit is contained in:
parent
fe82886f09
commit
18a9288b75
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue