monitor,对于监控数据nodata,默认不发送邮件

This commit is contained in:
zhaoxiangchun
2020-04-29 15:17:54 +08:00
parent 4d1b93e29e
commit e81334c0a7
+5
View File
@@ -52,6 +52,11 @@ func (n *NotifierBase) ShouldNotify(_ context.Context, evalCtx *alerting.EvalCon
prevState := evalCtx.PrevAlertState
newState := evalCtx.Rule.State
//Do not notify if alert state is no_data
if newState == monitor.AlertStateNoData {
return false
}
// Only notify on state change
if prevState == newState && !n.SendReminder {
return false