In this lesson · topic 2 of 7
Topic 2
Burn rate and multi-window alerts
8 min read
What to alert on
The simplest alert watches the error ratio: fire when more than some fixed share of requests fail over the last few minutes. It is easy to build and it works for large outages. But the number you pick has no connection to your objective. Pick it too high and it misses slow trouble. Pick it too low and it fires on every blip, until people stop reading the pages.
An alert should say that the budget is in danger. For that, measure the burn rate: how fast the error budget is being spent, compared with the rate that would spend it exactly over the whole window. A burn rate of one uses the budget up as the window ends. A burn rate of ten empties it in a tenth of the window, which for a 30-day objective is three days.
The arithmetic is short. The budget rate is one minus the target, so 0.1 percent errors for a 99.9 percent objective. Burn rate is the measured error ratio divided by the budget rate. Time until the budget is gone is the window divided by the burn rate.
Three ways to alert
A threshold on the error ratio fires when the ratio over a short window passes a fixed line. It reacts quickly to a total outage. A short burst can trip it, and it can miss a slow, steady problem entirely if the line is set above it.
A single-window burn-rate alert fires when the burn rate over one window passes a line. With a long window, such as an hour, short bursts average away and only sustained trouble gets through. The price is that it reacts later, and it keeps firing for a long time after the problem ends, because the bad minutes stay in the window. With a short window it reacts quickly and has the same problem as the threshold.
A multi-window, multi-burn-rate alert has two ideas. First, fire only if the burn rate is high over a long window and also over a short one. The long window says this is large enough to matter. The short window says it is still happening now, so the alert clears quickly when the problem stops. Second, use several pairs, at different burn rates, for different urgencies.
The Site Reliability Workbook gives one such set for a 30-day, 99.9 percent objective:
| Burn rate | Long window | Short window | Share of budget used when it fires | Action |
|---|---|---|---|---|
| 14.4 | 1 hour | 5 minutes | 2% | Page |
| 6 | 6 hours | 30 minutes | 5% | Page |
| 1 | 3 days | 6 hours | 10% | Ticket |
Each row is chosen so that firing means a fixed share of the budget has already gone. The first row catches fast trouble within minutes. The last catches the slow leak that would never trip a fast alert but would still empty the budget within the window, and it asks for a ticket, not a page.
Watching two windows
Step through the same ten minutes of errors, once as an outage and once as a short blip.
Why a burn-rate alert needs two windows
Step 1 / 6- burn, 60 min
- 0.0x
- burn, 5 min
- 0.0x
Quiet
The service runs at an error ratio far below the budget rate of 0.1 percent. Both windows read a burn rate near zero.
The errors start
Every request fails, which burns the budget far faster than the limit allows. The short window fills quickly and shows the biggest number. The long window is slower to fill, but the failures are so complete that it passes the limit within about a minute.
Do both windows agree?
Yes. The long window says this is large enough to matter and the short window says it is happening now. The alert fires.
The errors stop
The service recovers. The short window holds the last failed minutes and starts to drain. The long window still remembers the whole outage.
The short window clears the alert
Five minutes after the last failure the short window is clean. Because the rule needs both windows, the alert clears at once. A rule that used the long window alone would still be firing about a problem that is over.
What each rule did
The two-window rule fired at minute 40 and cleared at minute 54. The long window alone would have kept firing until minute 109.
- Quiet. The service runs at an error ratio far below the budget rate of 0.1 percent. Both windows read a burn rate near zero. burn, 60 min: 0.0x; burn, 5 min: 0.0x.
- The errors start. Every request fails, which burns the budget far faster than the limit allows. The short window fills quickly and shows the biggest number. The long window is slower to fill, but the failures are so complete that it passes the limit within about a minute. burn, 60 min: 33.4x; burn, 5 min: 400.1x.
- Do both windows agree?. Yes. The long window says this is large enough to matter and the short window says it is happening now. The alert fires. alert: firing; 5 min window alone: would fire.
- The errors stop. The service recovers. The short window holds the last failed minutes and starts to drain. The long window still remembers the whole outage. burn, 60 min: 166.7x; burn, 5 min: 800.0x.
- The short window clears the alert. Five minutes after the last failure the short window is clean. Because the rule needs both windows, the alert clears at once. A rule that used the long window alone would still be firing about a problem that is over. two-window alert: cleared; 60 min window alone: still firing.
- What each rule did. The two-window rule fired at minute 40 and cleared at minute 54. The long window alone would have kept firing until minute 109. two-window alert: minute 40 to 54; 60 min window alone: minute 40 to 109.