mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: All notification channels should always send (#19807)
Fixes so that all notification channels configured for an alert should try to send notification even if one notification channel fails to send a notification. Signed-off-by: Abhilash Gnan <abhilashgnan@gmail.com> Fixes #19768
This commit is contained in:
parent
2e18930285
commit
7f702f881c
@ -37,6 +37,7 @@ type notificationService struct {
|
||||
func (n *notificationService) SendIfNeeded(context *EvalContext) error {
|
||||
notifierStates, err := n.getNeededNotifiers(context.Rule.OrgID, context.Rule.Notifications, context)
|
||||
if err != nil {
|
||||
n.log.Error("Failed to get alert notifiers", "error", err)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -109,10 +110,11 @@ func (n *notificationService) sendNotifications(evalContext *EvalContext, notifi
|
||||
err := n.sendNotification(evalContext, notifierState)
|
||||
if err != nil {
|
||||
n.log.Error("failed to send notification", "uid", notifierState.notifier.GetNotifierUID(), "error", err)
|
||||
return err
|
||||
if evalContext.IsTestRun {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user