Skip to main content

canonical_below

Function canonical_below 

Source
fn canonical_below(node: &NativeNode) -> bool
Expand description

Whether a NativeExpr::Merge collects the series node hands over, at it or below it.

A merge holds one series per canonical label set, so the series above one are not stored series any more: a merge with nothing to merge hands its input’s pieces through, and one that does merge keeps the first piece’s labels and drops the pieces it folded, so what comes out is unique under the label set Prometheus compares (label_set in grid_series) - the one that treats an empty label value as no label. Two pieces that came out of one merge are therefore distinct under that comparison even though their rows may still spell an empty value, which is what makes a second drop above the merge unable to fold them by removing an empty value. What it does not make impossible is the rest of such a drop: a merge keeps two series that differ in __name__, __type__ or __unit__, and removing those is exactly what a metadata drop does.

Only the children that carry samples are searched: a parameter is a scalar or a vector of constants, and a merge below one reads series this node’s own samples did not come from.