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: 5m

Related terms

Taught in

References

Certification courses