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
(cherry picked from commit 7f702f881c)
This commit is contained in:
committed by
Sofia Papagiannaki
parent
90fe6c5a9f
commit
af364fb91d
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user