fix(alert): alert test should return error when it failed to dispatch

This commit is contained in:
huydx
2016-12-12 18:20:50 +09:00
committed by huydx
parent 06b4dacaa4
commit 015fa82cf5
7 changed files with 7 additions and 0 deletions

View File

@ -89,6 +89,7 @@ func (this *EmailNotifier) Notify(evalContext *alerting.EvalContext) error {
if err != nil {
this.log.Error("Failed to send alert notification email", "error", err)
return err
}
return nil

View File

@ -112,6 +112,7 @@ func (this *OpsGenieNotifier) closeAlert(evalContext *alerting.EvalContext) erro
if err := bus.DispatchCtx(evalContext.Ctx, cmd); err != nil {
this.log.Error("Failed to send notification to OpsGenie", "error", err, "body", string(body))
return err
}
return nil

View File

@ -89,6 +89,7 @@ func (this *PagerdutyNotifier) Notify(evalContext *alerting.EvalContext) error {
if err := bus.DispatchCtx(evalContext.Ctx, cmd); err != nil {
this.log.Error("Failed to send notification to Pagerduty", "error", err, "body", string(body))
return err
}
return nil

View File

@ -105,6 +105,7 @@ func (this *SlackNotifier) Notify(evalContext *alerting.EvalContext) error {
if err := bus.DispatchCtx(evalContext.Ctx, cmd); err != nil {
this.log.Error("Failed to send slack notification", "error", err, "webhook", this.Name)
return err
}
return nil

View File

@ -94,6 +94,7 @@ func (this *VictoropsNotifier) Notify(evalContext *alerting.EvalContext) error {
if err := bus.DispatchCtx(evalContext.Ctx, cmd); err != nil {
this.log.Error("Failed to send victorops notification", "error", err, "webhook", this.Name)
return err
}
return nil

View File

@ -74,6 +74,7 @@ func (this *WebhookNotifier) Notify(evalContext *alerting.EvalContext) error {
if err := bus.DispatchCtx(evalContext.Ctx, cmd); err != nil {
this.log.Error("Failed to send webhook", "error", err, "webhook", this.Name)
return err
}
return nil

Submodule public/app/plugins/datasource/imon-datasource added at e8d219fa68