← Dashboard

devops / monitoring

Monitoring and Observability: RED, USE, Percentiles and Prometheus

What to measure on a service and on a server, why the average response time misleads, and how Prometheus turns histogram buckets into a p95. The percentile arithmetic was computed for this page and the tool facts were checked on their own sites.

updated Nov 2026·a 12-minute read·Prometheus 3.15.1 and Grafana checked Oct 2026

Monitoring answers a question you wrote down in advance: is the error rate above 1 percent, is the disk full. Observability is the ability to answer questions you did not predict, by exploring metrics, logs and traces after something strange happens. In practice you need both, and you need to know which numbers deserve a graph in the first place. Two short checklists, RED for services and USE for resources, cover most of the answer. A third idea, percentiles, explains why a dashboard that says "average latency 220 ms" can sit on top of an application that is timing out for one user in fifty.

01 · THE AVERAGE PROBLEM

Why the mean hides your slowest users

Take 1,000 requests: 900 finish in 100 ms, 80 take 400 ms, and 20 take 5,000 ms. That is a plausible shape for a service with a slow dependency or a cold cache. Computing the summary numbers directly from that list gives:

One request set, five summaries (computed with a short script)
StatisticValueWhat it tells you
Mean222 msLooks fine, and matches nobody's real experience
p50 (median)100 msThe typical request
p90100 msNine in ten requests are fast
p95400 msThe slow tail begins
p995,000 msOne request in a hundred waits five seconds

The percentile pN is the value that N percent of observations are at or below, which Prometheus's documentation phrases as the φ-quantile. Here the nearest-rank p99 is the 990th-fastest of 1,000 requests. The mean of 222 ms is dragged up by the 20 outliers and hides them, while p99 states the problem outright. Alert and set targets on percentiles, and graph p50, p95 and p99 together so you can see whether the whole distribution moved or only the tail.

02 · WHAT TO GRAPH

RED for services, USE for resources, and the four golden signals

The RED method comes from Tom Wilkie, who described it for microservices: for every service, track the rate of requests, the number of errors, and the duration of requests. The USE method comes from Brendan Gregg: for every resource, such as a CPU, a disk or a network interface, check utilization, saturation and errors. Gregg defines saturation as the degree to which a resource has extra work it cannot service, often a queue. Google's SRE book offers a related list, the four golden signals: latency, traffic, errors and saturation.

Which method for which thing
MethodApply it toConcrete example
REDEach request-driven serviceCheckout API: requests per second, share of responses that are 5xx, p95 latency
USEEach machine resourceDatabase host disk: percent busy, queue length, I/O error count
Four golden signalsA user-facing system, when you can only pick fourLatency, traffic, errors, and saturation of the tightest resource
TIPPage on symptoms, not causes. The Google SRE book says to page a human when one of the golden signals is problematic. High CPU is a cause that may or may not hurt anyone; a rising error rate is a symptom users already feel. Keep cause-style metrics on dashboards for diagnosis and keep pager alerts for what users experience.

03 · FROM BUCKETS TO A P95

How Prometheus estimates percentiles, and where it goes wrong

A Prometheus histogram does not store every request time. It stores counters of how many observations fell at or below each bucket boundary. Prometheus calculates the quantile on the server with histogram_quantile(), interpolating inside the bucket where the target rank falls. The documentation states that quantiles are estimates, with error limited by the width of the bucket the quantile lands in.

Feed it the same 1,000 requests with buckets at 0.1 s, 0.5 s and 5 s, which hold 900, 980 and 1,000 cumulative observations:

Interpolating inside a bucket, worked by hand and checked with a script
QuantileTarget rankBucket it lands inEstimateTrue value
p959500.1 to 0.5 s (80 observations)0.1 + 0.4 × (50 / 80) = 0.35 s0.4 s
p999900.5 to 5 s (20 observations)0.5 + 4.5 × (10 / 20) = 2.75 s5 s

The p99 estimate is off by almost a factor of two because one bucket spans 0.5 s to 5 s. Prometheus assumes the observations are spread evenly across the bucket, and these are all stacked at the top. The fix is not a cleverer query; it is choosing bucket boundaries around the latencies you care about, such as your SLO threshold. The same docs compare summaries, which calculate quantiles inside the application but cannot be aggregated across instances. When many instances serve one API, histograms are the usual choice for that reason.

PromQL patternsfor a classic histogram
# Rate: requests per second across all instances
sum(rate(http_requests_total[5m]))

# Errors: share of responses that are 5xx
sum(rate(http_requests_total{status=~"5.."}[5m]))
  / sum(rate(http_requests_total[5m]))

# Duration: p95 latency, aggregated across instances
histogram_quantile(0.95,
  sum by (le) (rate(http_request_duration_seconds_bucket[5m])))

The last query follows the pattern in the Prometheus function reference: wrap rate() in sum, and keep the le label in the by clause because histogram_quantile() needs it. The metric names are the common convention; yours depend on your client library. These queries are patterns to adapt, and were not run against a live server for this page.

04 · THE FREE STACK

Prometheus, Grafana and OpenTelemetry: versions and licenses

What each tool does and what it costs, checked October 2026
ToolRoleVersion / license / free tier
PrometheusScrapes metrics and stores them as time series; evaluates alert rules3.15.1 listed as latest and 3.13.5 as the LTS release on the download page; Apache License 2.0
GrafanaDashboards and alerting over many data sourcesGNU AGPL v3 for the open source project; Grafana Cloud has an always-free plan with usage limits and 14 days of retention
OpenTelemetryVendor-neutral instrumentation for traces, metrics and logsOpen specification and SDKs; you pick the backend

The AGPL is a copyleft license, which means a different set of obligations from Apache 2.0, so read it before you modify and redistribute Grafana. For learning, the licenses make no practical difference. The usual first project is Prometheus scraping one application and Grafana drawing the three RED panels from the queries above.

05 · READ NEXT

Primary sources, in the order worth reading them

06 · PRACTICE

Reproduce the p99 error yourself

TRY ITTwo exercises, no server needed first: write ten lines of code that builds the 1,000-request list above and prints the mean, p95 and p99; confirm 222, 400 and 5,000. Then change the bucket boundaries in the interpolation table to 0.1, 0.5, 1 and 5 seconds and recompute the p99 estimate by hand. Then run Prometheus, scrape any instrumented app, and compare your estimate with what histogram_quantile returns.

07 · FAQ

Frequently asked questions

What is the difference between monitoring and observability?

Monitoring checks known conditions, such as error rate or disk space, against thresholds you defined in advance. Observability is how well you can explain unexpected behavior from the metrics, logs and traces a system emits. Monitoring tells you something is wrong; observability helps you find out why.

What is the RED method?

RED stands for rate, errors and duration. For every service you track how many requests it receives per second, how many of those fail, and how long they take. It was described by Tom Wilkie as a way to monitor microservices consistently.

What is the difference between the RED and USE methods?

RED describes services from the point of view of requests: rate, errors and duration. USE, from Brendan Gregg, describes resources such as CPUs and disks: utilization, saturation and errors. Use RED for what your users call and USE for the machines underneath.

Why use p95 and p99 instead of the average latency?

The average is pulled around by a few extreme requests and describes almost no real request. Percentiles show the experience of the slowest users directly. In a set where 2 percent of requests take five seconds, the mean can still look healthy while p99 shows the problem.

Is Grafana free?

Yes. Grafana is open source under the AGPL v3 license and you can run it yourself at no cost. Grafana Cloud also offers an always-free plan with usage limits and 14 days of retention for metrics, logs and traces.

What monitoring connects to

The data is only useful where something runs and gets deployed.