From 495768ee37808eed4a2f8ed4102c7721cfacf291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sat, 3 Jun 2017 14:51:17 -0700 Subject: [PATCH] Correctly update alerts --- timer.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/timer.go b/timer.go index 86ffabdb0..127b6a0cc 100644 --- a/timer.go +++ b/timer.go @@ -91,11 +91,12 @@ func PullFromAlertmanager() { metricAlerts.With(prometheus.Labels{"state": alert.State}).Inc() } - for _, hint := range transform.BuildAutocomplete(ag.Alerts) { + for _, hint := range transform.BuildAutocomplete(alerts) { acMap[hint.Value] = hint } - sort.Sort(&ag.Alerts) + sort.Sort(&alerts) + ag.Alerts = alerts // ID is unique to each group ag.ID = fmt.Sprintf("%x", structhash.Sha1(ag.Labels, 1))