Methods: RED, USE, Golden Signals, SLI/SLO/SLA
RED: for Request-Driven Services
The RED method, popularized by Tom Wilkie (Weaveworks, then Grafana Labs) around 2015, says that for every service that handles requests you measure three things from the request stream: Rate (requests per second), Errors (failed requests per second or as a ratio), and Duration (the distribution of request latency, as a histogram, never an average). It is deliberately minimal so every microservice can be given the same dashboard from the same template.
sum by (service) (rate(http_server_requests_total[5m])) # Rate
sum by (service) (rate(http_server_requests_total{code=~"5.."}[5m]))
/ sum by (service) (rate(http_server_requests_total[5m])) # Errors (ratio)
histogram_quantile(0.99, sum by (le, service) (rate(http_server_request_duration_seconds_bucket[5m]))) # Duration p99USE: for Resources
The USE method, by Brendan Gregg (2012, for finding performance bottlenecks), applies to resources, anything with finite capacity that work consumes: for every resource check Utilization (the fraction of time it is busy, or fraction of capacity used), Saturation (the amount of work that is waiting because the resource is full: queue length, wait time), and Errors (error events the resource itself reports). The key insight is that utilization alone lies: a CPU at 60% average can have a deep run queue during bursts; saturation is what hurts latency.
| Resource | Utilization | Saturation | Errors |
|---|---|---|---|
| CPU | 1 - avg(rate(node_cpu_seconds_total{mode="idle"}[5m])) | Run-queue length vs cores (node_load1 / cores), CFS throttling (container_cpu_cfs_throttled_periods_total) | Machine-check / hardware errors (rare) |
| Memory | 1 - node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes | Swapping and page-scan rate (node_vmstat_pgmajfault, pswpout) | OOM kills (node_vmstat_oom_kill) |
| Disk | rate(node_disk_io_time_seconds_total[5m]) (fraction of time busy); space used % | I/O queue depth, node_disk_io_time_weighted_seconds_total rate | Device I/O errors, filesystem read-only |
| Network | Bytes/s vs link speed (rate(node_network_receive_bytes_total[5m]) * 8 / speed) | TCP retransmits, socket backlog overflows, qdisc drops | Interface *_errs_total, *_drop_total |
| DB connection pool | In use / max (hikaricp_connections_active / hikaricp_connections_max) | Threads waiting for a connection; wait time histogram | Acquire timeouts, connection failures |
| Thread / worker pool | Busy threads / pool size | Tasks queued; rejected-execution count approaching | Rejected tasks, uncaught exceptions |
| Queue (broker) | Consumer capacity used (messages/s vs max consumer rate) | Backlog depth and age of the oldest message (consumer lag) | Dead-lettered or failed deliveries |
The two methods compose into a debugging path (see Incident walkthrough walks one): RED on the service graph finds which service is slow or failing; USE on that service's resources finds why. Latency at the top of a graph is very often saturation at the bottom (a full connection pool, a throttled container, a backed-up queue).
Google's Four Golden Signals
The SRE book (chapter 6) names four signals for any user-facing system: latency (time to serve a request; track successful and failed requests separately, since a fast error is not a good latency), traffic (demand on the system, such as requests per second), errors (rate of failed requests: explicit 5xx, implicit wrong content, policy errors like "over 1 s counts as an error"), and saturation (how "full" the service is, emphasizing the most constrained resource, and predicting trouble before it happens).
| Golden signal | RED | USE |
|---|---|---|
| Traffic | Rate | (utilization of a resource is the dual) |
| Errors | Errors | Errors |
| Latency | Duration | (wait time is a form of saturation) |
| Saturation | absent | Saturation (and Utilization) |
So RED is the golden signals minus saturation, aimed at services; USE is the saturation-centered view of resources. A service-level dashboard should still show one saturation signal for the service's hardest limit.
SLI: A Ratio of Good to Valid
A service level indicator (SLI) is a quantitative measure of one aspect of service quality, defined in the SRE Workbook as good events / valid events, giving a value from 0% to 100%. "Valid" excludes events you decided not to count (health checks, 4xx caused by clients); "good" is your definition of success. There are two shapes:
Request-based SLI
Count events: "proportion of HTTP requests that returned non-5xx" or "proportion served in under 300 ms". Each request counts equally, so busy periods dominate. This is the default for services.
Window-based SLI
Count time slices: "proportion of 1-minute windows in which p99 latency was under 300 ms" or "in which the probe succeeded". Fits low-traffic systems and things measured by probes; a quiet minute counts as much as a busy one.
-- Availability SLI (request-based)
sum(rate(http_requests_total{job="api", code!~"5.."}[28d]))
/ sum(rate(http_requests_total{job="api", code!~"429"}[28d])) # 429 treated as not valid, adapt to taste
-- Latency SLI: fraction of requests faster than 300 ms (le must be an existing bucket boundary)
sum(rate(http_request_duration_seconds_bucket{job="api", le="0.3"}[5m]))
/ sum(rate(http_request_duration_seconds_count{job="api"}[5m]))
-- Same with native histograms (no bucket boundary needed)
histogram_fraction(0, 0.3, sum(rate(http_request_duration_seconds{job="api"}[5m])))Note that a latency SLI is a proportion under a threshold, not a percentile. "99% of requests under 300 ms" and "p99 < 300 ms" state the same thing, but the former is a ratio of counters, so it aggregates correctly across instances and over time, while a computed p99 does not (see PromQL).
SLO: A Target Over a Window
A service level objective (SLO) is a target for an SLI over a time window: "99.9% of requests succeed, measured over a rolling 28 (or 30) days". The window is part of the definition: it fixes the error budget (1 − SLO) in absolute terms.
| SLO | Downtime per 30 days | Per 28 days | Per year |
|---|---|---|---|
| 99% | 7 h 12 min | 6 h 43 min | 3.65 days |
| 99.5% | 3 h 36 min | 3 h 21 min | 1.83 days |
| 99.9% | 43.2 min | 40.3 min | 8.77 h |
| 99.95% | 21.6 min | 20.2 min | 4.38 h |
| 99.99% | 4.32 min | 4.03 min | 52.6 min |
| 99.999% | 25.9 s | 24.2 s | 5.26 min |
A rolling window (28 days is popular because it always contains exactly four weekends) is smoother than a calendar month; a calendar window resets the budget on the 1st, which can encourage a risky release rush. Pick one and use it everywhere.
SLA: A Contract
A service level agreement (SLA) is a business contract with consequences (refunds, service credits, termination rights) if a stated level is missed. It is almost always looser than the internal SLO: you want to fail your own target, and fix things, well before you owe a customer money. SLAs usually cover a narrower thing than the SLO (a measured uptime on specific endpoints, with defined exclusions such as maintenance windows).
Error budget and error budget policy
The error budget turns reliability into a spendable quantity shared by product and engineering. Releases, experiments and incidents all spend it. The error budget policy is the written agreement on what happens as it runs out, for example: above 50% remaining, ship normally; below 25%, only reliability work and low-risk changes; at zero, a release freeze (except security and reliability fixes) until the SLO window recovers, plus a postmortem for any single incident that consumed more than 20% of the budget. Burn-rate alerting (see Alerting and SLOs) is the early warning that connects the policy to the pager. The policy only works if leadership has signed it before the first incident.
Choosing SLIs by Service Type
| Service type | Primary SLIs | Example definition |
|---|---|---|
| Request / response (APIs, web) | Availability, latency, (quality) | Non-5xx / valid requests; requests under 300 ms / all valid requests |
| Pipeline / batch / streaming | Freshness, throughput, coverage, correctness | Fraction of time that the newest record in the output is less than 5 min old; fraction of input records processed |
| Storage / database | Durability, availability, latency | Fraction of written objects still readable and uncorrupted (verified by scrubbing); read latency under threshold |
Freshness is the most-forgotten SLI: a pipeline can be 100% "available" and 6 hours behind.
Where to Measure the SLI
Measuring at the load balancer (or ingress) is the usual compromise: one place, covers every backend, includes retries and timeouts the LB applies, and is cheap. It does not see requests that never arrive (DNS failure, a broken CDN, TLS errors, a blocked client network). Measuring at the client (RUM, mobile SDKs, see Beyond the three pillars) sees what users actually experience, but it is noisy (bad Wi-Fi, ad blockers drop beacons) and needs sampling and its own pipeline. Measuring inside the service is easy but optimistic: a crashed service reports zero errors because it reports nothing. The Workbook ranks them by closeness to the user; a good default is the LB for the SLO, backed by a synthetic prober (see Beyond the three pillars) for what the LB cannot see.
Traps
The Invariants
- Guarantees: RED and USE give every service and resource the same few signals, so unfamiliar systems are debuggable on sight; an SLI as a ratio of counters aggregates correctly across instances and time; an SLO plus window defines an absolute error budget (99.9% / 30 d = 43.2 min), which makes reliability a number product and engineering can trade against.
- Does not guarantee: That the SLI reflects user experience (it depends entirely on where it is measured); that a met SLO means no user was unhappy (it is an aggregate); that USE finds application bugs (it finds resource limits only); that an SLA is safe because the SLO is met (definitions and exclusions can differ).