2025-10-06 18:41:01 +02:00
|
|
|
{{/* Template enhanced to include resolved alerts while using annotations. */}}
|
|
|
|
|
{{ $firingCount := len .Alerts.Firing -}}
|
|
|
|
|
{{ $resolvedCount := len .Alerts.Resolved -}}
|
|
|
|
|
|
|
|
|
|
{{ if or (gt $firingCount 0) (gt $resolvedCount 0) -}}
|
|
|
|
|
{{ if and (gt $firingCount 0) (gt $resolvedCount 0) -}}
|
|
|
|
|
<b>{{ $firingCount }} firing</b> / <b>{{ $resolvedCount }} resolved</b>
|
|
|
|
|
{{ if gt $firingCount 0 -}}
|
|
|
|
|
<b>Firing:</b>
|
2025-10-04 18:05:10 +02:00
|
|
|
{{- range .Alerts.Firing }}
|
2025-10-06 18:41:01 +02:00
|
|
|
• <b>{{ or .Annotations.summary "No summary" }}</b>{{ with .Annotations.description }} — {{ . }}{{ end }}
|
2025-10-04 18:05:10 +02:00
|
|
|
{{- end }}
|
2025-10-06 18:41:01 +02:00
|
|
|
{{ end -}}
|
|
|
|
|
{{ if gt $resolvedCount 0 -}}
|
|
|
|
|
<b>Resolved:</b>
|
|
|
|
|
{{- range .Alerts.Resolved }}
|
|
|
|
|
• <b>{{ or .Annotations.summary "No summary" }}</b>{{ with .Annotations.description }} — {{ . }}{{ end }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{ end -}}
|
|
|
|
|
{{ else if gt $firingCount 0 -}}
|
|
|
|
|
<b>{{ $firingCount }} alert{{ if ne $firingCount 1 }}s{{ end }} firing</b>:
|
|
|
|
|
{{- range .Alerts.Firing }}
|
|
|
|
|
• <b>{{ or .Annotations.summary "No summary" }}</b>{{ with .Annotations.description }} — {{ . }}{{ end }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{ else -}}
|
|
|
|
|
<b>{{ $resolvedCount }} alert{{ if ne $resolvedCount 1 }}s{{ end }} resolved</b>:
|
|
|
|
|
{{- range .Alerts.Resolved }}
|
|
|
|
|
• <b>{{ or .Annotations.summary "No summary" }}</b>{{ with .Annotations.description }} — {{ . }}{{ end }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{ end -}}
|
2025-10-04 18:05:10 +02:00
|
|
|
{{ else -}}
|
2025-10-06 18:41:01 +02:00
|
|
|
<b>No alert data</b> — nothing firing or recently resolved.
|
2025-10-04 18:05:10 +02:00
|
|
|
{{ end -}}
|