diff --git a/pkg/monitor/alerting/notifier.go b/pkg/monitor/alerting/notifier.go index fae04ea400..5d27f2be15 100644 --- a/pkg/monitor/alerting/notifier.go +++ b/pkg/monitor/alerting/notifier.go @@ -145,7 +145,9 @@ func (n *notificationService) getNeededNotifiers(nIds []string, evalCtx *EvalCon } if shouldNotify || evalCtx.Rule.State == monitor.AlertStateAlerting { go func() { - n.createAlertRecordWhenNotify(evalCtx, shouldNotify) + if err := n.createAlertRecordWhenNotify(evalCtx, shouldNotify); err != nil { + log.Errorf("createAlertRecordWhenNotify error: %v", err) + } }() } if !shouldNotify && evalCtx.shouldUpdateAlertState() && evalCtx.NoDataFound { diff --git a/pkg/monitor/alerting/notifiers/base.go b/pkg/monitor/alerting/notifiers/base.go index 5ed5d3f395..00c3b43e18 100644 --- a/pkg/monitor/alerting/notifiers/base.go +++ b/pkg/monitor/alerting/notifiers/base.go @@ -56,7 +56,7 @@ 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 + // Do not notify if alert state is no_data if newState == monitor.AlertStateNoData { return false }