A service that runs for months will fail in ways nobody predicted, and the only evidence you will have is what it chose to emit.
Telemetry is the data a running system emits about itself. Observability is how well that data lets you answer new questions about the system without shipping new code. A system with one log line per crash is monitored. A system whose data lets you ask why only Hyderabad users on the old app version see slow checkouts is observable.
OpenTelemetry (OTel) is an open standard and a set of libraries for producing and moving telemetry. Its documentation names four signals, each with a one-line job:
Signal
What it is
Typical question it answers
Metrics
A measurement captured at runtime, such as a count or a duration
Is something wrong, and how bad is it?
Traces
The path of one request through your application and the services it calls
Where did this request spend its time?
Logs
A recording of an event
What exactly happened, and what did the code say about it?
Baggage
Contextual information passed along with a request from service to service
Which customer tier or experiment does this request belong to, downstream?
A fifth signal, profiles (a recording of resource usage at the code level), is listed in the documentation as under development, so treat it as something to watch rather than rely on.
Which signal for which question
The signals work as a funnel. A metric is cheap and aggregated, so it is what you alert on and chart: error rate, request duration, queue depth. It tells you that checkout is failing for 4% of requests, but not which requests. A trace follows one request across services as a tree of timed steps called spans, so it tells you that the failing ones all wait three seconds on the payment call. A log line from the payment service then tells you why: its database pool is exhausted.
Going the other way is slow. Searching logs for a pattern to discover that an outage exists, or averaging span durations by hand, costs more than a counter would have.
Three checklists decide what to measure. The Google SRE book names four golden signals for any user-facing service: latency, traffic, errors and saturation (how full the service is). Brendan Gregg's USE method applies to resources such as a CPU, a disk or a connection pool: utilisation, saturation and errors. The RED method is a common service-side counterpart for request-driven code: rate, errors, duration.
Method
Applies to
Measures
Golden signals
A user-facing service
Latency, traffic, errors, saturation
RED
Each request-driven service
Rate, errors, duration
USE
Each resource (CPU, disk, pool)
Utilisation, saturation, errors
Alert on symptoms, what users feel, such as the share of failed requests or slow responses. Do not page on causes such as high CPU or a restarted pod unless they always hurt users. A cause alert fires when nothing is wrong and stays silent when a cause nobody thought of is breaking checkout. Causes are for dashboards you open after a symptom pages you.
A log line worth keeping
A log line is only as useful as the questions you can ask of it. Text such as checkout slow for order 1052 needs a regular expression and luck. A structured log is one JSON object per line with named fields, so a tool can filter, group and count without guessing.
The file below holds six lines from a made-up service, one JSON object per line. The script reads them and groups by route.
The same six lines answer a different question with a different grouping and no change to the service. That is the point of structure. Keep fields stable: level, route and ms mean the same thing in every service, so one query works everywhere. Put the trace id of the active request in every line, and a log line becomes the last step of the funnel: from a slow span, search the logs for its trace id and read what the code said.
Logs are also the right place for high-cardinality detail, such as a user id or an order number. The next lessons show why the same detail would break a metric.
Your checkout error rate is 4% and you do not know why. Which signal do you open first, and which next?
The metric first: it confirms the symptom and its size and when it began.
Then a trace of a failing request to find which hop is slow, then the logs for that trace id to read the reason.
Why is a CPU alert a poor page for a web service?
High CPU is a cause. It can fire while users are happy and stay silent while another cause breaks them.
Alert on a symptom such as failed or slow requests and keep CPU on a dashboard.
What makes a log line structured, and what does that allow?
One object per line with named fields, such as level, route and ms.
Tools can filter and group by field without regular expressions, as the count script did.
Part 2 · Tracing a Node service
Spans, traces and context propagation
A span is one timed operation: its name, start time, duration, attributes and a status. Spans link into a tree through a parent id, and every span in the tree shares one trace id. The span that starts a trace has no parent and is the root span.
Spans have a kind. A server span covers handling an incoming request. A client span covers making an outgoing call. An internal span covers work inside one process, such as a database query you time yourself.
A trace can cross processes only if the trace id and the parent span id travel with the request. This is context propagation. The default format is the W3C traceparent HTTP header: four fields joined by hyphens, a version, a 32-hex-digit trace id, a 16-hex-digit parent span id and two hex digits of flags, where 01 means the trace is sampled.
Instrumentation libraries do this for you. The HTTP instrumentation starts a client span when your code calls out, adds the traceparent header to the request, and on the receiving side reads it to start a server span with the right parent. Your own code adds spans only for work the libraries cannot see.
Instrumenting two services
The packages here are @opentelemetry/sdk-node 0.301.0, sdk-trace 3.1.0 and instrumentation-http 0.301.0, the newest releases that were at least two weeks old when this lesson was written. The SDK must start before your code loads, so it lives in its own file that Node loads with --import.
The exporter prints one line per span: the service, the first eight characters of the trace id and span id, the parent span id, the kind and the name. In this version of the SDK, SimpleSpanProcessor takes an options object with an exporter field, not the exporter itself, which older examples show. Passing the exporter directly raises no error: the run exports nothing. SimpleSpanProcessor also exports each span the moment it ends, which suits a lab and not production, where BatchSpanProcessor is the usual choice.
The two services are plain Node servers on local ports. api receives GET /checkout and calls orders. orders times a pretend database query with a span of its own.
Both services are CommonJS files. When the same services were written as ES modules, node:http was not patched and the HTTP spans never appeared. The OpenTelemetry documentation says ES module applications need an extra loader hook, so keep that in mind when a service shows no spans.
One request, one trace
Start both services with the same instrumentation file, send one request with curl, and read the spans from both logs.
api f3f02fd5 0e8062fd 34171177 client GET
api f3f02fd5 34171177 - server GET
traceparent 00-f3f02fd51e893780beceb6a7cefd88dd-0e8062fde260bc44-01
orders f3f02fd5 cbb92391 3eeefd1b internal db.query orders
orders f3f02fd5 3eeefd1b 0e8062fd server GET
Output. The ids differ on every run.
The first two lines come from api. The server span 34171177 has no parent, so it is the root. The client span 0e8062fd is the outgoing call to orders. The traceparent line shows what orders received: the trace id starting f3f02fd5 and the parent id, which begins with the client span id. Then orders reports two spans: its own server span 3eeefd1b, parented to that client span, and the db.query orders span inside it.
Every line shares the trace id prefix. Every span id is different. Each parent id is the id of the span one level up. That is the whole mechanism.
What a span looks like in full
The one-line exporter hides most of the fields. The SDK also ships ConsoleSpanExporter, which prints each span in full. Its source comment says it is intended for diagnostics only and that the output may change at any time, so never parse it. This run uses it on a single manual span.
Output with resource detectors off. The long scope line is wrapped here.
A real span carries more than a name and a duration. The attributes object holds the facts you add, such as db.system. status has three values: unset, ok and error. events are timestamped notes inside the span, such as an exception. links connect a span to spans in other traces, which matters for queues and batch jobs.
Without OTEL_NODE_RESOURCE_DETECTORS=none, the resource also lists the host name, operating system, process path and user. That is useful in production and a privacy risk to paste anywhere.
A trace has three spans with the same trace id. What links them into a tree?
Each span stores its parent span id. The root span has none.
What does the traceparent header carry, and what happens if a proxy strips it?
The trace id, the caller's span id, and flags such as sampled.
The next service starts a new trace, so the picture breaks in two.
Where should you add a manual span?
Around work the libraries cannot see, such as your own query timing or a business step.
Not around every function: each span costs memory and storage.
Scene: one request across two services
Animated sceneOne request, two services, one trace0:18
Watch for one trace id on every span, and a new span id on each hop
Read it as steps
Spans from the lab run: one trace id, a new span id on each hop.
The scene matches the run above: two spans in api, two in orders, linked only by the header. Delete the header and the tree would split into two traces.
Part 3 · Metrics that answer questions
Counters, gauges and histograms
A trace describes one request. A metric summarises all of them cheaply. OpenTelemetry offers three instruments you will use most. A counter only goes up: requests served, errors. A gauge reads a value that moves both ways: queue depth, memory in use. A histogram records the distribution of a value, usually a duration, by counting how many observations fall into each range.
A histogram matters because averages hide the pain. If 95 requests take 40 ms and five take two seconds, the average is about 138 ms and looks fine, yet one user in twenty waits two seconds. A histogram keeps the shape, so you can read what share of requests were faster than a limit you care about.
Each instrument records values with attributes (called labels in Prometheus), such as status="500". Every distinct combination of attribute values is its own time series, a stored sequence of values over time.
Counters and histogram buckets are stored as running totals since the process started. Nobody charts the total. The metrics system subtracts two scrapes and divides by the time between them, which gives a rate such as requests per second, and a process restart shows up as the total dropping back to zero, which the rate calculation knows how to handle.
Exporting to Prometheus
Prometheus is an open-source metrics system that scrapes: it fetches a plain-text page from your service on a schedule. The OpenTelemetry Prometheus exporter serves that page on a port you choose. The service below records a counter and a histogram for a pretend checkout, with the exporter on port 55923.
The histogram is given bucket boundaries: 0.05, 0.1, 0.3, 1 and 3 seconds. Prometheus histograms are cumulative, so the bucket le="0.3" counts every observation less than or equal to 0.3 seconds. The 0.3 is there on purpose, because the latency indicator in the next lesson counts checkouts that finish within 300 ms.
A shell script starts it, sends 22 requests with known delays (12 at 40 ms, 5 at 200 ms, two at 700 ms, one at two seconds, and two failures with status 500), then scrapes the page with curl.
bash
hit() { curl -s -o /dev/null -H "x-delay-ms: $1" -H "x-status: $2" \
http://127.0.0.1:55922/; }
for i in $(seq 12); do hit 40200; done
for i in12345; do hit 200200; done
hit 700200; hit 700200
hit 2000200
hit 30500; hit 30500
sleep 1
curl -s http://127.0.0.1:55923/metrics
Reading the scrape
text
# HELP checkout_requests_total description missing
# TYPE checkout_requests_total counter
checkout_requests_total{status="200"} 20
checkout_requests_total{status="500"} 2
# HELP checkout_duration description missing
# UNIT checkout_duration s
# TYPE checkout_duration histogram
checkout_duration_count{status="200"} 20
checkout_duration_sum{status="200"} 4.88
checkout_duration_bucket{status="200",le="0.05"} 12
checkout_duration_bucket{status="200",le="0.1"} 12
checkout_duration_bucket{status="200",le="0.3"} 17
checkout_duration_bucket{status="200",le="1"} 19
checkout_duration_bucket{status="200",le="3"} 20
checkout_duration_bucket{status="200",le="+Inf"} 20
checkout_duration_count{status="500"} 2
checkout_duration_sum{status="500"} 0.06
checkout_duration_bucket{status="500",le="0.05"} 2
checkout_duration_bucket{status="500",le="0.1"} 2
checkout_duration_bucket{status="500",le="0.3"} 2
checkout_duration_bucket{status="500",le="1"} 2
checkout_duration_bucket{status="500",le="3"} 2
checkout_duration_bucket{status="500",le="+Inf"} 2
Output
The counter appears as checkout_requests_total, with the _total suffix added by the exporter: 20 successes and two failures. The histogram appears as three families. _count is how many observations there were, _sum is their total in seconds, and _bucket is the cumulative count per boundary.
Read the 200-status series. Twelve requests took 40 ms, so 12 fall in le="0.05". The five 200 ms requests join at le="0.3", which reads 17. The two 700 ms requests join at le="1", reading 19. The two-second request lands in le="3" for a total of 20. So 17 of 20 successful requests finished within 300 ms.
If the SLO threshold had been 250 ms, you could not answer exactly: no bucket sits at 250 ms, and the data cannot be re-sliced afterwards. The Prometheus documentation says the same, so place a boundary at each threshold you care about before you ship.
Label cardinality
Cardinality is the number of distinct series a metric produces. It multiplies: a metric with a status label of 5 values and a route label of 40 values can make 200 series, and a histogram multiplies that by its buckets. Each series costs memory in the service and storage in the metrics system.
The danger is a label whose values are unbounded, such as a user id, an order id or a raw URL with ids inside it. The script below records the same counter with a user_id label and counts the series the exporter then serves.
js
import { metrics } from'@opentelemetry/api'import { MeterProvider } from'@opentelemetry/sdk-metrics'import { PrometheusExporter } from'@opentelemetry/exporter-prometheus'const reader = new PrometheusExporter({
port: 55924, host: '127.0.0.1', withoutScopeInfo: true,
})
metrics.setGlobalMeterProvider(new MeterProvider({ readers: [reader] }))
const meter = metrics.getMeter('card')
const hits = meter.createCounter('hits')
const scrape = async () => {
const r = await fetch('http://127.0.0.1:55924/metrics')
const text = await r.text()
const lines = text.split('\n')
return lines.filter((l) => l.startsWith('hits_total')).length
}
let next = 0for (const n of [10, 100, 1000]) {
for (; next < n; next++) hits.add(1, { user_id: 'u' + next })
console.log(n, 'user ids ->', await scrape(), 'series')
}
await reader.shutdown()
card.mjs
text
10 user ids -> 10 series
100 user ids -> 100 series
1000 user ids -> 1000 series
Output
One series per user id. At a hundred thousand users that is a hundred thousand series for one counter, and the bill and the memory use grow with the user base instead of with the traffic. Keep user ids and order numbers in logs and traces. Keep metric labels to a small fixed set: status class, route template, region.
Why must the SLO threshold be a bucket boundary?
A histogram stores only counts per bucket, so the share under 300 ms is exact only if a boundary sits at 0.3.
You cannot recover it from other boundaries after the data is stored.
In the scrape, checkout_duration_bucket{status="200",le="1"} is 19. What does it count?
Successful requests that took 1 second or less, cumulatively, including those in the smaller buckets.
It is not the count of requests between 0.3 and 1 second.
Why is user_id a bad metric label?
Each distinct value makes a new time series, so series count grows with users.
Put it in logs or trace attributes instead.
Part 4 · SLIs, SLOs and error budgets
The three terms
A service level indicator (SLI) is a measurement of how the service behaves, written as a ratio: good events divided by valid events. A service level objective (SLO) is the target for that ratio over a window, such as 99.9% of checkout requests succeed over 30 days. The gap between the target and perfection is the error budget: with a 99.9% SLO, 0.1% of requests are allowed to fail.
The ratio form matters because it works for any signal. Availability is good responses over all responses. Latency is requests faster than 300 ms over all requests. Freshness could be records updated within five minutes over all records. Written as a proportion from 0% to 100%, an SLI is easy to compare across services and to alert on.
An SLA (service level agreement) is different: a contract that says what the provider owes the customer, often money back, if the target is missed. Teams set internal SLOs tighter than any SLA so they notice trouble before a customer can claim anything.
Computing an SLI from real counters
The scrape from the previous lesson holds everything needed. Save it first by running the last curl again with > metrics.out on the end; the script reads that file and computes two SLIs. Availability counts requests with status 200 over all requests. Latency counts requests that were both successful and within 300 ms over all requests, so a fast failure does not count as good.
ts
import { readFileSync } from'node:fs'const text = readFileSync('metrics.out', 'utf8')
const value = (series: string): number => {
const line = text.split('\n').find((l) => l.startsWith(series + ' '))
if (!line) thrownew Error('missing ' + series)
return Number(line.split(' ')[1])
}
const ok = value('checkout_requests_total{status="200"}')
const failed = value('checkout_requests_total{status="500"}')
const fast = value('checkout_duration_bucket{status="200",le="0.3"}')
const total = ok + failed
console.log('requests ', total)
console.log('availability SLI ', (ok / total).toFixed(4))
console.log('latency SLI ', (fast / total).toFixed(4))
console.log('good (200, <=0.3s)', fast, 'of', total)
sli.mts, run with node (type stripping)
text
requests 22
availability SLI 0.9091
latency SLI 0.7727
good (200, <=0.3s) 17 of 22
Output
Availability is 20 of 22, which is 0.9091. The latency SLI is 17 of 22, which is 0.7727, because it must be good on both counts. These 22 requests were built to be bad. A real window holds millions, and the ratios sit near 0.999.
Choose SLIs that match what users notice. Server-side CPU is not an SLI. A failed payment and a page that takes four seconds are.
Where you measure changes what you see. Counts taken at the load balancer include requests that failed before your code ran, which your own service never sees, so they sit closer to the user. Counts from inside the service are easier to get and miss those failures. Write down both the measurement point and what counts as a valid event: health checks from the platform and requests blocked as abuse are usually excluded from both sides of the ratio.
Budgets in minutes
A budget is easier to feel as time. Over 30 days there are 43,200 minutes, and a budget of 0.1% allows 43.2 minutes of complete outage, or any mix of partial failures that adds to the same amount of lost requests.
ts
const MINUTES_PER_DAY = 24 * 60function budgetMinutes(slo: number, days: number): number {
return days * MINUTES_PER_DAY * (1 - slo)
}
console.log('SLO 30 days (minutes of full outage)')
for (const slo of [0.99, 0.995, 0.999, 0.9995, 0.9999]) {
const pct = (slo * 100).toString().padEnd(7)
const m = budgetMinutes(slo, 30)
console.log(`${pct} ${m.toFixed(2).padStart(7)}`)
}
budget.mts
text
SLO 30 days (minutes of full outage)
99432.0099.5216.0099.943.2099.9521.6099.994.32
Output
Each extra nine cuts the budget by a factor of ten. 99.99% leaves 4.32 minutes a month, less than one slow deploy. That is the real conversation about SLOs: a tighter target costs more engineering and slows releases, so choose the loosest target users will accept.
Using the budget
The budget turns reliability into a decision rule. While budget remains, ship features and take risks. When the budget is spent, slow the risky changes and spend the time on reliability until it recovers. Both sides agree on the rule before an incident, so nobody argues during one.
Spent budget does not mean blame. It means the service was less reliable than promised, and the promised level may be wrong, the architecture may need work, or a dependency may be weak. All three are findings.
Pick the window deliberately. A 30-day rolling window forgives a bad week slowly and is easy to explain. A calendar-month window resets and invites a rush on the first day. Also write down what counts: planned maintenance, requests from your own health checks and client errors such as a 404 for a wrong URL are usually excluded.
A service has a 99.95% SLO over 30 days. How many minutes of full outage does that allow?
About 21.6 minutes: 43,200 minutes times 0.05%, as the budget script printed.
Why does the latency SLI count a fast 500 response as bad?
The SLI measures good events: successful and fast. A quick error is still a failed request.
The budget is spent with 10 days left in the window. What follows from the policy?
Slow down risky releases and work on reliability until the budget recovers.
The aim is to keep the service within its promise, not to find someone at fault.
Scene: the budget in minutes
Animated sceneError budget for 99.9% over 30 days0:16
Error budget: 43.2 minutes (of full outage per 30 days)
Read it as steps
The arithmetic behind the budget script.
Change the target to 99.99% and the allowed failure becomes 0.01%, so the result is 4.32 minutes.
Part 5 · Alerting on burn rate
Why threshold alerts fail
Suppose you alert when the error rate passes 1% over five minutes. A real outage trips it, but so does a ten-second blip that costs almost nothing, and the alert flaps on and off. Raise the threshold or lengthen the window and you miss slow leaks that quietly eat the budget over days. You need alerts tied to the budget itself.
The burn rate says how fast the budget is being spent compared with spending it evenly over the whole window. It equals the observed error rate divided by the error budget fraction. With a 99.9% SLO the budget fraction is 0.001. An error rate of 0.1% is a burn rate of 1: you would use exactly the whole budget by the end of the window. An error rate of 1.44% is a burn rate of 14.4, which would spend the whole 30-day budget in about two days.
The share of the budget a burn consumes is the burn rate times the alert window, divided by the SLO period. A 14.4 burn for one hour in a 720-hour month spends 14.4 times 1 divided by 720, which is 2% of the budget.
Multiwindow, multi-burn-rate alerts
The Google SRE workbook recommends combining several burn rates with two windows each. An alert fires only when both windows exceed the threshold. The long window shows that real budget has gone. The short window, a twelfth of the long one, shows the problem is still happening, so the alert clears soon after the fix.
Burn rate
Long window
Short window
Budget consumed
Action
14.4
1 hour
5 minutes
2%
Page
6
6 hours
30 minutes
5%
Page
1
3 days
6 hours
10%
Ticket
14.4
Long window1 hour
Short window5 minutes
Budget consumed2%
ActionPage
6
Long window6 hours
Short window30 minutes
Budget consumed5%
ActionPage
1
Long window3 days
Short window6 hours
Budget consumed10%
ActionTicket
Each row covers a different failure shape. A sharp outage trips the first row within minutes. A steady leak that is too slow for the first row trips the second. A mild but persistent problem trips only the ticket row, and a person looks at it in working hours.
The numbers come from the workbook's example for a 99.9% SLO. Treat them as a starting point and tune them to your traffic and the cost of a false page.
An evaluator you can run
The function below applies one rule to a per-minute record of total and failed requests. It uses prefix sums so a window's error rate is two lookups, and it only fires once the long window has filled, because a window shorter than its name proves nothing.
ts
exporttype Rule = {
name: string
burn: number
long: number
short: number
}
exportconst RULES: Rule[] = [
{ name: 'page 14.4x', burn: 14.4, long: 60, short: 5 },
{ name: 'page 6x', burn: 6, long: 360, short: 30 },
{ name: 'ticket 1x', burn: 1, long: 4320, short: 360 },
]
function prefix(xs: number[]): number[] {
const out = [0]
for (const x of xs) out.push(out[out.length - 1] + x)
return out
}
burn.mts: the rules and prefix sums
ts
/** For each minute: is the rule firing? Windows are in minutes. */exportfunction firing(
total: number[], bad: number[], slo: number, rule: Rule,
): boolean[] {
const budget = 1 - slo
const T = prefix(total)
const B = prefix(bad)
const burn = (end: number, w: number) =>
(B[end] - B[end - w]) / (T[end] - T[end - w]) / budget
return total.map((_, i) => {
const end = i + 1if (end < rule.long) returnfalseconst hot = (w: number) => burn(end, w) >= rule.burn
return hot(rule.long) && hot(rule.short)
})
}
burn.mts: which minutes fire
Three incidents, three alerts
The scenario script builds five days of traffic at 1,000 requests a minute with a background error rate of 0.02%, then adds three different problems and reports when each rule first fires and last fires, by minute number.
ts
import { RULES, firing } from'./burn.mts'const DAYS = 5const MIN = DAYS * 24 * 60const PER_MIN = 1000/** errorRate(minute) -> fraction of failed requests that minute. */function build(errorRate: (m: number) => number) {
const total: number[] = []
const bad: number[] = []
let carry = 0for (let m = 0; m < MIN; m++) {
carry += PER_MIN * errorRate(m)
const b = Math.floor(carry)
carry -= b
total.push(PER_MIN)
bad.push(b)
}
return { total, bad }
}
scenarios.mts: building the request log
ts
const scenarios: Record<string, (m: number) => number> = {
'outage: 5% errors, minutes 4400-4429': (m) =>
m >= 4400 && m < 4430 ? 0.05 : 0.0002,
'slow leak: 0.8% errors for 12 hours': (m) =>
m >= 4400 && m < 5120 ? 0.008 : 0.0002,
'mild: 0.15% errors all five days': () => 0.0015,
}
for (const [name, rate] of Object.entries(scenarios)) {
const { total, bad } = build(rate)
const month = 30 * 24 * 60 * PER_MIN * 0.001const spent = bad.reduce((a, b) => a + b, 0) / month
console.log(name, `(${(spent * 100).toFixed(1)}% of a 30-day budget)`)
for (const rule of RULES) {
const f = firing(total, bad, 0.999, rule)
const first = f.indexOf(true)
const last = f.lastIndexOf(true)
const text =
first < 0 ? 'never fires' : `first minute ${first}, last ${last}`
console.log(' ', rule.name.padEnd(11), text)
}
}
scenarios.mts: the three problems and the report
text
outage: 5% errors, minutes 4400-4429 (6.8% of a 30-day budget)
page 14.4x first minute 4417, last 4432
page 6x never fires
ticket 1x never fires
slow leak: 0.8% errors for 12 hours (16.3% of a 30-day budget)
page 14.4x never fires
page 6x first minute 4667, last 5126
ticket 1x first minute 4843, last 5441
mild: 0.15% errors all five days (25.0% of a 30-day budget)
page 14.4x never fires
page 6x never fires
ticket 1x first minute 4319, last 7199
Output
The outage runs 30 minutes at 5% errors and starts at minute 4400. The 14.4 page fires at minute 4417, 17 minutes in: the one-hour window needs that long to average above 1.44%. It stops at minute 4432, three minutes after the last failing minute, because the five-minute window cooled. The slower rules never fire, because 30 bad minutes are too few to move a six-hour window to a burn of 6.
The slow leak runs 12 hours at 0.8% errors, a burn of 8. It never reaches 14.4, so the fast page is silent, but the 6-hour rule fires at minute 4667 and the ticket rule at minute 4843. The mild case at 0.15% errors is a burn of 1.5 for all five days. Only the ticket rule fires, as soon as its three-day window is full.
The percentages in the headings are totals for all five days and include the background errors, so they are not the cost of each problem alone. Compare instead what each problem had spent when its page fired. The outage had cost about 900 failed requests, roughly 2% of a 30-day budget of 43,200 failed requests at this traffic. The leak had cost about 2,100 failed requests, near 5%. Those are the 2% and 5% in the table, and they show what a burn-rate alert answers: how fast the budget is going. That is why a short sharp problem and a slow one are both caught while each is still cheap.
An error rate of 0.5% against a 99.9% SLO is what burn rate?
The error rate divided by 0.1%, so a burn rate of 5.
Why does each rule also check a short window?
It makes the alert stop soon after the problem stops, instead of staying lit for the whole long window.
The short window is a twelfth of the long one in the workbook's table.
Which of the three scenarios should wake a person at night, and which should not?
The 5% outage and the 0.8% leak both trip a page rule, so both should.
The 0.15% problem trips only the ticket rule and can wait for working hours.
Part 6 · Pipelines and AWS
The Collector
Services can send telemetry straight to a backend, but then every service holds the backend's address, credentials and retry logic. The OpenTelemetry Collector is a separate program that sits between them. The documentation describes it as a vendor-agnostic way to receive, process and export telemetry, and recommends running one close to your services so they can hand off data quickly and leave retries, batching, encryption and filtering to it.
A Collector is configured with four kinds of component. Receivers take data in, for example over the OpenTelemetry Protocol (OTLP). Processors change it on the way, for example limiting memory use. Exporters send it out. Connectors join two pipelines. Defining a component does nothing by itself: the documentation says a component that is configured but not named in the service section is not enabled, and the order of processors in a pipeline is the order they run in.
The file below is a small configuration: one receiver on OTLP over HTTP, a memory limiter, a traces exporter to an example host and a metrics exporter that Prometheus can scrape. It passed yamllint. It was not run in a Collector, because the Collector is not on npm or PyPI, so the component names follow the Collector documentation and should be checked against the release you install. The gRPC exporter's component id is otlp_grpc; the older id otlp is deprecated but still appears in many examples. In the queue, an empty batch: {} block turns on batching, which is off by default.
Exporters share a helper that provides two behaviours worth knowing. retry_on_failure retries a failed send with growing waits. Its documented defaults are enabled, a first wait of 5 seconds, a ceiling of 30 seconds between tries and 300 seconds as the longest a batch is retried. sending_queue holds batches in memory while sends are pending, with a default size of 1,000 requests. Without extra storage configured, the queue lives in memory, so a Collector that restarts loses what was queued.
That is why a trace backend outage does not have to hurt your services. The Collector holds data, retries, and sends it when the backend returns, until the queue is full or the retry limit passes, after which data is dropped. Watch the Collector's own queue and drop metrics, because silent loss is the failure you cannot see in your applications.
Sampling reduces volume by keeping only some traces. Head sampling decides when a trace starts, which is cheap but cannot know if the trace will turn out slow. Tail sampling decides after the trace completes, so it can keep every error and every slow trace and sample the rest, at the cost of buffering whole traces in a Collector. Sampling applies to traces. Metrics are already aggregated, so a count stays complete however many traces you drop, which is one more reason to alert on metrics and use traces to explain them.
AWS: X-Ray and CloudWatch
On AWS, traces have historically gone to AWS X-Ray. AWS's support timeline says the X-Ray SDKs and the X-Ray daemon entered maintenance mode on 25 February 2026: releases are limited to security fixes and there are no new features, and AWS recommends migrating to OpenTelemetry. The page lists no end-of-support date, so do not state one.
CloudWatch accepts OpenTelemetry directly. Its OTLP endpoints take logs, metrics and traces over HTTP (not gRPC), with AWS Signature Version 4 or a bearer token for authentication. A Collector authenticates with the sigv4authextension. The trace endpoint is xray.<region>.amazonaws.com/v1/traces, the metrics endpoint is monitoring.<region>.amazonaws.com/v1/metrics, and the logs endpoint is logs.<region>.amazonaws.com/v1/logs. Each endpoint has size and rate limits, for example 5 MB of uncompressed data per trace request and 10,000 spans per batch, so size your batches accordingly.
The practical advice is the same as for any backend: instrument with OpenTelemetry so the code does not change when the backend does, send through a Collector so credentials and retries live in one place, and keep SLO alerts defined on metrics.
What does a Collector do that a service sending directly to a backend does not?
It holds the backend address and credentials in one place, batches, retries and can sample or filter.
Services hand data off quickly and stay simple.
The trace store is down for two minutes. What does the exporter helper do with default settings?
It queues batches in memory and retries with waits growing from 5 to 30 seconds.
If the outage outlasts the 300-second retry limit or fills the queue, data is dropped.
Why is tail sampling more complete than head sampling, and what does it cost?
It decides after the trace is finished, so it can keep all errors and slow traces.
The Collector must buffer entire traces until the decision.
Scene: a trace store fails
Animated sceneTelemetry through a Collector0:17
Watch for the Collector holding traces while the trace store is down
Read it as steps
A model of the exporter helper documented above, not a lab run.
Services were never blocked. The cost of the outage was a delay, which is the reason to put a Collector in the path.