Skip to main content

Module map_label

Module map_label 

Source
Expand description

label_replace and label_join over evaluated series, following Prometheus evalLabelReplace, evalLabelJoin and mergeSeriesWithSameLabelset.

Structsยง

LabelRewrite
The label change of label_replace or label_join, checked and compiled once and applied to each series on its own. Series that end up with one label set are the callerโ€™s to merge.

Enumsยง

Change ๐Ÿ”’

Staticsยง

GROUP_NAME ๐Ÿ”’
Go regexp.Expand reads a group name as Unicode letters (L), decimal digits (Nd) and _, narrower than char::is_alphanumeric.

Functionsยง

expand ๐Ÿ”’
Go regexp.Expand, whose template syntax differs from regex::Captures::expand: a numeric reference with a leading zero, like $01, or of more than nine digits is a group name.
label_join
label_join(v, dst, separator, src...): dst is set to the values of src joined by separator, an absent label joining as the empty string.
label_replace
label_replace(v, dst, replacement, src, regex): where regex matches the whole value of src, dst is set to replacement with $1, ${name} and $$ expanded.
rewrite_all ๐Ÿ”’
set_label ๐Ÿ”’
An empty value removes the label, as Prometheus label sets have no empty values.