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.
Structs§
- Global
LirPlan - The (final) result after MIR ⇒ LIR lowering and optimizing the resulting
DataflowDescriptionwithLIRplans. - Global
MirPlan - The (sealed intermediate) result after embedding a
MetricSinkinto aMirDataflowDescription, inlining referenced views, and jointly optimizing theMIRplans. - Metric
Sink - A wrapper of metric sink parts needed to start the optimization process.
- Optimizer
- Optimizer for metric sinks, both
CREATE METRIC SINKand the coordinator-installed curated sinks.
Enums§
- Metric
Sink From - Where a metric sink’s rows come from.
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 source expression with the row-wise shaping the operator otherwise
has to do in Rust: prepends the configured
prefixtometric_nameto form the published name, coalesceslabels/helpto their identity element, and adds two columns the operator reads instead of parsing strings on its hot path: