histogram_combine
histogram_combine(histogram: histogram like) -> histogram
Aggregates many histogram-like values in each time-aligned group into one combined value of the same representation. The compiler routes OpenTelemetry classic and exponential histogram inputs through the same merge path used by otel_histogram_sum and otel_exponential_histogram_sum, and routes tdigest inputs through tdigest_combine, so the aggregate semantics match those underlying functions for each type. Use it after selecting a histogram metric with m_histogram, m_exponential_histogram, or a tdigest metric via m_tdigest inside an align (or another verb that supplies a proper aggregation context). The return type is the same as the argument type, and each evaluation only combines values already stored in one histogram-like column rather than mixing different representations.
Domain
This is an aggregate function (aggregates rows over a group in aggregate verbs).
Categories
Examples
align 5m, frame(back: 5m), o: histogram_combine(m_histogram("latency_ms"))
Combines classic OpenTelemetry histogram buckets per 5-minute alignment group after selecting the named histogram metric.
align 1h, frame(back: 1h), o: histogram_combine(m_exponential_histogram("request_size"))
Rolls up exponential histogram object metrics into one merged histogram per hourly bin for long-window reporting.
Updated 22 days ago