Skip to content

Alerting on symptoms

The SRE book’s chapter on monitoring says that a monitoring system should answer two questions: what is broken, and why. The two are different alerts. A symptom is what users or callers feel: requests fail, pages are slow. A cause is the state of a component that explains it: a disk is full, a pool is exhausted, a CPU is saturated.

The book’s advice follows from that split. Spend much more effort on catching symptoms than causes, and for causes, worry only about very definite and very imminent ones. A page should mean that users are being hurt now, or about to be.

The reason is how many causes there are. Every component can fail in many ways, and an alert on a cause exists only if someone thought of that cause in advance. A symptom alert watches the one thing that matters, and does not need to know why.

Mental model. A symptom alert is a smoke detector: it goes off for any fire. A cause alert is a sensor for one kind of fire, such as a gas leak in the kitchen. You want the smoke detector to wake you. The sensors help you find the fire.

The lab has an Alerts section. It has two symptom rules, on the whole request: Error budget burning fast, which fires at a burn rate of 14.4× or more, and Whole request slow, which fires when the p95 is above 150 ms. It has eight cause rules, a saturated rule and a failing rule for each of the four services: saturated at 80% of capacity or more, failing when 1% of its calls or more fail. A line above the table counts the alerts that are firing. Keep SLO target at 99.9%.

Something is wrong in the shop, and you can only see what the monitoring shows: dashboards for each service, a trace of one request, and the error budget. Find the component that is the cause.

Incident

Each incident is the shop run by the engine with one thing wrong. You see what the monitoring shows, not what is wrong.

What users feel

Traffic entering the shop
300 requests/snormal: 300 requests/s About normal
Time to answer
mean 71 ms · p95 184 ms · p99 267 msnormal: mean 41 ms · p95 126 ms · p99 197 ms About normal
Requests that fail
0.00215% of requestsnormal: 0.00215% About normal

The mean is exact. The p95 and the p99 are estimates from a gamma fit (see the model notes).

Error budget
The share of requests that must succeed over 30 days.
The budget
43.2 min of complete outageThe share of requests that must succeed over 30 days.
Burn rate
0.02×0.00215% of requests fail, against the 0.1% the SLO allows.
Budget gone in
It lasts the whole windowA burn rate of 1 spends the budget exactly over the 30 days.

This does not page: the burn rate is under 14.4×.

Only failed requests spend the budget. A request that is slow but succeeds does not, so a slowdown can hurt users and leave the budget untouched.

Alerts

A symptom alert watches what users feel, so it fires whatever the cause. A cause alert watches one component for one failure that someone expected: it names the component, but only when that failure is the one happening.

Symptom alerts firing: 1. Cause alerts firing: 0.

Alert rules, and whether they fire now
AlertKindFires whenNowStatus
Error budget burning fastSymptomthe burn rate is 14.4× or more0.02× Quiet
Whole request slowSymptomthe p95 is above 150 ms184 ms Firing
Shop application saturatedCauseit is at 80% of its capacity or more38% Quiet
Shop application failingCause1% of its calls or more fail0% Quiet
Product database saturatedCauseit is at 80% of its capacity or more60% Quiet
Product database failingCause1% of its calls or more fail0% Quiet
Payment provider saturatedCauseit is at 80% of its capacity or more2% Quiet
Payment provider failingCause1% of its calls or more fail0.0431% Quiet
Email delivery service saturatedCauseit is at 80% of its capacity or more2% Quiet
Email delivery service failingCause1% of its calls or more fail0% Quiet

Services: the four golden signals

Each card is one service’s dashboard, now against normal: the same system with no incident, at its usual traffic. ▲ and ▼ mark a figure well above or below normal.

Shop application
Latency
p95 60 msp50 14 ms · p99 92 ms · normal p95 60 ms About normal
Traffic
300 calls/snormal 300 About normal
Errors
0% of calls failnormal 0% About normal
Saturation
38% of capacityqueue 0 of 400 · normal 38% About normal

Time in the service itself, not counting the calls it makes.

Time to answer, counting the calls it makes: 71 ms (normal 41 ms)

Failures as its callers see them: 0.00215% (normal 0.00215%)

Product database
Latency
p95 120 msp50 28 ms · p99 184 ms · normal p95 30 ms Higher than normal
Traffic
300 calls/snormal 300 About normal
Errors
0% of calls failnormal 0% About normal
Saturation
60% of capacityqueue 0 of 125 · normal 15% Higher than normal

Time in the service itself, not counting the calls it makes.

Failures as its callers see them: 0% (normal 0%)

Payment provider
Latency
p95 300 msp50 69 ms · p99 461 ms · normal p95 300 ms About normal
Traffic
15 calls/snormal 15 About normal
Errors
0.0431% of calls failnormal 0.0431% About normal
Saturation
2% of capacityqueue 0 of 10000 · normal 2% About normal

Time in the service itself, not counting the calls it makes.

Failures as its callers see them: 0% (normal 0%)

