Created
July 12, 2024 05:52
-
-
Save febri4n/80637a9cacf6e204a2a2f25890bbc519 to your computer and use it in GitHub Desktop.
template alert grafana email
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 "mailbody" }} | |
{{ range . }} | |
{{ if gt (len .Annotations) 0 }} | |
{{.Annotations.summary}} | |
{{ end }} | |
{{ range .Labels.SortedPairs }} | |
{{ end }} | |
{{ end }}{{ end }} | |
{{ define "mailsubject" }} | |
{{ with .Alerts.Firing }}🔥 [Alerting]{{ template "mailbody" . }} | |
{{ end }} | |
{{ with .Alerts.Resolved }}✅ [ОК]{{ template "mailbody" . }} | |
{{ end }} | |
{{ end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment