From 27e075bfaee6f849879082d6cc439434938ae558 Mon Sep 17 00:00:00 2001 From: zhaoxiangchun Date: Wed, 29 Apr 2020 15:07:58 +0800 Subject: [PATCH] =?UTF-8?q?monitor,=E5=AF=B9=E4=BA=8E=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E6=95=B0=E6=8D=AEnodata=EF=BC=8C=E9=BB=98=E8=AE=A4=E4=B8=8D?= =?UTF-8?q?=E5=8F=91=E9=80=81=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/monitor/alerting/notifiers/base.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/monitor/alerting/notifiers/base.go b/pkg/monitor/alerting/notifiers/base.go index cfc54ba895..e903623356 100644 --- a/pkg/monitor/alerting/notifiers/base.go +++ b/pkg/monitor/alerting/notifiers/base.go @@ -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