{{ define "teletempl" }}
{{ .CommonLabels.alertname }} :
{{- if eq .Status "firing" -}}
{{ .Status | toUpper}} 🔥
{{- end -}}
{{- if eq .Status "resolved" -}}
{{ .Status | toUpper}} ✅
{{- end -}}
{{ $alerts_count := len .Alerts }}
{{ if eq $alerts_count 1 -}} {{/* Single alert block */}}
{{ .CommonAnnotations.summary }}
Host: {{ .CommonLabels.host }}
Instance: {{ .CommonLabels.instance }}
Job: {{ .CommonLabels.job }}
Details:
{{ .CommonAnnotations.description }}
Alert started: [ {{ .CommonAnnotations.alert_started_vl_time }} ]
{{- else -}} {{/* Grouped alert block */}}
{{ .CommonAnnotations.summary }}
Job: {{ .CommonLabels.job }}
Instances:
{{- range .Alerts }}
{{ .Labels.instance }} [ {{ .Annotations.alert_started_vl_time }} ]
{{- end }}
{{ end }}
{{ end }}