Merge pull request #15118 from zexi/automated-cherry-pick-of-#15117-upstream-master

Automated cherry pick of #15117: fix(monitor): monitor error message
This commit is contained in:
Zexi Li
2022-10-08 12:03:36 +08:00
committed by GitHub
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -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 {
+1 -1
View File
@@ -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
}