Skip to main content

PRESENCE_FOLD

Constant PRESENCE_FOLD 

Source
const PRESENCE_FOLD: RangeFunction;
Expand description

The range function absent_over_time folds a window with, to learn whether a series has a sample in it.

absent answers at every point its input holds no series at, so the matrix has to become one series per series holding a sample: a range function at all, rather than a value no series states. Which range function is therefore a question of which points a window reports, and present_over_time and last_over_time report the same ones — a window with at least one sample. The name is what separates them: present_over_time drops the metric name, and a selector written without one is discovered as one source per metric, so two metrics carrying the same ordinary labels would arrive at the fold as one label set. The window refuses two values of one label set at one point, because everything above it reads them as one series: the query would fail where Prometheus answers with the empty vector. Keeping the name keeps those two series apart, and absent reads presence alone, so the value this fold computes is not part of the answer.