From c3f9238756d1ac8ba3521bedb6986db89e61e5cc Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Tue, 19 Dec 2017 03:04:06 -0500 Subject: [PATCH] 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. --- docs/configuration/template_examples.md | 11 +++++------ docs/configuration/template_reference.md | 10 +++++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/docs/configuration/template_examples.md b/docs/configuration/template_examples.md index 5737c43288..2f35a0fe55 100644 --- a/docs/configuration/template_examples.md +++ b/docs/configuration/template_examples.md @@ -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 @@ -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." diff --git a/docs/configuration/template_reference.md b/docs/configuration/template_reference.md index dabea627f1..fada2ca410 100644 --- a/docs/configuration/template_reference.md +++ b/docs/configuration/template_reference.md @@ -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