-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create compact_message_notification_template.yaml
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
etc/grafana/alerting/compact_message_notification_template.yaml
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,25 @@ | ||
# config file version | ||
apiVersion: 1 | ||
|
||
# List of templates to import or update | ||
templates: | ||
# <int> organization ID, default = 1 | ||
- orgId: 1 | ||
# <string, required> name of the template, must be unique | ||
name: compact.message | ||
# <string, required> content of the template | ||
template: | | ||
{{- /* Telegram message to use: {{ template "compact.message" . }} */ -}} | ||
{{ define "__alerts_list" -}} | ||
{{ range . }} | ||
{{ if len .Annotations }} | ||
{{ range .Annotations.SortedPairs -}} | ||
- {{ .Name }}: {{ .Value }} | ||
{{ end -}} | ||
{{ end }} | ||
{{- end -}} {{- /* range */ -}} | ||
{{- end -}} {{- /* define __alerts_list */ -}} | ||
{{ define "telegram.message" }} | ||
{{ if gt (len .Alerts.Firing) 0 }} | ||
{{- template "__alerts_list" .Alerts.Firing }}{{ end -}} | ||
{{- end -}} |