Menu
Documentation
Grafana Cloud
Alerts and IRM
Alerting
Configure notifications
Configure notification messages
Reference
Grafana Cloud
Reference
Data
Alert
Name | Kind | Description | Example |
---|---|---|---|
Status | string | Firing or resolved | {{ .Status }} |
Labels | KV | The labels for this alert | {{ .Labels }} |
Annotations | KV | The annotations for this alert | {{ .Annotations }} |
Values | KV | The values of all expressions, including Classic Conditions | {{ .Values }} |
StartsAt | Time | The time the alert fired | {{ .StartsAt }} |
EndsAt | Time | {{ .EndsAt }} | |
GeneratorURL | string | A link to Grafana, or the Alertmanager if using an external Alertmanager | {{ .GeneratorURL }} |
SilenceURL | string | A link to silence the alert | {{ .SilenceURL }} |
DashboardURL | string | A link to the Grafana Dashboard if the alert has a Dashboard UID annotation | {{ .DashboardURL }} |
PanelURL | string | A link to the panel if the alert has a Panel ID annotation | {{ .PanelURL }} |
Fingerprint | string | A unique string that identifies the alert | {{ .Fingerprint }} |
ValueString | string | A string that contains the labels and value of each reduced expression in the alert. | {{ .ValueString }} |
ExtendedData
Name | Kind | Description | Example |
---|---|---|---|
Receiver | string | The name of the contact point sending the notification | {{ .Receiver }} |
Status | string | The status is firing if at least one alert is firing, otherwise resolved | {{ .Status }} |
Alerts | []Alert | List of all firing and resolved alerts in this notification | There are {{ len .Alerts }} alerts |
Firing alerts | []Alert | List of all firing alerts in this notification | There are {{ len .Alerts.Firing }} firing alerts |
Resolved alerts | []Alert | List of all resolved alerts in this notification | There are {{ len .Alerts.Resolved }} resolved alerts |
GroupLabels | KV | The labels that group these alerts in this | {{ .GroupLabels }} |
CommonLabels | KV | The labels common to all alerts in this notification | {{ .CommonLabels }} |
CommonAnnotations | KV | The annotations common to all alerts in this notification | {{ .CommonAnnotations }} |
ExternalURL | string | A link to Grafana, or the Alertmanager that sent this notification if using an external Alertmanager | {{ .ExternalURL }} |
KV
KV
is a set of key value pairs, where each key and value is a string. If a KV happens to contain numbers or bools then these are string representations of the numeric or boolean value.
Here is an example of a KV, the annotations of an alert:
yaml
summary: 'A summary of the alert'
description: 'A description of the alert'
In addition to iterating over each key value pair, you can sort the pairs, remove keys, and iterate over just the keys or the values.
Name | Description | Arguments | Returns | Example |
---|---|---|---|---|
SortedPairs | Sorts | {{ .Annotations.SortedPairs }} | ||
Remove | Returns a copy of the KV with the keys removed | []string | {{ .Annotations.Remove "summary" }} | |
Names | A list of the names | {{ .Names }} | ||
Values | A list of the values | {{ .Values }} |
Time
Time is from the Go time
package.
You can format a time in a number of different formats using the date
function.
For example, to print the time that an alert fired in the format 15:04:05 MST
:
{{ .StartsAt | date "15:04:05 MST" }}
You can also use the tz
function to change the timezone from UTC to a local time. For example:
{{ .StartsAt | tz "Europe/Paris" | date "15:04:05 MST" }}
You can find a reference for Go’s time format here.
Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
![Getting started with the Grafana LGTM Stack](/static/assets/featured/getting-started-with-grafana-lgtm-stack-amer_featured.png?w=200 200w, /static/assets/featured/getting-started-with-grafana-lgtm-stack-amer_featured.png?w=400 400w)
Getting started with the Grafana LGTM Stack
In this webinar, we’ll demo how to get started using the LGTM Stack: Loki for logs, Grafana for visualization, Tempo for traces, and Mimir for metrics.
![Intro to Kubernetes monitoring in Grafana Cloud](/media/webinar/Screenshot-2024-02-12-at-4.09.30-PM.png?w=200 200w, /media/webinar/Screenshot-2024-02-12-at-4.09.30-PM.png?w=400 400w)
Intro to Kubernetes monitoring in Grafana Cloud
In this webinar you’ll learn how Grafana offers developers and SREs a simple and quick-to-value solution for monitoring their Kubernetes infrastructure.
![Building advanced Grafana dashboards](/media/webinar/AMER_buildadv_notxt.png?w=200 200w, /media/webinar/AMER_buildadv_notxt.png?w=400 400w)
Building advanced Grafana dashboards
In this webinar, we’ll demo how to build and format Grafana dashboards.