alerting rule
A Prometheus rule with a PromQL expression that describes an unhealthy condition, plus a for duration, labels and annotations.
In more detail
Prometheus evaluates the expression at every evaluation interval. When it has stayed true for the for duration, the alert fires and is sent on for routing. Labels identify ownership and routing; annotations explain the symptom and the next step.
Example
- alert: CheckoutErrors
expr: sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m])) > 0.02
for: 5mRelated terms
- for duration — The part of an alerting rule saying how long its condition must stay true before the alert fires.
- alert annotation — Descriptive text attached to an alert, such as a summary of the symptom and a link to the dashboard or runbook.
- firing — The state of an alert whose condition has stayed true for the whole for duration, so it is sent to be routed to people.
- evaluation interval — How often Prometheus re-runs its alerting and recording rules, such as every 15 seconds.
- PromQL — The query language of Prometheus, used to select time series and calculate rates, sums and percentiles from them.
Taught in
- Prometheus Scraping And The Pull Model — Full-Stack Observability: Metrics, Tracing & Logging
- Alerting Rules And The For Duration — Full-Stack Observability: Metrics, Tracing & Logging
- Ninety Minutes, No Question Count: Exam Strategy — Prometheus Certified Associate (PCA) Exam Prep
- Forty Seconds At Two: Push, Pull And Service Discovery — Prometheus Certified Associate (PCA) Exam Prep
- Where Did Two Hours Go? Prometheus Architecture — Prometheus Certified Associate (PCA) Exam Prep
- A Week Without A Scrape: Configuration And Relabelling — Prometheus Certified Associate (PCA) Exam Prep
- A Database You Cannot Recompile: Exporters — Prometheus Certified Associate (PCA) Exam Prep
- Milliseconds Versus Seconds: Naming Metrics And Labels — Prometheus Certified Associate (PCA) Exam Prep
- Paged Three Minutes Late: Alerting Rules — Prometheus Certified Associate (PCA) Exam Prep
- Forty One Buzzes: Routing Alerts With Alertmanager — Prometheus Certified Associate (PCA) Exam Prep
- Alerting Sprint: Eleven Calls In Three Rounds — Prometheus Certified Associate (PCA) Exam Prep