From 89ef325eaf5f35f32b1ade89550ecb184af48246 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Mon, 27 May 2024 16:05:14 +0100 Subject: Fix AlertManager Discord instance formatting We made a change to include the instance in alerts sent to Discord, but not all of our configured alerts send this field. As a result, we would have incorrectly formatted alerts being sent through to Discord which were tricky to read. The format template has now been changed to only conditionally render the instance label if it is present on a triggered alert. --- kubernetes/namespaces/monitoring/alerts/alertmanager.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kubernetes/namespaces') diff --git a/kubernetes/namespaces/monitoring/alerts/alertmanager.yaml b/kubernetes/namespaces/monitoring/alerts/alertmanager.yaml index 0c53ee3..558f208 100644 --- a/kubernetes/namespaces/monitoring/alerts/alertmanager.yaml +++ b/kubernetes/namespaces/monitoring/alerts/alertmanager.yaml @@ -22,7 +22,7 @@ receivers: title: '{{ if eq .Status "firing" }}[FIRING]{{ else }}[RESOLVED]{{ end }}' text: | {{ if eq .Status "firing" }}{{ range .Alerts }} - `{{ .Labels.instance }}`: **{{ .Annotations.summary }}:** + {{ if .Labels.instance }}`{{ .Labels.instance }}`: {{ end }}**{{ .Annotations.summary }}:** {{ .Annotations.description }} [(Link)]({{.GeneratorURL}}) {{ end }}{{ else }}Alert has resolved.{{ end }} -- cgit v1.2.3