Observabilityhistogram metriccountergaugemetric types

Histogram

Definition

A histogram metric records the distribution of observed values as counts per bucket plus a total count and sum; the other basic metric types are counters, which only increase, and gauges, which are point-in-time values.

In practice

Averages hide slow requests; a histogram keeps the shape, so you can estimate P50, P95 and P99 and see one slow server that the average smooths away. Unlike client-side summaries, histogram buckets can be added across instances before computing percentiles, which makes fleet-wide P99 possible. Counters are read as rates (requests per second), gauges as current levels (queue depth, memory).

Percentiles from buckets are estimates, so bucket boundaries must bracket the values you care about, for example around your latency SLO. Each bucket is a separate time series, multiplying cardinality with every label. Native or exponential histograms in Prometheus and OpenTelemetry pick resolution automatically and reduce this cost.

Example

http_request_duration_seconds_bucket{le="0.1"} counts requests faster than 100 ms; histogram_quantile(0.99, sum by (le) (rate(http_request_duration_seconds_bucket[5m]))) gives the fleet P99.