From b6494960d1b845976a9509082f3cfb572fcd9a14 Mon Sep 17 00:00:00 2001 From: Brian Brazil Date: Wed, 1 Nov 2017 12:58:32 +0000 Subject: [PATCH] docs: Document new recording rule format (#3378) --- docs/configuration/configuration.md | 1 + docs/configuration/recording_rules.md | 83 ++++++++++++++++++++++----- 2 files changed, 69 insertions(+), 15 deletions(-) diff --git a/docs/configuration/configuration.md b/docs/configuration/configuration.md index d2c4d0818..097668c23 100644 --- a/docs/configuration/configuration.md +++ b/docs/configuration/configuration.md @@ -41,6 +41,7 @@ Generic placeholders are defined as follows: * ``: a string that can take the values `http` or `https` * ``: a regular string * ``: a regular string that is a secret, such as a password +* ``: a string which is template-expanded before usage The other placeholders are specified separately. diff --git a/docs/configuration/recording_rules.md b/docs/configuration/recording_rules.md index 58f9fd91a..f51bb9ccc 100644 --- a/docs/configuration/recording_rules.md +++ b/docs/configuration/recording_rules.md @@ -12,6 +12,7 @@ evaluated at regular intervals: recording rules and [alerting rules](alerting_rules.md). To include rules in Prometheus, create a file containing the necessary rule statements and have Prometheus load the file via the `rule_files` field in the [Prometheus configuration](configuration.md). +Rule files use YAML. The rule files can be reloaded at runtime by sending `SIGHUP` to the Prometheus process. The changes are only applied if all rule files are well-formatted. @@ -24,7 +25,7 @@ utility tool: ```bash go get github.com/prometheus/prometheus/cmd/promtool -promtool check-rules /path/to/example.rules +promtool check rules /path/to/example.rules.yml ``` When the file is syntactically valid, the checker prints a textual @@ -44,22 +45,74 @@ the original expression every time it is needed. This is especially useful for dashboards, which need to query the same expression repeatedly every time they refresh. -To add a new recording rule, add a line of the following syntax to your rule -file: +Recording and alerting rules exist in a rule group. Rules within a group are +run sequentially at a regular interval. - [{