Skip to main content

Module select

Module select 

Source
Expand description

Operators that depend on the whole set of evaluated series at each grid point: topk, bottomk, limitk, limit_ratio, scalar, absent and the instant-result sorts.

Semantics follow Prometheus (aggregationK, HashRatioSampler, funcScalar, funcAbsent, createLabelsForAbsentFunction, funcSort*). A scalar is a grid series without labels that has a value at every point, so vector(s) is s itself and has no kernel.

StructsΒ§

LabelMatcher
A label matcher of the selector absent is applied to.

EnumsΒ§

Grouping
The labels that form an aggregation group.
MatchOp
The operator of a LabelMatcher.
SortOrder
The order sort_instant arranges an instant result in.

ConstantsΒ§

GO_NAN πŸ”’
Go’s math.NaN() bit pattern, which Prometheus returns for an undefined scalar.

FunctionsΒ§

absent
absent(v): 1 with labels at every point where no series is present.
absent_labels
The labels of an absent result, as Prometheus createLabelsForAbsentFunction derives them: the first equality matcher of a name sets that label, any other matcher of the name removes it, and __name__ is skipped.
chunks πŸ”’
Maximal runs of ASCII digits and of other characters, like the regexp (\d+|\D+).
compare_labels πŸ”’
Prometheus labels.Compare: label pairs in name order, then the shorter set first.
cursor_value πŸ”’
The value a forward cursor reads at compact row; the rows asked for only increase.
float_samples πŸ”’
series without its histogram samples, None when nothing else is left. One field, as sort reads.
grid_and_points πŸ”’
Checks every series against schema and returns the grid it validated them on, with its length.
grid_points πŸ”’
Checks every series against schema and returns the grid length.
group_key πŸ”’
group_key_from πŸ”’
The group labels belong to, for callers that already hold the series’ label pairs.
into_value πŸ”’
A sample as a value for an operator that ranks or sorts reads it.
k_param πŸ”’
The k of topk, bottomk and limitk as Prometheus reads it: nothing for k below 1, an error for NaN or a value out of int64, otherwise k truncated and capped at the number of input series.
labels_with_name πŸ”’
The label pairs of metric with __name__ among them, sorted by name.
limit_ratio
limit_ratio(r, ...) with a constant r.
limitk
limitk(k, ...) with a constant k.
natural_less πŸ”’
github.com/facette/natsort.Compare, which sort_by_label uses: digit runs compare as integers when both parse, other runs as strings.
rank πŸ”’
The order of a and b for topk (top) or bottomk; NaN ranks last for both.
sample_offset πŸ”’
Prometheus HashRatioSampler.SampleOffset: the xxHash64 of the labels as stringlabels encodes them, each name and value prefixed by its length, over u64::MAX.
scalar
scalar(v): the value of the only float sample present at each point, NaN otherwise.
single_field πŸ”’
sort_instant
Orders the series of an instant result. A range result keeps its order: Prometheus does not sort matrices.
topk
topk(k, ...) (top) or bottomk(k, ...) with a constant k.
topk_at
topk/bottomk with k evaluated independently at each grid point.
validate_topk_parameters πŸ”’
Validates the complete parameter series for Prometheus topk/bottomk/limitk semantics.
value_at πŸ”’
The first field’s value of series at grid point, looked up by position.

Type AliasesΒ§

GroupKey πŸ”’
Label pairs identifying a group; empty values are absent, as in Prometheus.