Skip to content
Snippets Groups Projects
Commit c3f92387 authored by James Turnbull's avatar James Turnbull Committed by Brian Brazil
Browse files

Updated alert templating docs (#3596)

The docs suggest that alert templating only works in the summary and
description annotation fields. Some testing and a review of the code
suggests this is no longer true and that you can template any
annotation field.
parent 9c9f96b2
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -5,11 +5,11 @@ sort_rank: 4
 
# Template examples
 
Prometheus supports templating in the summary and description fields of
alerts, as well as in served console pages. Templates have the ability to run
queries against the local database, iterate over data, use conditionals, format
data, etc. The Prometheus templating language is based on the
[Go templating](http://golang.org/pkg/text/template/) system.
Prometheus supports templating in the annotations and labels of alerts,
as well as in served console pages. Templates have the ability to run
queries against the local database, iterate over data, use conditionals,
format data, etc. The Prometheus templating language is based on the [Go
templating](http://golang.org/pkg/text/template/) system.
 
## Simple alert field templates
 
Loading
Loading
@@ -19,7 +19,6 @@ expr: up == 0
for: 5m
labels:
- severity: page
annotations:
- summary: "Instance {{$labels.instance}} down"
- description: "{{$labels.instance}} of job {{$labels.job}} has been down for more than 5 minutes."
Loading
Loading
Loading
Loading
@@ -5,11 +5,11 @@ sort_rank: 5
 
# Template reference
 
Prometheus supports templating in the summary and description fields of
alerts, as well as in served console pages. Templates have the ability to run
queries against the local database, iterate over data, use conditionals, format
data, etc. The Prometheus templating language is based on the
[Go templating](http://golang.org/pkg/text/template/) system.
Prometheus supports templating in the annotations and labels of alerts,
as well as in served console pages. Templates have the ability to run
queries against the local database, iterate over data, use conditionals,
format data, etc. The Prometheus templating language is based on the [Go
templating](http://golang.org/pkg/text/template/) system.
 
## Data Structures
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment