Agent Wranglers

OPS-4Recommended

Alert on how fast the budget burns

Page a person when the error budget burns fast enough to run out soon. Open a ticket for slow burns.

How to do it

Use two windows per alert, a long one and one twelve times shorter, so alerts start fast and stop soon after recovery. The Google SRE workbook pages at 14.4 times the normal burn over 1 hour, and at 6 times over 6 hours. It opens a ticket at the normal burn over 3 days. These factors spend 2%, 5% and 10% of a 30-day budget. For another window, scale the factor by the window length in days divided by 30. Alert when payments start failing applies the same idea to payments.

Examples

YAML example

# Prometheus: page when about 2% of a 30-day budget burns within 1 hour (99.9% objective)
- alert: CheckoutFastBurn
  expr: |
    (sum(rate(http_requests_total{job="checkout",code=~"5.."}[1h])) / sum(rate(http_requests_total{job="checkout"}[1h]))) > (14.4 * 0.001)
    and
    (sum(rate(http_requests_total{job="checkout",code=~"5.."}[5m])) / sum(rate(http_requests_total{job="checkout"}[5m]))) > (14.4 * 0.001)
  labels:
    severity: page

How to check

Inject 100% errors on staging. The page fires within 5 minutes. Twice the budgeted error rate for an hour opens no page. A steady 1.5 times the budgeted rate opens a ticket within 3 days.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/operations/service-levels/burn-rate-alerts">Agent Wranglers operations and observability playbook</a>. In code you write, add a comment next to it with the same link.