Merge pull request #702 from prometheus/log-failed-notifiers

Include notifier type in retry logs and errors
This commit is contained in:
Julius Volz 2017-04-11 13:00:00 +02:00 committed by GitHub
commit 0ce2de56fc
1 changed files with 2 additions and 2 deletions

View File

@ -543,9 +543,9 @@ func (r RetryStage) Exec(ctx context.Context, alerts ...*types.Alert) (context.C
case <-tick.C:
if retry, err := r.integration.Notify(ctx, alerts...); err != nil {
numFailedNotifications.WithLabelValues(r.integration.name).Inc()
log.Debugf("Notify attempt %d failed: %s", i, err)
log.Debugf("Notify attempt %d for %q failed: %s", i, r.integration.name, err)
if !retry {
return ctx, alerts, fmt.Errorf("Cancelling notify retry due to unrecoverable error: %s", err)
return ctx, alerts, fmt.Errorf("Cancelling notify retry for %q due to unrecoverable error: %s", r.integration.name, err)
}
// Save this error to be able to return the last seen error by an