{{Subject .Subject "{{.Title}}"}}
{{ define "alert" }}
Value: {{ .ValueString }}
|
{{ if gt (len .Annotations.SortedPairs) 0 }}
{{ range .Annotations.SortedPairs }}
{{ .Name }}: {{ .Value }}
{{ end }}
|
{{ 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 }}
|
|
{{ end }}
{{ if gt (len .Message) 0 }}
{{ .Message }}
{{ else }}
{{ if gt (len .Alerts.Firing) 0 }}
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 }}
|
{{ range .Alerts.Firing }}
Firing
|
{{ .Labels.alertname }}
|
{{ template "alert" . }}
{{ end }}
{{ end }}
{{ if gt (len .Alerts.Resolved) 0 }}
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 }}
|
{{ range .Alerts.Resolved }}
Resolved
|
{{ .Labels.alertname }}
|
{{ template "alert" . }}
{{ end }}
{{ end }}
Go to alerts page
|
|
{{ end }}
|