histogram_quantile
histogram_quantile(histogram: histogram like, quantile: const float64) -> float64
Returns an approximate quantile of a histogram-like value as float64. The second argument is a compile-time constant quantile in the inclusive range 0 through 1; values outside that range are rejected at compile time. For OpenTelemetry classic histogram inputs the implementation follows the otel_histogram_quantile path, for exponential histograms the otel_exponential_histogram_quantile path, and for tdigest it delegates to the same estimate logic as tdigest_quantile with a return type derived from the digest’s inner numeric type (still represented as floating point for the expression). This function is the typed overload that accepts histogram, exponential histogram, or tdigest columns directly, unlike the otel_* variants which require a generic object histogram payload.
Domain
This is a scalar function (calculates a single output value for a single input row).
Categories
Examples
align 1m, frame(back: 1m), o: histogram_quantile(m_histogram("duration"), 0.95)
Emits the approximate 95th percentile of a classic histogram metric inside a one-minute aligned aggregate.
make_col median:histogram_quantile(service_digest, 0.5)
Projects the median estimate from a t-digest column using the unified histogram quantile entry point.
Updated 18 days ago