diff --git a/argocd/manifests/grafana/alerting.yaml b/argocd/manifests/grafana/alerting.yaml index 7f60749..ae9e891 100644 --- a/argocd/manifests/grafana/alerting.yaml +++ b/argocd/manifests/grafana/alerting.yaml @@ -88,15 +88,16 @@ templates: name: ntfy-infra template: | {{ define "ntfy-infra.payload" -}} - {{ $msg := "" -}} - {{ range .Alerts -}} - {{ $msg = printf "%s%s\n" $msg .Annotations.summary -}} - {{ end -}} - {{ $actions := coll.Slice -}} - {{ range .Alerts -}} - {{ if .Annotations.runbook_url -}} - {{ $actions = coll.Slice (coll.Dict "action" "view" "label" "Open Runbook" "url" .Annotations.runbook_url "clear" false) -}} - {{ end -}} - {{ end -}} - {{ data.ToJSON (coll.Dict "topic" "infra-alerts" "title" (printf "[%s] %s" (.Status | toUpper) .CommonLabels.alertname) "message" $msg "priority" 3 "actions" $actions) -}} - {{ end }} + {{- $msg := "" -}} + {{- range .Alerts -}} + {{- $msg = (printf "%s%s\n" $msg .Annotations.summary) -}} + {{- end -}} + {{- $title := (printf "[%s] %s" (.Status | toUpper) .CommonLabels.alertname) -}} + {{- $actions := coll.Slice -}} + {{- range .Alerts -}} + {{- if .Annotations.runbook_url -}} + {{- $actions = coll.Append (coll.Dict "action" "view" "label" "Open Runbook" "url" .Annotations.runbook_url) $actions -}} + {{- end -}} + {{- end -}} + {{- coll.Dict "topic" "infra-alerts" "title" $title "message" $msg "priority" 3 "actions" $actions | data.ToJSON -}} + {{- end }}