Compute SLO error budget burn rates
Why it matters On-call teams page on burn rate (for example above 14 over an hour) for LLM and model-serving APIs.
A model API with a 99.9% success SLO may fail 0.1% of requests. The burn rate says how fast each window spends that allowance: 1.0 is exactly on budget, above 1 is too fast.
Write burn_rates(windows, slo). windows is a list of (total_requests, errors). For each window, burn = (errors / total) / (1 - slo), or 0.0 if total is 0. Also compute remaining = 1 - (sum of errors) / ((1 - slo) * sum of totals), the fraction of the overall budget left (it can be negative); use 1.0 when there are no requests. Return (list of burn rates, remaining).
def burn_rates(windows, slo)Example
burn_rates([(1000, 2), (1000, 5)], 0.999) gives ([2.0, 5.0], -2.5).
Understand the idea
An SLO (service level objective) such as "99.9% of requests succeed" comes with an error budget: the 0.1% of requests that are allowed to fail. Burn rate measures how fast you are spending that budget compared with the steady pace that would use it up exactly at the end of the period.
Example with SLO 99.9%: the allowed error rate is 0.001. An hour with 2 errors in 1000 requests has an error rate of 0.002, a burn rate of 2, meaning twice the safe pace. Across 2000 requests the budget allows 2 errors; 7 happened, so remaining = 1 - 7/2 = -2.5, deep in the red.
Rules: burn = error_rate / (1 - SLO); remaining = 1 - errors / ((1 - SLO) * requests).
Alerting on burn rate over short and long windows catches both sudden outages and slow leaks in model-serving systems.