Identify which requests the number describes
A p95 describes the high end of an observed latency distribution. Roughly 95% of observations are at or below it, subject to the calculation method. First find out where the duration starts and stops. A browser interaction, a request seen by a gateway and a server handler span may measure different work. Write down which operation, observation point, outcome classes and time window a chart covers. Use the same definitions for both sides of a comparison.
If the chart excludes timeouts or failures, calculate those rates separately with the relevant request counts. A shorter p95 for successful requests can occur when the slowest attempts are timing out and disappearing from that group. Check whether retries are measured as separate attempts or inside a single caller operation. A request count is useful here because a percentile with a thin sample may respond sharply to a single slow observation.
Combine observations before calculating a fleet percentile
Consider two illustrative instances in one five-minute window. Instance A handled 99 requests at 50 ms and instance B handled one request at 900 ms. The two instance p95 values are 50 ms and 900 ms. Their simple average is 475 ms. With all 100 observations combined, p95 by the nearest-rank rule is 50 ms. Weighting each instance percentile by its count also generally fails to reconstruct the combined percentile, because it has already lost the distribution within each instance.
Prometheus can aggregate compatible histogram counts before estimating a percentile. For a classic histogram, preserve the le label during aggregation because it identifies bucket boundaries. For a single route in this illustrative query, the result is an estimate in seconds. Use it only where the route label and metric exist and the selected instances share the relevant bucket scheme.
histogram_quantile(
0.95,
sum by (le) (
rate(http_request_duration_seconds_bucket{route="/sample"}[5m])
)
)
Native histograms have different query syntax. Check the Prometheus reference for the histogram type you collect. If you group by route in a classic histogram query, retain both the route label and le; otherwise all the selected route buckets are combined into one distribution.
Pick the measurement that answers the question
Suppose an illustrative requirement is “95% at or below 300 ms.” If every selected classic histogram has a bucket at le="0.3", the rate for that bucket divided by the corresponding total observation rate measures the fraction meeting the threshold. Sum each side over the same instances, labels and window. Treat a zero denominator as no observations. A missing bucket on some instances can silently leave their numerator contribution out, so verify the instrumented boundaries before trusting the fraction.
An estimated p95 answers a different question: how long did the request at the 95th percentile take? Prometheus interpolates within histogram buckets under assumptions about the distribution. A broad bucket around the threshold gives the estimator a wide region to work with. Report the window and the counts alongside percentiles or threshold fractions so the reader can see what the calculation included.
Use one chart to choose the next check
If the combined p95 rises, compare request mix, volume and failure rate before attributing the change. Then break out a relevant route or operation and find examples from the affected window. Write a small, verifiable next step, such as comparing handler span duration against total request time for the same request IDs. The latency review worksheet keeps those definitions and follow-up checks together.