From aacf9da9693dbee45c2bdbb517276eca9258d5ba Mon Sep 17 00:00:00 2001 From: George Robinson Date: Mon, 20 Feb 2023 10:08:23 +0000 Subject: [PATCH] Alerting: Change Data to use Labels instead of map[string]string (#63431) This commit changes the Data struct in template.go to use Labels instead of map[string]string. It changes how labels are printed when using {{ .Labels }} from map[foo:bar bar:baz] to foo=bar, bar=baz. --- pkg/services/ngalert/state/template/template.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/ngalert/state/template/template.go b/pkg/services/ngalert/state/template/template.go index c2f3966e343..6743cf46880 100644 --- a/pkg/services/ngalert/state/template/template.go +++ b/pkg/services/ngalert/state/template/template.go @@ -70,7 +70,7 @@ func NewValues(caps map[string]eval.NumberValueCapture) map[string]Value { } type Data struct { - Labels map[string]string + Labels Labels Values map[string]Value Value string }