mirror of
https://github.com/prometheus/alertmanager
synced 2025-02-16 10:37:09 +00:00
Changes alertmanager_notifications to count attempted notifications (#1578)
alertmanager_notifications_total is increased only on successful notifications, and not on any attempted notification as the current description points Signed-off-by: Chris Mark <chrismarkou92@gmail.com>
This commit is contained in:
parent
50b87ac720
commit
6eaacfe243
@ -663,6 +663,7 @@ func (r RetryStage) Exec(ctx context.Context, l log.Logger, alerts ...*types.Ale
|
||||
now := time.Now()
|
||||
retry, err := r.integration.Notify(ctx, sent...)
|
||||
notificationLatencySeconds.WithLabelValues(r.integration.name).Observe(time.Since(now).Seconds())
|
||||
numNotifications.WithLabelValues(r.integration.name).Inc()
|
||||
if err != nil {
|
||||
numFailedNotifications.WithLabelValues(r.integration.name).Inc()
|
||||
level.Debug(l).Log("msg", "Notify attempt failed", "attempt", i, "integration", r.integration.name, "receiver", r.groupName, "err", err)
|
||||
@ -674,7 +675,6 @@ func (r RetryStage) Exec(ctx context.Context, l log.Logger, alerts ...*types.Ale
|
||||
// integration upon context timeout.
|
||||
iErr = err
|
||||
} else {
|
||||
numNotifications.WithLabelValues(r.integration.name).Inc()
|
||||
return ctx, alerts, nil
|
||||
}
|
||||
case <-ctx.Done():
|
||||
|
Loading…
Reference in New Issue
Block a user