histogram_fraction
histogram_fraction(histogram: histogram like, value: const numeric or duration) -> float64
Calculates the CDF (Cumulative Distribution Function) of the distribution in a histogram-like object at the specified value.
Given an histogram-like object (OTel histogram, OTel exponential histogram, or t-digest), and an input value, returns the fraction of the distribution that is less than or equal to the input value.
As any other function that operates on histogram-like objects, the resulting fraction is an approximation.
Currently, the only supported histogram-like type is tdigest.
Domain
This is a scalar function (calculates a single output value for a single input row).
Categories
Examples
align 5m, o: histogram_combine(m_tdigest("duration"))
aggregate o: histogram_fraction(histogram_combine(o), 10m), group_by(^Cluster...)
align aggregates tdigest metric "duration" over time into 5 minute time bins.
aggregate computes the fraction of the distribution that is less than or equal
to 10 minutes for each cluster.
Updated 8 days ago