Skip to main content

extract_row

Function extract_row 

Source
fn extract_row<'a>(
    cols: &ColumnIndices,
    datums: &[Datum<'a>],
) -> (&'a str, Option<MetricKind>, bool, Vec<(&'a str, Option<&'a str>)>, Option<f64>, &'a str)
Expand description

Extracts (metric_name, metric_kind, name_valid, sorted labels, value, help) from one shaped source row.

The planner already did the row-wise shaping.

A null label value stays None rather than being coerced to a string. Neither a null nor a genuine empty-string value is a representable Prometheus label (an empty value reads as absent), so a row carrying either is skipped downstream instead of published.

Strings borrow from datums, so the caller must own what it needs (see SinkState::stage_ok) before the row backing datums is dropped.