RED, USE and the Four Golden Signals
Three checklists for what to measure, what each one cannot see, and how to pick the handful of signals a human gets woken up for
Your only alert on the payments service is 'host CPU above 90% for five minutes'. Which of these situations does the alert handle badly?
Metrics 101 gave you the instruments: counters, gauges, histograms. This chapter is about which instruments to point at what. Three people answered that question independently and got almost the same answer, which is a good sign the answer is right.
RED: the service as its callers see it
Tom Wilkie named the RED method in 2015 while building Weave Cloud. For every request-driven service, record three things:
- Rate: requests per second the service is handling.
- Errors: how many of those requests fail, as a fraction of the rate.
- Duration: how long requests take, as a distribution, not an average.
That is the entire method. Its power is that every microservice gets the same three panels in the same order, so an on-call engineer who has never seen the orders service can read its dashboard in five seconds because it looks like the gateway’s. Wilkie’s phrase is that RED is a good proxy for how happy your customers are, and the Grafana best-practice guide says the same thing in different words: RED reports symptoms, so alerting belongs on RED dashboards.
In the demo app, all three come out of one instrument. The OTel HTTP semantic conventions define http.server.request.duration as a histogram in seconds with http.request.method, http.response.status_code and http.route as attributes. The lab’s Python instrumentations emit it once OTEL_SEMCONV_STABILITY_OPT_IN includes http, which the .env from the OpenTelemetry chapter sets. Through the Collector’s Prometheus exporter it becomes http_server_request_duration_seconds_bucket, _count and _sum, with service.name mapped to the job label and the attributes flattened to http_request_method, http_response_status_code, http_route. One histogram, three signals:
# Rate: requests per second, all routes
sum(rate(http_server_request_duration_seconds_count{job="gateway"}[$__rate_interval]))
# Errors: fraction of requests that returned 5xx
sum(rate(http_server_request_duration_seconds_count{job="gateway", http_response_status_code=~"5.."}[$__rate_interval]))
/
sum(rate(http_server_request_duration_seconds_count{job="gateway"}[$__rate_interval]))
# Duration: p50, p95 and p99 from the buckets
histogram_quantile(0.99, sum by (le) (rate(http_server_request_duration_seconds_bucket{job="gateway"}[$__rate_interval])))
Three details matter in those queries. The error ratio divides two rates computed over the same window from the same metric, so a scrape gap affects both halves equally. The quantile aggregates buckets with sum by (le) before histogram_quantile, never after; the next chapter is about why. And $__rate_interval is Grafana’s variable that picks a window of at least four scrape intervals, so a 15-second scrape gives a 1-minute window at minimum and the panel never shows holes because the window caught only one sample.
Errors need a definition per service, and the HTTP status code is a starting point, not the answer. A 4xx is the caller’s fault and usually not an error for RED purposes, except that a wall of 401s after a deploy is an error in the deployed service. A 200 that returns {"status": "declined"} because the fraud model timed out is an error that no status-code query will find. The honest rule: an error is a request where the service did not do what the caller needed, and you label it as such at the point where the service knows. The payments service knows when a charge fails; the gateway only knows it got a 500 back.
USE: the resource as the kernel sees it
Brendan Gregg’s USE method predates RED and comes from performance analysis rather than service monitoring. For every resource, check:
- Utilisation: the fraction of time the resource was busy doing work. CPU busy percentage, disk busy time, link bandwidth used.
- Saturation: the degree to which the resource has more work than it can service, usually visible as a queue. Run-queue length, disk I/O queue depth, dropped packets, swap activity.
- Errors: the count of error events. ECC corrections, NIC receive errors, disk read errors.
A resource is anything with a capacity: CPUs, memory, network interfaces, storage devices, controllers, interconnects. In an application, a connection pool is a resource (utilisation: connections in use over pool size; saturation: callers waiting for a connection), a thread pool is a resource, a rate limiter is a resource.
Two of Gregg’s observations carry most of the method’s value. First, check errors first: they are cheap to read and unambiguous. Second, utilisation averaged over a minute lies. A disk at 70% average utilisation can have spent that minute in bursts of 100% with queues forming, which is why saturation is a separate signal and not something you infer from utilisation. In node_exporter terms, node_disk_io_time_seconds_total is utilisation and node_disk_io_time_weighted_seconds_total (I/O time multiplied by queue depth) is saturation. Linux pressure stall information gives saturation directly: node_pressure_cpu_waiting_seconds_total is the time some task wanted a CPU and did not get one.
# CPU utilisation: 1 minus the idle fraction, averaged over cores
1 - avg(rate(node_cpu_seconds_total{mode="idle"}[$__rate_interval]))
# CPU saturation: runnable tasks per core, and stall time
node_load1 / count(node_cpu_seconds_total{mode="idle"})
rate(node_pressure_cpu_waiting_seconds_total[$__rate_interval])
# Memory utilisation and saturation
1 - node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes
rate(node_vmstat_pgmajfault[$__rate_interval])
# Disk utilisation and saturation
rate(node_disk_io_time_seconds_total[$__rate_interval])
rate(node_disk_io_time_weighted_seconds_total[$__rate_interval])
# Network errors
rate(node_network_receive_errs_total[$__rate_interval]) + rate(node_network_transmit_errs_total[$__rate_interval])
USE is about causes. When the payments RED dashboard shows p99 climbing, the USE dashboard for its host tells you whether it is CPU, memory, disk or the network, and if none of them is saturated it tells you the cause is upstream: a slow dependency, a lock, a GC pause. That negative answer is as valuable as the positive one.
The four golden signals
Google’s SRE book (chapter 6, “Monitoring Distributed Systems”) lists latency, traffic, errors and saturation. Traffic is Rate, latency is Duration, errors are Errors. The fourth is USE’s saturation, applied to the service rather than the host: how full is it, how close to the point where more load turns into queueing. The book’s claim is that if you measure all four and page a human when one is problematic, your service is at least decently covered.
Two refinements from that chapter are easy to miss. Latency of failed requests must be kept separate from latency of successful ones. A service that fails fast on a database error reports a wonderful p99 while serving nothing; filter http_response_status_code!~"5.." into the duration query, or at least look at both. And the book tells you to collect latency as bucketed counts suitable for a histogram, with boundaries spaced roughly exponentially, rather than as an average, because means hide the tail.
| RED (Wilkie) | USE (Gregg) | Golden signals (Google) | |
|---|---|---|---|
| Object | a request-driven service | a resource with capacity | a user-facing service |
| Throughput | Rate | (none) | Traffic |
| Failures | Errors (fraction of requests) | Errors (event count) | Errors |
| Time | Duration (distribution) | (none) | Latency |
| Headroom | (none) | Utilisation + Saturation | Saturation |
| Answers | is anyone hurt? | which resource is the cause? | both, for one service |
| Good for | every microservice, alerting | hosts, pools, queues, debugging | the edge service |
How they fit together
Wilkie’s own framing is that USE is about machines and RED is about users, and they are two views of the same system. The practical layout for a service like the demo app is:
- One RED dashboard per service (gateway, orders, payments), identical in shape.
- One USE dashboard per class of resource: the host (node_exporter), and later the Postgres connection pool, the Redis client, the Collector’s own queue.
- Saturation on the RED dashboard too, where the service has a meaningful one: in-flight requests against a worker count, queue depth, pool wait time. This is the golden-signals addition and it is the one most teams skip.
The link between them is the question you ask during an incident. RED says payments p99 went from 80 ms to 2 s at 14:02. USE for the payments host says CPU is idle, memory is flat, disk is idle. So the cause is not the host; it is something payments waits on, and the trace for a slow request will say Redis. Without RED you would not know anyone was hurt. Without USE you would be guessing at the host.
What each one misses
RED misses saturation. A service at 95% of its connection pool reports flat rate, zero errors and normal p99 right up to the moment the pool is exhausted, and then p99 goes vertical. RED is a lagging indicator by design: it reports what has already happened to users. You add saturation so you get the warning first. In the demo app, the orders service’s Postgres pool and the payments service’s Redis client are the two places this bites.
RED misses the things that are not requests. A batch job has no rate in any meaningful sense, a Kafka consumer’s “duration” is consumer lag, a cron job’s “error” is that it did not run. Wilkie’s method is for request-driven services. For the rest you measure freshness (seconds since last success), backlog (messages behind) and the success of the last run, which the chapter on async and batch covers.
USE misses the user. Everything can be green on USE while users get 500s because a config flag flipped, a certificate expired, or a dependency three hops away is returning garbage with a 200. USE is a map of your own resources and the user is not one of them.
USE on a cloud provider’s resource is hard. The Slack outage is the clean example: the saturated resource was a managed gateway whose utilisation and saturation Slack could not see. All they could measure was the symptom, packet loss, which showed up in RED as errors and latency. When the resource is not yours, RED is all you have, and it is enough to know you need to call someone.
Both miss the error you did not label. The declined-charge-that-was-really-a-timeout problem is not solved by any checklist. It is solved by the team that owns payments deciding what an error is and recording it as one, which is instrumentation work, not dashboard work.
What to page on
Everything above is dashboards. A pager is different: it costs a person’s sleep and, over months, their willingness to be on call. The rule that falls out of the three methods is the same one Rob Ewaschuk’s alerting philosophy and the SRE book arrive at: page on symptoms, not causes. A symptom is something a user can feel. Causes go on the dashboard the page links to.
For the demo app that means:
| Candidate alert | Page, ticket or panel? | Why |
|---|---|---|
| gateway error ratio above 1% for 5 min | page | users see failures |
| gateway p99 above 500 ms for 10 min | page | users see slowness (the SLO chapter refines this to a burn rate) |
| gateway rate drops to zero while loadgen is up | page | users cannot reach you at all |
| payments error ratio above 1% | ticket, or panel linked from the gateway page | the user feels it at the gateway; a second page for the same incident is noise |
| host CPU above 80% | panel | nobody is hurt yet |
| Postgres pool at 90% | ticket | saturation warning, fix tomorrow |
| disk 85% full, filling at a rate that hits 100% in 4 days | ticket | predictable, not urgent |
| NIC receive errors non-zero | panel | the cause of a RED symptom, not a symptom |
Two of the saturation rows are tickets rather than panels. That is the golden-signals compromise: saturation that is nearly problematic deserves a human’s attention in daylight, not at 3 am. The chapter on multi-window burn-rate alerts turns the first two rows into alerts that are both fast on a cliff and quiet on noise; for now, a simple threshold with a for: duration is enough to make the point that the pager gets the user’s view and nothing else.
In Prometheus the rule looks like this, and it goes in labs/observability/prometheus/rules/:
groups:
- name: red-gateway
rules:
- alert: GatewayHighErrorRatio
expr: |
sum(rate(http_server_request_duration_seconds_count{job="gateway", http_response_status_code=~"5.."}[5m]))
/
sum(rate(http_server_request_duration_seconds_count{job="gateway"}[5m])) > 0.01
for: 5m
labels: { severity: page }
annotations:
summary: "gateway is failing {{ $value | humanizePercentage }} of requests"
dashboard: "http://localhost:3000/d/gateway-red/gateway-red"
- alert: GatewayHighP99
expr: |
histogram_quantile(0.99, sum by (le) (rate(http_server_request_duration_seconds_bucket{job="gateway"}[5m]))) > 0.5
for: 10m
labels: { severity: page }
annotations:
summary: "gateway p99 is {{ $value | humanizeDuration }}"
dashboard: "http://localhost:3000/d/gateway-red/gateway-red"
The dashboard annotation is not decoration. The Grafana best-practice guide’s phrase is that most dashboards should be linked from alerts; a page that lands you on the RED dashboard with the USE dashboard one click away is a page you can act on in two minutes.
You will build three RED dashboards and one USE dashboard, break the app to watch them move, then write the two alert rules that deserve a pager.
1. Start the stack and confirm the metric names. The OTel semconv name and the Collector’s label mapping decide what you query. This lab relies on the .env file from the OpenTelemetry chapter’s lab (OTEL_SDK_DISABLED=false, LOG_FORMAT=json, OTEL_SEMCONV_STABILITY_OPT_IN=http/dup); recreate it if you do not have it, then check what Prometheus actually has:
cd labs/observability
printf 'OTEL_SDK_DISABLED=false\nLOG_FORMAT=json\nOTEL_SEMCONV_STABILITY_OPT_IN=http/dup\n' > .env
docker compose --profile telemetry up -d
sleep 90
curl -s 'http://localhost:9090/api/v1/label/__name__/values' | jq -r '.data[]' | grep -E '^http_server'
curl -s 'http://localhost:9090/api/v1/series?match[]=http_server_request_duration_seconds_count' | jq -r '.data[0]'http_server_request_duration_seconds_bucket, _count and _sum, next to the old-convention http_server_duration_milliseconds_* that dual mode keeps, and a series like {"__name__":"http_server_request_duration_seconds_count","job":"gateway","instance":"otel-collector:8889","http_request_method":"GET","http_response_status_code":"200","http_route":"/checkout","service_name":"gateway", ...}. The job label is the service name because the lab’s Prometheus scrapes the Collector with honor_labels: true. If you see only the milliseconds metric, the opt-in is missing from .env.2. The gateway RED dashboard. In Grafana: Dashboards → New → New dashboard → Add visualization → Prometheus. Add three time-series panels with these queries, in this order, with these units (Standard options → Unit):
# Panel 1 "Rate" (unit: requests/sec (rps))
sum(rate(http_server_request_duration_seconds_count{job="gateway"}[$__rate_interval]))
# Panel 2 "Errors" (unit: Percent (0.0-1.0); add a red threshold at 0.01)
sum(rate(http_server_request_duration_seconds_count{job="gateway", http_response_status_code=~"5.."}[$__rate_interval]))
/
sum(rate(http_server_request_duration_seconds_count{job="gateway"}[$__rate_interval]))
# Panel 3 "Duration" (unit: seconds (s)); three queries, legends p50 / p95 / p99
histogram_quantile(0.50, sum by (le) (rate(http_server_request_duration_seconds_bucket{job="gateway"}[$__rate_interval])))
histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{job="gateway"}[$__rate_interval])))
histogram_quantile(0.99, sum by (le) (rate(http_server_request_duration_seconds_bucket{job="gateway"}[$__rate_interval])))Save it as gateway RED. In the dashboard settings set the UID to gateway-red so the alert annotation above resolves.
LOADGEN_RPS default). Errors is a flat line at 0. Duration shows p50 well under p99; with no faults planted, gateway p99 is a few tens of milliseconds, mostly the orders insert plus the payments round trip. If Errors shows “No data” rather than 0, that is because no 5xx series exists yet; Prometheus returns an empty vector, not zero. Wrap the numerator in sum(...) or vector(0) if you want a zero line.3. Orders and payments. Use Save as on the gateway dashboard twice, changing job="gateway" to job="orders" and job="payments" and the UIDs to orders-red and payments-red. Then plant the two faults the app ships with:
FAULT_ERROR_RATE=0.05 FAULT_SLOW_PAYMENTS_PCT=20 docker compose --profile telemetry up -d paymentsThe .env keeps the SDK and the opt-in on for the recreated container. Wait two minutes and look at all three dashboards.
4. The USE dashboard for the host. Add node_exporter to the compose file. In compose.yaml, under services:, next to the other telemetry services (same indentation as prometheus:), add:
node-exporter:
image: quay.io/prometheus/node-exporter:v1.9.0
profiles: ["telemetry"]
restart: unless-stopped
command: ["--path.rootfs=/host"]
pid: host
volumes: ["/:/host:ro,rslave"]It joins the compose project’s default network like every other service, so Prometheus reaches it as node-exporter:9100; no port needs publishing. Then in prometheus/prometheus.yml, at the end of scrape_configs:, add:
- job_name: node
static_configs:
- targets: ['node-exporter:9100']Then:
docker compose --profile telemetry up -d node-exporter
docker compose --profile telemetry restart prometheus
curl -s localhost:9090/api/v1/query --data-urlencode 'query=up{job="node"}' | jq '.data.result[0].value[1]'"1". On Docker Desktop (macOS or Windows) the “host” node_exporter sees is the Linux VM that runs your containers, not your laptop; the numbers are real for the containers’ resources, which is what you want. (If you prefer per-container figures, cAdvisor exposes container_cpu_usage_seconds_total and container_memory_working_set_bytes; publish it on a port other than 8080, which the gateway owns.) Keep node-exporter and the node job: the dashboards chapter uses them for its saturation panel.Build a dashboard host USE with two rows per resource, utilisation on the left and saturation on the right, using the USE queries from the body of the chapter: CPU (1 - avg(rate(node_cpu_seconds_total{mode="idle"}[$__rate_interval])) and rate(node_pressure_cpu_waiting_seconds_total[$__rate_interval])), memory (1 - node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes and rate(node_vmstat_pgmajfault[$__rate_interval])), disk (rate(node_disk_io_time_seconds_total[$__rate_interval]) and rate(node_disk_io_time_weighted_seconds_total[$__rate_interval])), and one Errors panel with rate(node_network_receive_errs_total[$__rate_interval]) + rate(node_network_transmit_errs_total[$__rate_interval]). Now push the app:
LOADGEN_RPS=200 docker compose --profile telemetry up -d loadgennode_pressure_cpu_waiting_seconds_total starts to move: that is saturation, tasks waiting for a CPU. Watch gateway p99 on the RED dashboard at the same time. Saturation on USE leads the p99 rise on RED by a little; that lead is the warning RED cannot give you on its own. If PSI panels show no data, your kernel does not expose pressure stall information and node_load1 / count(node_cpu_seconds_total{mode="idle"}) is the fallback.5. Decide what pages. Put the load back with docker compose up -d loadgen (5 rps). Save the two gateway rules from the body of the chapter as prometheus/rules/red-gateway.yml; prometheus.yml already loads /etc/prometheus/rules/*.yml. Restart Prometheus and check they loaded:
docker compose --profile telemetry restart prometheus
curl -s http://localhost:9090/api/v1/rules | jq '.data.groups[].rules[] | {alert: .name, state: .state}'GatewayHighErrorRatio is pending and, five minutes later, firing. GatewayHighP99 fires too, because 20% of payments sleeping 1.5 to 3 s puts gateway p99 well above 500 ms. Notice what you did not write: nothing on payments’ error ratio, nothing on CPU, nothing on node_exporter. Those are panels the page leads you to. If the error fault is still on, you also have the first entry in a growing list of “alerts that fire during a lab”, so turn the fault off before you leave: docker compose --profile telemetry up -d payments. The rules file can stay; nothing later depends on it.http_response_status_code=~"5.." in the error panel to =~"4..|5.." and set FAULT_ERROR_RATE to 0. Hit the gateway with a bad request a hundred times: for i in $(seq 100); do curl -s 'localhost:8080/checkout?user=abc' >/dev/null; done. The gateway’s error panel and alert now fire on what is entirely your fault as a caller, and payments’ panel stays flat. Then do the reverse: imagine a payments bug that returns 200 with {"status":"declined"}. No query in this chapter can see it, because nobody labelled it an error. The first mistake is a wrong threshold; the second is missing instrumentation. Dashboards fix neither. Put the error panel’s regex back to "5.." afterwards: the dashboards chapter starts from these dashboards.You run the demo app for real: gateway, orders, payments, a Postgres and a Redis, on three VMs. There is one on-call engineer. You can afford at most three alerts that page. The team currently has twelve, all on resources: CPU, memory, disk, pool size, Redis memory, and so on. Which set do you keep?
- TALK The RED Method: How to Instrument Your Services Tom Wilkie (GrafanaCon EU talk, written up by Grafana Labs), 2018
The method from its author, in twenty minutes: why every service gets the same three panels, how RED relates to USE, and the admission that it does not apply to batch jobs. Skip the product sections at the end.
- POST The USE Method Brendan Gregg, 2012
The original. Read the definitions, the resource list and the warning that utilisation averaged over long intervals hides saturation. The per-OS checklists it links to are reference material, not reading.
- BOOK Monitoring Distributed Systems (SRE book, chapter 6) Rob Ewaschuk, edited by Betsy Beyer, 2016
Where the four golden signals come from, including the two refinements people miss: separate the latency of failed requests, and collect histograms rather than means. Read: 'The Four Golden Signals', 'Worrying About Your Tail' and 'Symptoms Versus Causes'; skip the Bigtable and Gmail case studies on first read.
- POST My Philosophy on Alerting Rob Ewaschuk, 2013
The short document that became SRE book chapter 6. Pages should be urgent, actionable and about symptoms; everything else is a ticket. Read it all; it is six pages.
- DOC Grafana dashboard best practices
Grafana's own framing of USE for resources and RED for services, and why alerting should be built on RED dashboards. The maturity model at the end is the next chapter's subject.
- DOC Semantic conventions for HTTP metrics
The definition of http.server.request.duration, its unit, its attributes and the recommended bucket boundaries, which is where every PromQL query in this chapter gets its metric and label names.
- CODE node_exporter
The README has the Docker and Compose examples (the rootfs bind mount and --path.rootfs) and the list of collectors; the pressure collector is where the PSI saturation metrics come from.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.