Skip to main content

map_writes_existing_label

Function map_writes_existing_label 

Source
fn map_writes_existing_label(
    input: &NativeNode,
    op: &BoundMap,
    source_tags: &[Vec<String>],
) -> Option<bool>
Expand description

Whether op, applied to input’s series, writes a label those series already carry.

The walk is over the ops in written order, starting from the labels the input reports. A destination the input already carries can fold two series into one; a fresh destination cannot. A __name__ destination is always treated as carried, even when the derived set has lost it: a kernel such as abs, timestamp or a range function drops the name, but the scan below it can still hold several metrics whose ordinary labels are equal, and writing one name puts those identities under one label set. Nothing here proves the input reads a single metric, so the conservative answer is the one that collects.

None when the input’s label set is not derivable, which is treated as “it may carry the destination” by the caller: an unknown set proves nothing, so the conservative answer is the one that collects.