From 4a9d4de80cb800efa35d16439fdc7589e3e25157 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Thu, 19 Nov 2015 14:45:49 +0100 Subject: [PATCH] Improve default subject template --- template/default.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/default.tmpl b/template/default.tmpl index 323d8618..5f5925d9 100644 --- a/template/default.tmpl +++ b/template/default.tmpl @@ -1,4 +1,4 @@ -{{ define "__subject" }}{{$dot := .}}[{{ .Status }}] {{ range $k := .GroupLabelnames }}{{ index $dot.GroupLabels $k }} {{ end }}{{if gt (len .AlertCommonLabels) (len .GroupLabels) }}({{ range $k := .AlertCommonLabelnames }}{{ if eq "" (index $dot.GroupLabels $k) }}{{ index $dot.AlertCommonLabels $k }}{{ end }}){{ end }}{{ end }}{{ end }} +{{ define "__subject" }}{{$dot := .}}[{{ .Status }}:{{ .Alerts | len }}] {{ range $k := .GroupLabelnames }}{{ index $dot.GroupLabels $k }} {{ end }}{{if gt (len .AlertCommonLabels) (len .GroupLabels) }}({{ range $k := .AlertCommonLabelnames }}{{ if eq "" (index $dot.GroupLabels $k) }}{{ index $dot.AlertCommonLabels $k }}{{ end }}{{ end }}){{ end }}{{ end }} {{ define "slack.default.fallback" }} {{ template "__subject" . }}