From 081b93c6b8a26391332fa463d7998a93785a4d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sat, 3 Jun 2017 18:43:50 -0700 Subject: [PATCH] Group ID needs to include receiver name --- timer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/timer.go b/timer.go index 42e7a467e..6aa399bad 100644 --- a/timer.go +++ b/timer.go @@ -69,7 +69,10 @@ func PullFromAlertmanager() { log.Infof("Deduplicating alert groups (%d)", len(alertGroups)) uniqueGroups := map[string]models.AlertGroup{} for _, ag := range alertGroups { - agID := fmt.Sprintf("%x", structhash.Sha1(ag.Labels, 1)) + agIDHasher := sha1.New() + io.WriteString(agIDHasher, ag.Receiver) + io.WriteString(agIDHasher, fmt.Sprintf("%x", structhash.Sha1(ag.Labels, 1))) + agID := fmt.Sprintf("%x", agIDHasher.Sum(nil)) if _, found := uniqueGroups[agID]; !found { uniqueGroups[agID] = ag }