Email delivery service
Latency
p95 180 msp50 42 ms · p99 276 ms · normal p95 180 ms About normal
Traffic
15 calls/snormal 15 About normal
Errors
0% of calls failnormal 0% About normal
Saturation
2% of capacityqueue 0 of 5000 · normal 2% About normal

Time in the service itself, not counting the calls it makes.

Failures as its callers see them: 0% (normal 0%)

Trace of a request

A trace follows one request through the services, with one span for each. Each span is the mean time the engine gives for that service; real spans vary from request to request.

A usual request: 61 ms in all (normal 31 ms)
ServiceCallsStarts atOn the wireIn the serviceShareTimeline
Shop application10 ms—20 ms33%
Product database120 ms1 ms40 ms67%

The spans add up: 20 ms in Shop application + 1 ms on the wire to Product database + 40 ms in Product database = 61 ms.

A checkout request: 256 ms in all (normal 226 ms) It also calls the services that only some requests call.
ServiceCallsStarts atOn the wireIn the serviceShareTimeline
Shop application10 ms—20 ms8%
Product database120 ms1 ms40 ms16%
Payment provider161 ms25 ms100 ms49%
Email delivery service1186 ms10 ms60 ms27%

The spans add up: 20 ms in Shop application + 1 ms on the wire to Product database + 40 ms in Product database + 25 ms on the wire to Payment provider + 100 ms in Payment provider + 10 ms on the wire to Email delivery service + 60 ms in Email delivery service = 256 ms.

A service called several times is drawn as one row, with its number of calls.

Weighted by how often each call is made, the spans average 71 ms over all requests. The engine’s mean is 71 ms: they agree.

Your diagnosis

Which component is the cause?

Illustrative values, not benchmarks of any real product.

Model notes

Assumptions

  • Requests arrive at random, as a Poisson process, at a constant average rate.
  • Each node is one queue, served first-come first-served by several identical slots (instances × concurrency).
  • Service times are random with the stated mean; by default they are exponentially distributed.
  • Each node is analysed separately, with the traffic it receives treated as Poisson.
  • The dashboards show a steady state at the traffic shown, not a time series. “Normal” is the same system with no incident, at its usual traffic.
  • The shop application calls the product database on every request, and the payment provider and the email service on 5% of them (checkout). The calls are made one after another.

Simplifications

  • Above capacity there is no steady state. The model switches to a fluid approximation: the node serves at capacity, its queue grows until it reaches its limit, and further requests are rejected.
  • Percentiles assume an exponential tail. A service-time variability other than exponential changes the mean wait but not the shape of the tail.
  • A node frees its slot as soon as it has done its own work, before waiting on the services it calls. Real thread-per-request servers hold the slot, so a slow dependency exhausts them faster than this model shows.
  • A request calls its dependencies one after another. Parallel fan-out is not modelled.
  • When a caller times out and gives up, the callee still finishes the work, so abandoned requests keep consuming capacity.
  • Retries add load. Their backoff and jitter decide when that load arrives, which only the per-request simulation shows.
  • Retry feedback is solved from the healthy starting point, so it finds one stable outcome. Systems that stay stuck in overload after the cause is gone are not shown.
  • A throughput limit (for example maximum writes per second) is modelled as slower service, not as a separate rate limiter.
  • A caller’s timeout counts the mean time its dependencies take, not their full distribution.
  • Latency percentiles for a whole request are estimated, over every request, including those that are rejected and fail quickly. The mean is exact, and the percentiles come from a gamma distribution that has that mean and the variance of the time spent in each component.
  • A trace shows averages, not one random request: each span is the mean time the engine gives for that service, a service does its own work first, then makes its calls. Real spans differ from request to request.
  • The error budget treats the error rate shown as if it lasted for the whole 30 days. It is a rate of spending, not a record of what has been spent.
  • Only whole-request errors count against the budget, so a slowdown that causes no errors does not move it. The whole-request median is not shown: a gamma fit is poor when a small share of requests is much slower than the rest.

Parameter values are illustrative. They are not benchmarks of any real product.

Go through the four incidents and read the line above the table.

Incident Symptom alerts firing Cause alerts firing Which cause alerts
Incident 1 1 0 none
Incident 2 2 1 Payment provider failing, 33.1%
Incident 3 2 2 Product database saturated, 102%, and failing, 1.96%
Incident 4 2 2 Shop application saturated, 113%, and failing, 11.1%

Every incident fires a symptom alert, and the two symptom rules never needed to know what the incidents were. In Incident 1 it is Whole request slow: the p95 of 184 ms is above 150 ms. That p95 is the lab’s estimate, but the mean is exact: 71 ms against 41 ms. Error budget burning fast is quiet, since no request failed and the burn rate is 0.02×.

No cause alert fires in Incident 1. The cause is the Product database, whose requests got four times slower, and its saturated rule needs 80% of capacity when it is at 60%. Its failing rule needs failures, and it has none. Nobody wrote a rule for “a query became slower”, so the cause alerts are silent while users wait. That is the weakness of cause alerts: they find the failure someone expected.

