From 8cf279efb18ba35e7ed5de0ef62d755f94932563 Mon Sep 17 00:00:00 2001 From: Brian Brazil Date: Tue, 31 Oct 2017 14:05:58 +0000 Subject: [PATCH] Document new alerting rule format. --- docs/configuration/alerting_rules.md | 70 ++++++++++++++++------------ 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/docs/configuration/alerting_rules.md b/docs/configuration/alerting_rules.md index 7ba56dace7..eab53baf6d 100644 --- a/docs/configuration/alerting_rules.md +++ b/docs/configuration/alerting_rules.md @@ -11,31 +11,36 @@ to an external service. Whenever the alert expression results in one or more vector elements at a given point in time, the alert counts as active for these elements' label sets. +### Defining alerting rules + Alerting rules are configured in Prometheus in the same way as [recording rules](recording_rules.md). -### Defining alerting rules +An example rules file with an alert would be: -Alerting rules are defined in the following syntax: +```yaml +groups: +- name: example + rules: + - alert: HighErrorRate + expr: job:request_latency_seconds:mean5m{job="myjob"} > 0.5 + for: 10m + labels: + severity: page + annotations: + summary: High request latency +``` - ALERT - IF - [ FOR ] - [ LABELS