code refactor
This commit is contained in:
parent
f5e2b43526
commit
cc32194fb6
|
@ -30,9 +30,8 @@ func matchMute(event *models.AlertCurEvent, mute *models.AlertMute, clock ...int
|
|||
if ts < mute.Btime || ts > mute.Etime {
|
||||
return false
|
||||
}
|
||||
tg := event.TagsMap
|
||||
tg["rulename"] = event.RuleName
|
||||
return matchTags(tg, mute.ITags)
|
||||
|
||||
return matchTags(event.TagsMap, mute.ITags)
|
||||
}
|
||||
|
||||
func matchTag(value string, filter models.TagFilter) bool {
|
||||
|
|
|
@ -294,6 +294,8 @@ func (r RuleEval) judge(vectors []conv.Vector) {
|
|||
tagsMap[arr[0]] = arr[1]
|
||||
}
|
||||
|
||||
tagsMap["rulename"] = r.rule.Name
|
||||
|
||||
// handle target note
|
||||
targetIdent, has := vectors[i].Labels["ident"]
|
||||
targetNote := ""
|
||||
|
|
Loading…
Reference in New Issue