Skip to main content

Module function

Module function 

Source
Expand description

Float range-vector functions as window kernels. Each kernel follows the Prometheus function of the same name, including its floating point operation order.

StructsΒ§

ExtrapolationSpan πŸ”’
The span one window’s extrapolation factor is measured over. A float window starts both intervals at its first sample; a native histogram counter with a start_timestamp inside the window starts the sampled interval at that synthetic zero instead.

EnumsΒ§

RangeFunction
A PromQL range-vector function over float and native histogram samples.

FunctionsΒ§

anchored_values πŸ”’
Prometheus pickFirstSampleIndices for an anchored window of floats: the values from the last sample at or before the window start on, or None when no sample lies after the start.
avg πŸ”’
Prometheus funcAvgOverTime: the Kahan sum divided by the count, switching to an incremental mean once the sum would overflow.
double_exponential_smoothing πŸ”’
Prometheus funcDoubleExponentialSmoothing; RangeEvaluator checks the factors.
extended_rate πŸ”’
Prometheus extendedRate: rate, increase or delta over an anchored or smoothed window. The value at the window start is the last sample at or before it, or for smoothed the interpolation between it and the next one; the end is picked or interpolated the same way. Nothing is extrapolated.
extrapolated_rate πŸ”’
Prometheus extrapolatedRate over floats.
extrapolated_rate_batch πŸ”’
The batch form of extrapolated_rate over consecutive windows of one field; bit-identical to calling the per-window form once per point.
extrapolated_rate_of πŸ”’
The arithmetic of extrapolated_rate, over a window’s endpoints and the previous values of its resets. Shared by the per-window and batch forms so their results stay equal.
extrapolation_factor πŸ”’
The factor extrapolatedRate scales the sampled increase by, for floats and native histograms alike. zero_point is the first value over the increase, given only when a counter is extrapolated to zero; 0 puts the zero point at span.sampled_from, as a synthetic zero does. A zero sampled interval answers 1.0 (1 / range for a rate).
interpolate πŸ”’
Prometheus interpolate between the samples at index and index + 1, at t: a counter that reset between them restarts from zero.
last_two πŸ”’
linear_regression πŸ”’
Prometheus linearRegression: (slope, intercept) with x in seconds from intercept_time. Needs at least two samples.
median_absolute_deviation πŸ”’
Prometheus funcMadOverTime: the median of the absolute deviations from the median; NaN when any sample is NaN.
quantile πŸ”’
Prometheus quantile, which sorts NaN before every number.
search πŸ”’
Go sort.Search(n, predicate): the first index in [0, n) the predicate holds at, or n.
seconds πŸ”’
sum πŸ”’
Prometheus funcSumOverTime.
timestamp_of_extremum πŸ”’
Prometheus compareOverTime returning the timestamp: the last sample holding the maximum (or minimum), where a NaN so far is replaced by any later sample.
variance πŸ”’
Prometheus varianceOverTime, the population variance.