{{- define "telegram.forust.message" -}} {{- $statusEmoji := "🚨" -}} {{- if ne .Status "firing" -}}{{- $statusEmoji = "✅" -}}{{- end -}} {{- $count := len .Alerts.Firing -}} {{- if eq .Status "resolved" -}}{{- $count = len .Alerts.Resolved -}}{{- end -}} {{ $statusEmoji }} {{ .Status | toUpper }} ({{ $count }}) {{- range .Alerts }} {{ .Labels.alertname }} {{- $sev := .Labels.severity }} {{- if eq $sev "critical" }} đŸ”Ĩ critical {{- else if eq $sev "warning" }} âš ī¸ warning {{- else if eq $sev "info" }} â„šī¸ info {{- else if $sev }} â€ĸ {{ $sev }} {{- end }} {{- if .Annotations.description }} {{ .Annotations.description }} {{- end }} {{- if .Labels.namespace }} đŸ“Ļ Namespace: {{ .Labels.namespace }} {{- end }} {{- if .Labels.pod }} đŸ“Ļ Pod: {{ .Labels.pod }} {{- end }} {{- if .Labels.container }} đŸŗ Container: {{ .Labels.container }} {{- end }} {{- if .Labels.node }} đŸ–Ĩ Node: {{ .Labels.node }} {{- end }} {{- if .Labels.instance }} đŸ–Ĩ Instance: {{ .Labels.instance }} {{- end }} {{- if .Labels.job }} 🔧 Job: {{ .Labels.job }} {{- end }} {{- if eq .Status "firing" }} 🕐 Since: {{ .StartsAt | date "2006-01-02 15:04 MST" }} {{- else }} 🕐 Resolved: {{ .EndsAt | date "2006-01-02 15:04 MST" }} {{- end }} {{- end }} {{- end }}