{{ end }} {{ if ne .EmbeddedImage "" }} {{ end }} {{ if gt (len .Annotations.SortedPairs) 0 }} {{ end }} {{ end }} {{ if gt (len .Message) 0 }}
{{ .Message }} {{ else }}
{{Subject .Subject "{{.Title}}"}} {{ define "alert" }} {{ if ne .ImageURL "" }}
Alerting Panel
Alerting Chart Attached Below
Value: {{ .ValueString }}
{{ range .Annotations.SortedPairs }}

{{ .Name }}: {{ .Value }}

{{ end }}
Labels:
    {{ range .Labels.SortedPairs }}
  • {{ .Name }}: {{ .Value }}
  • {{ end }}
{{ if .SilenceURL }} Silence {{ end }} {{ if .Annotations.runbook_url }} View Runbook {{ end }} {{ if .DashboardURL}} Go to Dashboard {{ end }} {{ if .PanelURL}} Go to Panel {{ end }} {{ if gt (len .GeneratorURL) 0 }}Source{{ end }}
{{ if gt (len .Alerts.Firing) 0 }} {{ range .Alerts.Firing }} {{ template "alert" . }} {{ end }} {{ end }} {{ if gt (len .Alerts.Resolved) 0 }} {{ range .Alerts.Resolved }} {{ template "alert" . }} {{ end }} {{ end }}
Firing: {{ .Alerts.Firing | len }} alert{{ if gt (len .Alerts.Firing) 1 }}s{{ end }}{{ if gt (len .GroupLabels.SortedPairs) 1 }} for {{ range .GroupLabels.SortedPairs }} {{ .Name }}={{ .Value }} {{ end }}{{ end }}
Firing {{ .Labels.alertname }}
Resolved: {{ .Alerts.Resolved | len }} alert{{ if gt (len .Alerts.Resolved) 1 }}s{{ end }}{{ if gt (len .GroupLabels.SortedPairs) 1 }} for {{ range .GroupLabels.SortedPairs }} {{ .Name }}={{ .Value }} {{ end }}{{ end }}
Resolved {{ .Labels.alertname }}
Go to alerts page
{{ end }}