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.
More on Error Budgets & Burn-Rate Alerting
What is an error budget and how do you calculate it?BeginnerWhat is an error-budget policy?BeginnerWhat happens when the error budget is exhausted? Is it a punishment?IntermediateWhat should you do if the error budget is never spent?IntermediateWhat is burn rate?IntermediateHow much budget does an alert at burn rate B over window W consume?Advanced