-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Svyatoslav Dumchenko
committed
Sep 25, 2018
1 parent
cf8e41c
commit d73859e
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{ define "telegram_title" }}[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .CommonLabels.alertname }} @ {{ .CommonLabels.identifier }} {{ end }} | ||
|
||
{{ define "telegram_message" }} | ||
{{ if gt (len .Alerts.Firing) 0 }} | ||
*Alerts Firing:* | ||
{{ range .Alerts.Firing }}• {{ .Labels.instance }}: {{ .Annotations.description }} | ||
{{ end }}{{ end }} | ||
{{ if gt (len .Alerts.Resolved) 0 }} | ||
*Alerts Resolved:* | ||
{{ range .Alerts.Resolved }}• {{ .Labels.instance }}: {{ .Annotations.description }} | ||
{{ end }}{{ end }}{{ end }} | ||
|
||
{{ define "telegram_text" }}{{ template "telegram_title" .}} | ||
{{ template "telegram_message" . }}{{ end }} |