पाठ 24 / 35
Burn-Rate Alerting
यह पाठ अभी हिंदी में अनुवादित नहीं है, इसलिए अंग्रेज़ी में दिखाया जा रहा है।
Compute burn rate and design multi-window alerts that page fast for big outages and stay quiet for blips.
लेखक: Rahul Agarwal · 15 साल से वेब डेवलपर
How fast are we spending the budget?
Alerting on "error rate above 1% for 5 minutes" has two problems: it fires on harmless short spikes and misses slow leaks that quietly eat the monthly budget. Burn rate fixes this by asking how fast the error budget is being consumed relative to plan.
Burn rate = observed error ratio / allowed error ratio. With a 99.9% SLO, the allowed ratio is 0.1%. A burn rate of 1 spends exactly the whole budget in the 30-day window. A burn rate of 14.4 spends 2% of a 30-day budget in one hour and would exhaust it in about two days.
The Google SRE Workbook recommends multi-window, multi-burn-rate alerts. Page when the burn is high over a long window (14.4x over 1 hour) and still high over a short window (the last 5 minutes), so the alert stops soon after recovery. Add a slower page (6x over 6 hours) and a ticket for gradual leaks (around 1x over several days). The long window gives significance; the short window gives fast reset.
Burn rate to time-to-exhaustion
Higher burn rates leave less time before the 30-day budget is gone, which is why they deserve a page rather than a ticket.
slo = 0.999
budget = 1 - slo # 0.1% of requests may fail over 30 days
for err in (0.001, 0.005, 0.0144, 0.05):
burn = err / budget
hours_left = 30 * 24 / burn
print(f"error ratio {err:6.2%} -> burn {burn:5.1f}x, budget gone in {hours_left:6.1f} h")
Output:
error ratio 0.10% -> burn 1.0x, budget gone in 720.0 h error ratio 0.50% -> burn 5.0x, budget gone in 144.0 h error ratio 1.44% -> burn 14.4x, budget gone in 50.0 h error ratio 5.00% -> burn 50.0x, budget gone in 14.4 h
Low traffic breaks percentages
A service with ten requests an hour hits a 10% error ratio from a single failure. For low-traffic services, add a minimum request count to the alert condition, use longer windows, or generate synthetic traffic so each failure is not a page.
त्वरित जाँच: Why do burn-rate alerts combine a long window (1 h) with a short window (5 min)?
- The long window shows the problem is significant; the short window confirms it is still happening, so the alert resolves quickly
- Prometheus requires two windows in every rule
- The short window doubles the sampling rate
- It halves the storage needed for the metrics
Answer
The long window shows the problem is significant; the short window confirms it is still happening, so the alert resolves quickly — Requiring both conditions avoids paging on brief spikes (the long window) and avoids alerts that keep firing long after recovery (the short window).