diff --git a/docs/configuration/alerting_rules.md b/docs/configuration/alerting_rules.md index 7ba56dace..eab53baf6 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