diff --git a/hosts/AZ-PRM-1/services/monitoring/alerting.nix b/hosts/AZ-PRM-1/services/monitoring/alerting.nix index 7f6e5ac..4c6459c 100644 --- a/hosts/AZ-PRM-1/services/monitoring/alerting.nix +++ b/hosts/AZ-PRM-1/services/monitoring/alerting.nix @@ -245,32 +245,10 @@ in { settings = { url = "$GRAFANA_NTFY_WEBHOOK_URL"; httpMethod = "POST"; - title = '' - {{ if eq .Status "resolved" }}RESOLVED{{ else }}FIRING{{ end }}: {{ index .CommonLabels "alertname" }}{{ with index .CommonLabels "target" }} {{ . }}{{ else }}{{ with index .CommonLabels "flow_id" }} {{ . }}{{ else }}{{ with index .CommonLabels "instance" }} {{ . }}{{ end }}{{ end }}{{ end }} - ''; - message = '' - {{ range .Alerts -}} - {{ $labels := .Labels -}} - {{ if eq .Status "resolved" }}✅ Resolved{{ else }}🚨 Firing{{ end }}: {{ index $labels "alertname" }} - {{ with index $labels "target" }}Target: {{ . }} - {{ end -}} - {{ with index $labels "flow_id" }}Flow: {{ with index $labels "namespace_id" }}{{ . }}/{{ end }}{{ . }} - {{ end -}} - {{ with index $labels "instance" }}Instance: {{ . }} - {{ end -}} - {{ with index $labels "severity" }}Severity: {{ . }} - {{ end -}} - {{ with .Annotations.SortedPairs }}Annotations: - {{ range . }}- {{ .Name }}: {{ .Value }} - {{ end -}} - {{ else }}{{ with $.CommonAnnotations.SortedPairs }}Annotations: - {{ range . }}- {{ .Name }}: {{ .Value }} - {{ end -}} - {{ end }}{{ end -}} - {{ with .GeneratorURL }}Source: {{ . }} - {{ end }} - {{ end -}} - ''; + # Let Grafana render its default title/message. The default message + # includes all alert annotations via .Annotations.SortedPairs; + # ntfy's grafana template then displays only title/message instead + # of the full webhook JSON body. headers = { Template = "grafana"; Markdown = "yes";