Interview Prep/SRE & Reliability/Error Budgets & Burn-Rate Alerting

How do you test burn-rate alert rules before deploying them?

AdvancedConceptError Budgets & Burn-Rate Alerting
Answer

With promtool test rules and synthetic input series:

rule_files: [checkout-slo.rules.yaml]
evaluation_interval: 1m
tests:
  - interval: 1m
    input_series:
      - series: 'http_requests_total{job="checkout",code="200"}'
        values: '0+600x120'
      - series: 'http_requests_total{job="checkout",code="503"}'
        values: '0+120x120'
    alert_rule_test:
      - eval_time: 60m
        alertname: CheckoutErrorBudgetBurnFast
        exp_alerts:
          - exp_labels: {severity: page, slo: checkout-availability}

Add a negative case (0.05% errors) that must produce exp_alerts: []. Run it in CI next to promtool check rules.

All SRE & Reliability questions Roadmap: SRE & incident response

More on Error Budgets & Burn-Rate Alerting