Created
September 2, 2025 14:06
-
-
Save wolfkarl/9a00de3dc6d058419e9f181298d3b4b1 to your computer and use it in GitHub Desktop.
Mattermost Webhook Grafana Notification Template
This file contains hidden or 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
| { | |
| "text": "{{ if eq .Status "firing" }}:fire: **ALERT FIRING** :fire:{{ else }}:white_check_mark: **ALERT RESOLVED** :white_check_mark:{{ end }}", | |
| "attachments": [ | |
| { | |
| "color": "{{ if eq .Status "firing" }}danger{{ else }}good{{ end }}", | |
| "title": "{{ .GroupLabels.alertname }}", | |
| "title_link": "{{ .ExternalURL }}", | |
| "text": "{{ range .Alerts }}**Summary:** {{ .Annotations.summary }}\n**Description:** {{ .Annotations.description }}\n{{ end }}", | |
| "fields": [ | |
| { | |
| "title": "Status", | |
| "value": "{{ .Status | title }}", | |
| "short": true | |
| }, | |
| { | |
| "title": "Severity", | |
| "value": "{{ .GroupLabels.severity | title }}", | |
| "short": true | |
| }, | |
| { | |
| "title": "Instance", | |
| "value": "{{ .GroupLabels.instance }}", | |
| "short": true | |
| }, | |
| { | |
| "title": "Job", | |
| "value": "{{ .GroupLabels.job }}", | |
| "short": true | |
| }, | |
| { | |
| "title": "Alert Count", | |
| "value": "{{ len .Alerts }}", | |
| "short": true | |
| }, | |
| { | |
| "title": "Started", | |
| "value": "{{ range .Alerts }}{{ .StartsAt.Format "2006-01-02 15:04:05 UTC" }}{{ end }}", | |
| "short": true | |
| } | |
| ], | |
| "footer": "Grafana Alert" | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment