v.25.10New Feature

Aggregate function quantilePrometheusHistogram, which accepts the upper

Aggregate function quantilePrometheusHistogram, which accepts the upper bounds and cumulative values of histogram buckets as arguments, and performs a linear interpolation between the upper and lower bounds of the bucket in which the quantile position is found. Behaves similarly to the PromQL histogram_quantile function on classic histograms. #86294 (Stephen Chi).
Introduces the aggregate function quantilePrometheusHistogram, which calculates quantiles from histogram data by performing linear interpolation between bucket bounds, mimicking the behavior of the PromQL histogram_quantile function.

Why it matters

This feature provides a native ClickHouse function to compute quantiles from Prometheus-style histograms, addressing the need for accurate percentile estimation from cumulative histogram buckets. It simplifies analysis of Prometheus histogram metrics within ClickHouse by replicating PromQL's histogram_quantile behavior.

How to use it

Use the quantilePrometheusHistogram aggregate function by passing it two arguments: the upper bounds of histogram buckets and the cumulative counts for those buckets. The function interpolates linearly between bucket bounds to compute the desired quantile.