{{/* Links & Resources - https://prometheus.io/blog/2016/03/03/custom-alertmanager-templates/ - https://prometheus.io/docs/alerting/latest/notifications/ - https://gist.github.com/jidckii/5ac5f8f20368b56de72af70222509b7b */}} {{ define "alert-item.telegram.ccchh.internal" }} [{{ .Labels.alertname }}] {{ .Labels.nodename }} {{- if .Annotations.summary }} Summary: {{ .Annotations.summary }} {{- end }} {{- if .Annotations.description }} Description: {{ .Annotations.description }} {{- end }} Labels: {{ range .Labels.SortedPairs -}} • {{ .Name }}: {{ .Value }} {{ end }} {{- end }} {{ define "alert-message.telegram.ccchh" }} {{- if .Alerts.Firing }} 🔥{{ len .Alerts.Firing }} Alert(/s) Firing 🔥 {{ range .Alerts.Firing -}} {{ template "alert-item.telegram.ccchh.internal" . }} {{- end }} {{- end }} {{- if .Alerts.Resolved }} ✅{{ len .Alerts.Resolved }} Alert(/s) Resolved ✅ {{ range .Alerts.Resolved -}} {{ template "alert-item.telegram.ccchh.internal" . }} {{- end }} {{- end }} {{- end }}