From bdb80960a6b389865b8daef7cb5f34cb9cc53904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Tue, 18 May 2021 12:47:50 +0100 Subject: [PATCH] fix(backend): don't skip labels with variants == groups --- cmd/karma/alerts.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/karma/alerts.go b/cmd/karma/alerts.go index 5863eaacd..1cb046107 100644 --- a/cmd/karma/alerts.go +++ b/cmd/karma/alerts.go @@ -325,7 +325,8 @@ func autoGridLabel(dedupedAlerts []models.AlertGroup) string { var lastLabel string var lastCnt int for key, uniqueValues := range candidates { - if uniqueValues == 1 || uniqueValues == alertsCount || uniqueValues == alertGroupsCount { + if uniqueValues == 1 || uniqueValues == alertsCount { + log.Debug().Int("variants", uniqueValues).Int("alerts", alertsCount).Int("groups", alertGroupsCount).Str("label", key).Msg("Excluding label from automatic grid selection") continue } log.Debug().Int("variants", uniqueValues).Str("label", key).Msg("Automatic grid label candidate")