A dashboard shows a service. A request does not stay in one: the shop’s Shop application calls the Product database, and on a checkout it calls the Payment provider and the Email delivery service. When the request is slow, the question is which of those calls the time went into, and a service dashboard answers it only by comparing several of them.
Google’s Dapper paper describes the tracing system that Google built for this problem. Its stated goals were low overhead, application-level transparency and deployment across a very large system, and it relied on sampling and on instrumenting only commonly used libraries to meet them.
OpenTelemetry’s vocabulary is the one most systems use today:
A trace is the path of a request through your application, from start to end.
A span is a unit of work in that path, with a start time and an end time, and key-value attributes that annotate it.
A span has a parent when it is part of another span’s work, and the root span is the topmost one, with no parent. It marks the beginning and end of the whole operation.
A span context travels with the request. It holds the trace ID and the span ID, and it is serialised and sent along on each call, so that a service downstream can add its spans to the same trace.
Without that last point, a trace would be a collection of unrelated spans. The IDs are also what a log line carries to say which request it belongs to.
Mental model. A trace is the call tree of one request, with a clock on every branch. The root span is the whole request, each child is a call it made, and the time of a span is its own work plus its children’s.
The lab is the incident lab again. Look at Trace of a request. It shows two requests as tables, A usual request, which every request makes, and A checkout request, which also calls the services that only some requests call. Each row is a span. On the wire is the time spent travelling to the service and In the service is the time it works, not counting its own calls.
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.
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
Alert
Kind
Fires when
Now
Status
Error budget burning fast
Symptom
the burn rate is 14.4× or more
0.02×
○ Quiet
Whole request slow
Symptom
the p95 is above 150 ms
184 ms
● Firing
Shop application saturated
Cause
it is at 80% of its capacity or more
38%
○ Quiet
Shop application failing
Cause
1% of its calls or more fail
0%
○ Quiet
Product database saturated
Cause
it is at 80% of its capacity or more
60%
○ Quiet
Product database failing
Cause
1% of its calls or more fail
0%
○ Quiet
Payment provider saturated
Cause
it is at 80% of its capacity or more
2%
○ Quiet
Payment provider failing
Cause
1% of its calls or more fail
0.0431%
○ Quiet
Email delivery service saturated
Cause
it is at 80% of its capacity or more
2%
○ Quiet
Email delivery service failing
Cause
1% of its calls or more fail
0%
○ 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)
Service
Calls
Starts at
On the wire
In the service
Share
Timeline
Shop application
1
0 ms
—
20 ms
33%
Product database
1
20 ms
1 ms
40 ms
67%
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.
Service
Calls
Starts at
On the wire
In the service
Share
Timeline
Shop application
1
0 ms
—
20 ms
8%
Product database
1
20 ms
1 ms
40 ms
16%
Payment provider
1
61 ms
25 ms
100 ms
49%
Email delivery service
1
186 ms
10 ms
60 ms
27%
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
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.
On Incident 1 the usual request takes 61 ms in all, against 31 ms normally. The lab spells out the sum: 20 ms in the Shop application, plus 1 ms on the wire to the Product database, plus 40 ms in the Product database, which is 61 ms. The Product database span is 40 ms where it is 10 ms normally, and it is 67% of the request. You can see the cause without comparing four dashboards: one row holds the extra time.
Look at the checkout request in the same incident: 256 ms against 226 normally. The checkout adds the calls to the Payment provider and the Email delivery service, so the same 30 ms of extra time is a smaller share of it.
Now choose Incident 2. The usual request takes 31 ms, exactly normal. Only the checkout request changed: 826 ms against 226 ms normally, with 700 ms in the Payment provider, which is 88% of the request. A request that does not call the provider never touches the problem. The provider’s card says why: its Traffic is 15 calls/s out of the 300 requests/s that enter the shop, 1 request in 20, so the problem reaches few requests.
Choose Incident 3. The usual request takes 1.8 s against 31 ms. The Product database row says 6.8× in the calls column and 1.8 s in the service, 99% of the request. The request is not calling the database once, it is calling it 6.8 times on average, and each call waits because the database is saturated. A dashboard shows the database’s traffic going up. A trace shows the cause of that traffic: the same query repeated again and again inside one request.
Each span in the lab is the mean time for that service, so the rows add up to the total by construction. In Incident 1 the sum is the one the lab prints. It is also a check: if the spans of a real trace do not add up to the root span, some time is going somewhere that no span covers, such as a queue before the first span, or a call that was not instrumented.
Weighted by how often each call is made, the two traces give the mean over all requests. In Incident 1 the usual path takes 61 ms. On top of it, 5% of requests call the provider and 5% call the email service, so the mean is 61 + 0.05 × (25 + 100) + 0.05 × (10 + 60), which is 61 + 6.25 + 3.5, or 70.75 ms. The lab shows 71 ms, and says that the spans’ average and the engine’s mean agree.
The same mean can hide very different shapes. Incident 2 also has a Time to answer with a mean of 71 ms, the same as Incident 1, but in one case every request is 30 ms slower and in the other 1 request in 20 is 600 ms slower. The mean cannot tell them apart, and the trace can.
In Incident 4 the lab says the two figures differ: the spans average 541 ms and the engine’s mean is 481 ms. The engine also counts the requests that are turned away, and they finish early. A trace of a request that was refused is a short one, and means over only the traces that succeeded would say the shop is slower than its users find it.
What happens if the trace you are looking at is not the slow one?
A trace is one request. Real requests vary: the same call takes 10 ms for one request and 400 ms for the next, and the spans of two traces do not add up to the same total. The lab draws the mean of each span, so every row is typical and none is an outlier. The slow request that a user complained about is in the tail of the distribution, and a tracing system that samples keeps only a share of requests, so that request may not have been kept. That is the price of the low overhead Dapper aimed for.
Two things help. Keeping the slow or failed traces on purpose, instead of a plain share, makes it likelier that the request you need is there. And metrics, which count every request, say how many requests are slow. The trace then explains one example, and it does not say how common the example is.
A trace is the path of one request, made of spans. The root span has no parent, and a span context carries the trace ID from service to service.
In Incident 1 the usual request takes 61 ms against 31 ms: 20 ms in the Shop application, 1 ms on the wire, 40 ms in the Product database, which is 67% of the request.
In Incident 2 the usual request is 31 ms, as normal, and the checkout takes 826 ms against 226 ms, with 700 ms (88%) in the Payment provider.
In Incident 3 the Product database is called 6.8 times per request and holds 99% of a 1.8 s request. A trace shows a repeated call that a dashboard shows only as more traffic.
The mean over all requests is the usual path plus each optional call times how often it is made: 61 + 0.05 × 125 + 0.05 × 70, about 71 ms. Incidents 1 and 2 share that mean and have different shapes.
A sampled trace explains an example. Metrics say how common it is.