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 p99

USE: 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.

ResourceUtilizationSaturationErrors
CPU1 - 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)
Memory1 - node_memory_MemAvailable_bytes / node_memory_MemTotal_bytesSwapping and page-scan rate (node_vmstat_pgmajfault, pswpout)OOM kills (node_vmstat_oom_kill)
Diskrate(node_disk_io_time_seconds_total[5m]) (fraction of time busy); space used %I/O queue depth, node_disk_io_time_weighted_seconds_total rateDevice I/O errors, filesystem read-only
NetworkBytes/s vs link speed (rate(node_network_receive_bytes_total[5m]) * 8 / speed)TCP retransmits, socket backlog overflows, qdisc dropsInterface *_errs_total, *_drop_total
DB connection poolIn use / max (hikaricp_connections_active / hikaricp_connections_max)Threads waiting for a connection; wait time histogramAcquire timeouts, connection failures
Thread / worker poolBusy threads / pool sizeTasks queued; rejected-execution count approachingRejected 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
A service graph: users call an API gateway, which calls checkout and inventory services, which call a database. Each service box is annotated with RED: request rate, error rate and duration. Under each service are the resources it runs on, such as CPU, memory, connection pool, thread pool, queue and disk, each annotated with USE: utilization, saturation and errors.
Where RED and USE apply: services get RED on their requests, resources underneath get USE. Read it as: draw RED on every arrow (a request between two services) and USE on every box underneath (something that gets used up). Slow requests at the top are usually a saturated resource at the bottom, so you navigate RED to find the service, then USE to find the resource.

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 signalREDUSE
TrafficRate(utilization of a resource is the dual)
ErrorsErrorsErrors
LatencyDuration(wait time is a form of saturation)
SaturationabsentSaturation (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.

SLODowntime per 30 daysPer 28 daysPer year
99%7 h 12 min6 h 43 min3.65 days
99.5%3 h 36 min3 h 21 min1.83 days
99.9%43.2 min40.3 min8.77 h
99.95%21.6 min20.2 min4.38 h
99.99%4.32 min4.03 min52.6 min
99.999%25.9 s24.2 s5.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).

Three nested boxes. The innermost is the SLI, a measurement such as the ratio of good requests to valid requests. Around it the SLO, an internal target on that measurement over a window, for example 99.9 percent over 30 days. Outermost is the SLA, a contract with consequences, set looser than the SLO, for example 99.5 percent with service credits.
SLI, SLO and SLA nest: measurement inside target inside contract. Read it as: the SLO is where you steer, the SLA is where you pay. The gap between them is your safety margin: you should notice and fix a missed SLO long before a customer is owed a credit.

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 typePrimary SLIsExample definition
Request / response (APIs, web)Availability, latency, (quality)Non-5xx / valid requests; requests under 300 ms / all valid requests
Pipeline / batch / streamingFreshness, throughput, coverage, correctnessFraction of time that the newest record in the output is less than 5 min old; fraction of input records processed
Storage / databaseDurability, availability, latencyFraction 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).