Skip to content

Instantly share code, notes, and snippets.

@realkarmakun
Last active January 3, 2023 19:11
Show Gist options
  • Save realkarmakun/74d8dc8a0b422fb0da8a7c2627e4f1ff to your computer and use it in GitHub Desktop.
Save realkarmakun/74d8dc8a0b422fb0da8a7c2627e4f1ff to your computer and use it in GitHub Desktop.
Grafana alertmanager Telegram Template. Just some Telegram template I use for my Grafana alerts
{{ define "TelegramAlert" }}
{{ if eq .Status "firing" }}πŸ”₯<b>[FIRING {{end}}{{ if eq .Status "resolved" }}βœ…<b>[RESOLVED {{end}}ALERT]</b>
{{ range .Alerts -}}
πŸ”Ž <b>Title:</b> <i>{{ .Annotations.title }}</i>
{{ if .Labels.severity }} πŸ“– <b>Status:</b> `{{ .Labels.severity }}`{{ end }}
🏷️ <b>Labels:</b>
{{ range .Labels.SortedPairs }} πŸ”– <i><b>{{ .Name }}:</b> {{ .Value }}</i>
{{end}}
πŸ“š <b>Description:</b> {{ .Annotations.description }}
{{ if gt (len .GeneratorURL) 0 }}πŸ’₯ <b>Source:</b> {{ .GeneratorURL }}{{ end }}
{{ if gt (len .SilenceURL) 0 }}πŸ”• <b>Silence:</b> {{ .SilenceURL }}{{ end }}
{{ end }}
{{ end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment