Skip to main content

label_rewrite

Function label_rewrite 

Source
fn label_rewrite<'a>(
    name: &str,
    arguments: &'a [Box<Expr>],
) -> Result<Option<(LabelRewrite, &'a Expr)>>
Expand description

The label change label_replace or label_join makes, and the vector it is made to, or None when name is neither.

The parser checks the argument types and counts; what is left to check is the arguments’ content, which [LabelRewrite] does as Prometheus does at evaluation, so an invalid regular expression or an empty label name fails the statement here as it would there.