

# Template reference
<a name="v10-alerting-template-reference"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 10.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

This section provides reference information for creating your templates.

**Alert (type)**

The alert type contains the following data.


| Name | Kind | Description | Example | 
| --- | --- | --- | --- | 
|  Status  |  string  |  `firing` or `resolved`.  | \$1\$1 .Status \$1\$1 | 
|  Labels  |  KeyValue  |  A set of labels attached to the alert.  | \$1\$1 .Labels \$1\$1 | 
|  Annotations  |  KeyValue  |  A set of annotations attached to the alert.  | \$1\$1 .Annotations \$1\$1 | 
| Values | KeyValue | The values of all expressions, including Classic Conditions | \$1\$1 .Values \$1\$1 | 
|  StartsAt  |  time.Time  |  Time the alert started firing.  | \$1\$1 .StartsAt \$1\$1 | 
|  EndsAt  |  time.Time  |  Only set if the end time of an alert is known. Otherwise set to a configurable timeout period from the time since the last alert was received.  | \$1\$1 .EndsAt \$1\$1 | 
|  GeneratorURL  |  string  |  A back link to Grafana or external Alertmanager.  | \$1\$1 .GeneratorURL \$1\$1 | 
|  SilenceURL  |  string  |  A link to silence the alert (with labels for this alert pre-filled). Only for Grafana managed alerts.  | \$1\$1 .SilenceURL\$1\$1 | 
|  DashboardURL  |  string  |  Link to grafana dashboard, if alert rule belongs to one. Only for Grafana managed alerts.  | \$1\$1 .DashboardURL \$1\$1 | 
|  PanelURL  |  string  |  Link to grafana dashboard panel, if alert rule belongs to one. Only for Grafana managed alerts.  | \$1\$1 .PanelURL \$1\$1 | 
|  Fingerprint  |  string  |  Fingerprint that can be used to identify the alert.  | \$1\$1 .Fingerprint \$1\$1 | 
|  ValueString  |  string  |  A string that contains the labels and value of each reduced expression in the alert.  | \$1\$1 .ValueString \$1\$1 | 

 **ExtendedData**

The ExtendedData object contains the following properties.


| 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  |  `KeyValue`  |  The labels that group these alerts int his notification.  |  `{{ .GroupLabels }}`  | 
|  CommonLabels  |  `KeyValue`  |  The labels common to all alerts in this notification.  |  `{{ .CommonLabels }}`  | 
|  CommonAnnotations  |  `KeyValue`  |  The annotations common to all alerts in this notification.  |  `{{ .CommonAnnotations }}`  | 
|  ExternalURL  |  `string`  |  A link to the Grafana workspace or Alertmanager that sent this notification.  |  `{{ .ExternalURL }}`  | 

**KeyValue type**

The `KeyValue` type is a set of key/value string pairs that represent labels and annotations.

In addition to direct access of the data stored as a `KeyValue`, there are also methods for sorting, removing, and transforming the data.


| Name | Arguments | Returns | Notes | Example | 
| --- | --- | --- | --- | --- | 
|  SortedPairs  |    |  Sorted list of key and value string pairs  |    | `{{ .Annotations.SortedPairs }}` | 
|  Remove  |  []string  |  KeyValue  |  Returns a copy of the Key/Value map without the given keys.  | `{{ .Annotations.Remove "summary" }}` | 
|  Names  |    |  []string  |  List of names  | `{{ .Names }}` | 
|  Values  |    |  []string  |  List of values  | `{{ .Values }}` | 

**Time**

Time is from the Go [https://pkg.go.dev/time#Time](https://pkg.go.dev/time#Time) package. You can print a time in a number of different formats. For example, to print the time that an alert fired in the format `Monday, 1st January 2022 at 10:00AM`, you write the following template:

```
{{ .StartsAt.Format "Monday, 2 January 2006 at 3:04PM" }}
```

You can find a reference for Go’s time format [here](https://pkg.go.dev/time#pkg-constants).