From 7ba0a9e81acfa2abba6199efaf36ade544e97e3a Mon Sep 17 00:00:00 2001 From: Goutham Veeramachaneni Date: Fri, 31 Mar 2017 22:59:20 +0530 Subject: [PATCH] Add Comment About Initialising Counters --- notifier/notifier.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/notifier/notifier.go b/notifier/notifier.go index 54f5d02f3..f49c1d51d 100644 --- a/notifier/notifier.go +++ b/notifier/notifier.go @@ -183,10 +183,6 @@ func (n *Notifier) ApplyConfig(conf *config.Config) error { return err } - for _, am := range ams.ams { - n.metrics.errors.WithLabelValues(am.url()) - n.metrics.sent.WithLabelValues(am.url()) - } ams.metrics = n.metrics amSets = append(amSets, ams) @@ -495,6 +491,7 @@ func (s *alertmanagerSet) Sync(tgs []*config.TargetGroup) { continue } + // This will initialise the Counters for the AM to 0. s.metrics.sent.WithLabelValues(us) s.metrics.errors.WithLabelValues(us)