Skip to main content

Module metric_sink

Module metric_sink 

Source
Expand description

Row-wise shaping for MetricSink sources.

A metric sink exports the rows of an existing collection into the in-process Prometheus metrics registry. The compute-side operator (mz_compute::sink::metric_sink) reads a canonical row shape and two planner-computed classification columns rather than parsing metric_type strings or validating metric names on its hot path. shape_metric_sink_source produces that shape.

Only the pure per-row shaping lives here. The cross-row logic (dedup, collision detection, family-conflict counting) stays in the operator, because it needs the frontier-gated fold that a per-row Map in MIR can’t express.

Constants§

METRIC_NAME_PATTERN 🔒
Matches Prometheus’s metric name grammar: [a-zA-Z_:][a-zA-Z0-9_:]*.

Functions§

shape_metric_sink_source 🔒
Extends the metric sink’s imported relation with the row-wise shaping the operator otherwise has to do in Rust: coalesces labels/help to their identity element, and adds two columns the operator reads instead of parsing strings on its hot path: