mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Show the alertname for each alert in plain text email (#70183)
This commit is contained in:
@@ -17,17 +17,18 @@ Go to the Alerts page: [[ .AlertPageUrl ]]
|
||||
|
||||
[[- define "__default_alerts_summarize" -]]
|
||||
[[- range . ]]
|
||||
[[ template "__default_alert_labels" . ]]
|
||||
[[- template "__default_alert_labels" . ]]
|
||||
[[- template "__default_alert_annotations" . ]]
|
||||
[[ end ]]
|
||||
[[- end -]]
|
||||
|
||||
[[- define "__default_alert_labels" -]]
|
||||
[[- if gt (len .Labels) 3 -]]
|
||||
Labels: [[ template "__default_sorted_pairs" .Labels ]]
|
||||
[[- else -]]
|
||||
Labels: [[ .Labels.SortedPairs ]]
|
||||
[[- end -]]
|
||||
[[- $labels := .Labels -]]
|
||||
[[- if index $labels "alertname" ]]
|
||||
Alertname: [[ index .Labels "alertname" -]]
|
||||
[[ $labels = $labels.Remove (toStrings (list "alertname")) ]]
|
||||
[[- end ]]
|
||||
Labels: [[ template "__default_sorted_pairs" $labels ]]
|
||||
[[- end -]]
|
||||
|
||||
[[- define "__default_alert_annotations" -]]
|
||||
|
||||
Reference in New Issue
Block a user