1. delete recovery event from cache after event is really mark recovery (#758)
This commit is contained in:
parent
8764270f47
commit
9383976918
|
@ -46,7 +46,6 @@ func (s *SafeEventMap) DeleteOrSendRecovery(promql string, toKeepKeys map[string
|
||||||
}
|
}
|
||||||
if ev.ReadableExpression == promql {
|
if ev.ReadableExpression == promql {
|
||||||
logger.Debugf("[to_del][ev.IsRecovery:%+v][ev.LastSend:%+v][promql:%v]", ev.IsRecovery, ev.LastSend, promql)
|
logger.Debugf("[to_del][ev.IsRecovery:%+v][ev.LastSend:%+v][promql:%v]", ev.IsRecovery, ev.LastSend, promql)
|
||||||
delete(s.M, k)
|
|
||||||
now := time.Now().Unix()
|
now := time.Now().Unix()
|
||||||
// promql 没查询到结果,需要将告警标记为已恢复并发送
|
// promql 没查询到结果,需要将告警标记为已恢复并发送
|
||||||
// 同时需要满足 已经发送过触发信息,并且时间差满足 大于AlertDuration
|
// 同时需要满足 已经发送过触发信息,并且时间差满足 大于AlertDuration
|
||||||
|
@ -55,6 +54,7 @@ func (s *SafeEventMap) DeleteOrSendRecovery(promql string, toKeepKeys map[string
|
||||||
logger.Debugf("[prom.alert.MarkRecov][promql:%v][ev.RuleName:%v]", promql, ev.RuleName)
|
logger.Debugf("[prom.alert.MarkRecov][promql:%v][ev.RuleName:%v]", promql, ev.RuleName)
|
||||||
ev.MarkRecov()
|
ev.MarkRecov()
|
||||||
EventQueue.PushFront(ev)
|
EventQueue.PushFront(ev)
|
||||||
|
delete(s.M, k)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue