fix(monitor): monitor error message

This commit is contained in:
Zexi Li
2022-10-08 10:22:55 +08:00
parent fd6e54c8b8
commit 4fca491f73
2 changed files with 4 additions and 2 deletions

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 {

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
}