Skip to main content

fused_output_tags

Function fused_output_tags 

Source
pub fn fused_output_tags(
    node: &NativeNode,
    source_tags: &[Vec<String>],
) -> Option<Vec<String>>
Expand description

A conservative set of reportable label names for node.

source_tags is indexed by each leaf’s source_index. The canonical pass supplies runtime label names, including __name__ for named scans; the planner supplies declared tag columns to derive output columns. The result need not describe the labels of any individual series: or includes a nullable __name__ column even when both operands drop their names. Math operations remove only __name__ here, while their runtime also removes __type__ and __unit__.

They follow Prometheus’ result labels: a one-to-one match keeps the left side’s labels, narrowed by on or ignoring; and and unless keep the left side’s series and or adds the right side’s; info adds the data labels of the info table; an operation with a scalar or a function of each value keeps its operand’s; a scalar and vector(s) have none; count_values keeps its grouping and the label it writes; a fill that answers a missing many-side sample files the one side’s matching labels, so they join the set, while a grouped include label joins them only when the one side carries it or the matching keeps it in the key a fill reads. A label rewrite writes its destination, and a destination that names the metric name writes that name.

A node that reports a value of its own drops the name where its kernel does - timestamp, a range function whose result is computed (rate, increase, …), a math or histogram map, histogram_quantile, every non-filtering binary - so a name rewrite below one of them cannot make the name reappear above it.

None for a node whose labels this walk does not derive - a count_values whose destination is empty, or an input whose source has no entry. None proves nothing: the canonical pass treats it as “may alias” rather than as “distinct”, and the planner keeps the statement off the native route.