Loading

Histogram functions

These functions operate on histogram metrics.

Returns the arithmetic average of observations stored in a native histogram.

Return type

instant_vector

Parameters

v (instant_vector)
Instant vector input.

Example

histogram_avg(increase(http_request_duration_seconds[5m]))
		

Returns the count of observations stored in a native histogram.

Return type

instant_vector

Parameters

v (instant_vector)
Instant vector input.

Example

histogram_count(increase(http_request_duration_seconds[5m]))
		

Returns the estimated fraction of observations of a native histogram that fall between the provided lower and upper values.

Return type

instant_vector

Parameters

lower (scalar)
Lower bound of the range.
upper (scalar)
Upper bound of the range.
v (instant_vector)
Instant vector input.

Example

histogram_fraction(0, 0.2, increase(http_request_duration_seconds[1h]))
		

Returns the φ-quantile of a classic histogram represented by cumulative le buckets or a native (exponential) histogram.

Return type

instant_vector

Parameters

φ (scalar)
Quantile value (0 ≤ φ ≤ 1).
v (instant_vector)
Instant vector input.

Example

histogram_quantile(0.9, rate(http_request_duration_seconds_bucket[5m]))
		

Returns the sum of observations stored in a native histogram.

Return type

instant_vector

Parameters

v (instant_vector)
Instant vector input.

Example

histogram_sum(increase(http_request_duration_seconds[5m]))