---
updatedAt: 2026-04-16T21:23:00.000Z
agentTools:
  projectIndex: https://docs.observeinc.com/llms.txt
---

# 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](function-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

* [Misc](function#misc-functions)

# Examples

<OpalCodeBlock code={
`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.

<OpalCodeBlock code={
`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.