In the other three incidents a cause alert does name a component. Incident 3 fires on the Product database, the right one. But the alert is a result, not an explanation: the database is saturated because each request now calls it 6.8 times, and the alert cannot say that. The trace of the previous lesson does. Where the cause alerts name a component they are good leads, but they can also stay silent on the service that users blame. The cause alerts on the Shop application in Incident 3 are quiet, since its own saturation is 38%, while users see 12.6% of requests fail.

A symptom alert could be “the error rate is above 0.1% for 10 minutes”. The Workbook warns against alerts like that. At a 99.9% SLO a 0.1% error rate is a burn rate of 1, and ten minutes of it spends 10 ÷ 43,200, about 0.02% of the monthly budget. The alert would fire for something that does almost no harm, and it would fire again and again, until people stop trusting it.

The Workbook’s recommendation is to alert on the burn rate, with a long window for how much budget is gone and a short window to confirm that it is still going. Its starting parameters for a 99.9% SLO are:

Severity Long window Short window Burn rate Budget consumed
Page 1 hour 5 minutes 14.4 2%
Page 6 hours 30 minutes 6 5%
Ticket 3 days 6 hours 1 10%

The alert fires only when both windows are over the burn rate. The long window ensures the incident has cost something, and the short window, one twelfth of the long one, makes the alert stop soon after the incident does. The rows trade speed against noise: a severe incident is caught within the hour, a slow leak within days, and a slow leak is a ticket and not a page.

The lab implements only the first row, as one test of the whole request. At 99.9% a burn rate of 14.4 is a failure rate of 14.4 × 0.1%, which is 1.44% of requests, and Incident 2’s 1.65% is above it. At 99% the same rule needs 14.4 × 1%, which is 14.4% of requests failing. Choose SLO target 99% in Incident 3: 12.6% of requests fail, the burn rate is 12.6×, and the first row does not fire. The second row, a burn rate of 6 for 6 hours, would: 12.6 is above 6, and it spends 12.6 × 6 ÷ 720, which is 10.5% of the budget in 6 hours. That is why the Workbook has several rows.

Challenge

Symptom or cause?

A symptom is what users or callers feel. A cause is the state of a component that may explain it. Put each condition under the kind of alert it would be.

Sorting needs JavaScript.

Categories

Symptom
What users feel: the alert you page on.
Cause
The state of a component: it helps find the fault.
  1. Line 1 of 8The 99th percentile of checkout latency has been above 800 ms for 10 minutes.
  2. Line 2 of 8CPU on one web server is at 85%.
  3. Line 3 of 8The checkout failure rate burns the error budget at 14.4 times the allowed rate.
  4. Line 4 of 8The connection pool of the product database is 95% in use.
  5. Line 5 of 8Users in one region get an error on 5% of page loads.
  6. Line 6 of 8Garbage-collection pauses on the payment service average 300 ms.
  7. Line 7 of 8A third of visitors wait more than 5 seconds for a page.
  8. Line 8 of 8A database replica's disk is 90% full.

Check your answers at least once before looking at the answers.

What happens if the pager goes off for every cause?

Section titled “What happens if the pager goes off for every cause?”

Suppose each of the lab’s eight cause rules paged. In Incident 4 two would fire at once on the same service, for one problem. In a real system there would be many more rules, each written after an outage, and each firing for conditions that users never feel: a server at 85% CPU can be doing its job. An on-call engineer who is paged for things that need no action learns to ignore pages, and the one that matters looks like the others.

Symptom alerts reverse the cost. There are few of them, each means that users are being hurt, and the on-call engineer starts from a statement of the problem and not from a guess about its origin. The cause alerts are still useful, as dashboards and as tickets, and for the very definite and very imminent causes the SRE book allows, such as a disk that will be full in an hour. They are just not the way to find out that something is wrong. A failure that is slow and partial, which the failure-engineering module calls a gray failure, is the kind that cause alerts miss and symptom alerts catch.

  • A symptom is what users feel, and a cause is the state of a component. Page on symptoms. Use causes to find the fault, and page on them only when they are definite and imminent.
  • In the lab, every incident fires a symptom alert. Incident 1 fires one, Whole request slow, and no cause alert, because nobody wrote a rule for a slower query.
  • Incident 2 fires 2 symptom alerts and 1 cause alert, and Incidents 3 and 4 fire 2 and 2.
  • A raw error-rate alert fires for ten minutes of a 0.1% error rate, which spends 10 ÷ 43,200, about 0.02% of the monthly budget.
  • A burn-rate alert uses a long window and a short one. The Workbook’s page rows are 14.4 over 1 hour (2% of the budget) and 6 over 6 hours (5%).
  • A burn rate of 14.4 is 1.44% of requests failing at 99.9%, and 14.4% at 99%.

Next: the recap and quiz for the whole module.

Your progress

Built by GhaziAlibi.

© ShardCraft. All rights reserved.