bugfix: handle rule judge

This commit is contained in:
Ulric Qin 2021-12-06 18:44:56 +08:00
parent 88063cd30e
commit bef8e8e548
1 changed files with 10 additions and 0 deletions

View File

@ -173,6 +173,16 @@ func (ws *WorkersType) Build(rids []int64) {
}
func (r RuleEval) judge(vectors []Vector) {
// 有可能rule的一些配置已经发生变化比如告警接收人、callbacks等
// 这些信息的修改是不会引起worker restart的但是确实会影响告警处理逻辑
// 所以这里直接从memsto.AlertRuleCache中获取并覆盖
curRule := memsto.AlertRuleCache.Get(r.rule.Id)
if curRule == nil {
return
}
r.rule = curRule
count := len(vectors)
alertingKeys := make(map[string]struct{})
now := time.Now().Unix()