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

How do you calculate budget consumed by a specific incident?

AdvancedConceptError Budgets & Burn-Rate Alerting
Answer
budget consumed = bad events during incident / total budget events
example: 18,000 failed requests, monthly budget 50,000 -> 36% consumed

In Prometheus, with the incident window known:

sum(increase(http_requests_total{job="checkout",code=~"5.."}[45m] @ 1731150000))
/
(0.001 * sum(increase(http_requests_total{job="checkout"}[30d] @ 1731150000)))

The @ modifier evaluates at the incident end timestamp. Put the number in the postmortem.

All SRE & Reliability questions Roadmap: SRE & incident response

More on Error Budgets & Burn-Rate Alerting