Menu
Grafana Cloud
Enterprise
Open source
Notification template reference
By default, Grafana provides predefined templates to format notification messages.
You can also customize your notifications with custom templates, which are based on the Go template language.
This documentation lists the data available for use in notification templates.
Notification Data
In notification templates, dot (.) is initialized with the following data:
It’s important to remember that
a single notification can group multiple alerts to reduce the number of alerts you receive. Alerts is an array that includes all the alerts in the notification.
Here’s an example that prints all available notification data from dot (.):
{{ define "custom_template" }}
{{ .Receiver }}
{{ .Status }}
There are {{ len .Alerts }} alerts
There are {{ len .Alerts.Firing }} firing alerts
There are {{ len .Alerts.Resolved }} resolved alerts
{{ .GroupLabels }}
{{ .CommonLabels }}
{{ .CommonAnnotations }}
{{ .ExternalURL }}
{{ end }}You can execute this template by passing the dot (.):
{{ template "custom_template" . }}Alert
Alert contains data for an individual alert: