-
-
Save Eyeless77/457f877b0660faed30b660cd892d1307 to your computer and use it in GitHub Desktop.
Alertmanager telegram template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ define "__yucca_text_alert_list" }}{{ range . }} | |
--- | |
πͺͺ <b>{{ .Labels.alertname }}</b> | |
{{- if .Annotations.summary }} | |
π {{ .Annotations.summary }}{{ end }} | |
{{- if .Annotations.description }} | |
π {{ .Annotations.description }}{{ end }} | |
π· Labels: | |
{{ range .Labels.SortedPairs }} <i>{{ .Name }}</i>: <code>{{ .Value }}</code> | |
{{ end }}{{ end }} | |
π <a href="https://yucca.app/">Grafana</a> π <a href="https://yucca.app/">Alertmanager</a> π <a href="https://yucca.app/">Prometheus</a> π | |
{{ end }} | |
{{ define "telegram.yucca.message" }} | |
{{ if gt (len .Alerts.Firing) 0 }} | |
π₯ Alerts Firing π₯ | |
{{ template "__yucca_text_alert_list" .Alerts.Firing }} | |
{{ end }} | |
{{ if gt (len .Alerts.Resolved) 0 }} | |
β Alerts Resolved β | |
{{ template "__yucca_text_alert_list" .Alerts.Resolved }} | |
{{ end }} | |
{{ end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment