grafana/public/emails/ng_alert_notification.txt

67 lines
1.9 KiB
Plaintext
Raw Normal View History

{{- define "__default_message" -}}
You have {{ len .Alerts.Firing }} firing alert(s), and {{ len .Alerts.Resolved }} resolved alert(s) for {{ .GroupLabels }}
Email: Allow configuration of content types for email notifications (#34530) * Alerting: Allow configuration of content types for email notifications * Fix lint error * Improves email templates * Improve configuration documentation Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> * Improve code comments Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> * Improve configuration documentation Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> * Improve email template * Remove unnecessary predeclaration Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Adds handling for unrecognized content type Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Move utility function outside of util package * Fixes syntax * Remove unused package * Fix lint error * improve email templates * Fix test * Alerting: Allow configuration of content types for email notifications * Fix lint error * Improves email templates * Improve configuration documentation Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> * Improve code comments Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> * Improve configuration documentation Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> * Improve email template * Remove unnecessary predeclaration Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Adds handling for unrecognized content type Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Move utility function outside of util package * Fixes syntax * Remove unused package * Fix lint error * improve email templates * Fix test * Fix comment style Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com> * Fix template formatting * Add test and improve error handling * Fix test * Fix formatting * Fix formatting * Improve documentation and regenerates txt template * Update docs/sources/administration/configuration.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> Co-authored-by: Djairho Geuens <djairho.geuens@ae.be> Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com> Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-07-19 05:31:51 -05:00
{{ if .Alerts.Firing -}}
({{ len .Alerts.Firing }}) FIRING
-----------
{{ template "__default_alerts_summarize" .Alerts.Firing }}
{{- end }}
{{- if .Alerts.Resolved }}
({{ len .Alerts.Resolved }}) RESOLVED
-------------
{{ template "__default_alerts_summarize" .Alerts.Resolved }}
{{- end }}
Go to the Alerts page: {{ .AlertPageUrl }}
{{- end -}}
{{- define "__default_alerts_summarize" -}}
{{- range . }}
{{- template "__default_alert_labels" . }}
{{- template "__default_alert_annotations" . }}
{{ end }}
{{- end -}}
{{- define "__default_alert_labels" -}}
{{- $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" -}}
{{- $annotations := .Annotations -}}
{{- if index $annotations "summary" }}
Summary: {{ index .Annotations "summary" -}}
{{- $annotations = $annotations.Remove (toStrings (list "summary")) }}
{{- end -}}
{{- if index $annotations "description" }}
Description: {{ index $annotations "description" -}}
{{- $annotations = $annotations.Remove (toStrings (list "description")) }}
{{- end -}}
{{- if index $annotations "runbook_url" }}
Runbook: {{ index $annotations "runbook_url" -}}
{{- $annotations = $annotations.Remove (toStrings (list "runbook_url")) }}
{{- end -}}
{{- if $annotations }}
Annotations: {{ template "__default_sorted_pairs" $annotations }}
{{- end -}}
{{- end -}}
{{- define "__default_sorted_pairs" -}}
{{ range .SortedPairs }}
- {{ .Name }} = {{ .Value }}
{{- end }}
{{- end -}}
{{- if .Message -}}
{{ .Message }}
{{- else -}}
{{ template "__default_message" . }}
{{- end }}
2023-06-14 17:24:43 -05:00
Sent by Grafana v{{.BuildVersion}} (c) {{now | date "2006"}} Grafana Labs