Loading

Aggregation functions

These functions aggregate the values of an instant vector across series, optionally grouped with by or without.

Calculates the average of the values across the input vector.

Return type

instant_vector

Parameters

v (instant_vector)
Instant vector input.

Example

avg(http_requests_total)
		

Counts the number of elements in the input vector.

Return type

instant_vector

Parameters

v (instant_vector)
Instant vector input.

Example

count(http_requests_total)
		

Differences from Prometheus

Returns a long integer count rather than a floating-point value.

Returns the maximum value across the input vector.

Return type

instant_vector

Parameters

v (instant_vector)
Instant vector input.

Example

max(http_requests_total)
		

Returns the minimum value across the input vector.

Return type

instant_vector

Parameters

v (instant_vector)
Instant vector input.

Example

min(http_requests_total)
		

Returns the φ-quantile (0 ≤ φ ≤ 1) of the values across the input vector.

Return type

instant_vector

Parameters

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

Example

quantile(0.9, http_request_duration_seconds)
		

Differences from Prometheus

Computed using the Elasticsearch t-digest percentile aggregation, so results are approximate and may differ slightly from Prometheus's exact linear interpolation, particularly for small sample sets.

Calculates the population standard deviation across the input vector.

Return type

instant_vector

Parameters

v (instant_vector)
Instant vector input.

Example

stddev(http_requests_total)
		

Calculates the population variance across the input vector.

Return type

instant_vector

Parameters

v (instant_vector)
Instant vector input.

Example

stdvar(http_requests_total)
		

Calculates the sum of the values across the input vector.

Return type

instant_vector

Parameters

v (instant_vector)
Instant vector input.

Example

sum(http_requests_total)