compute: add MetricSink sink operator + connection type (SQL-553)#37813
Open
mtabebe wants to merge 1 commit into
Open
compute: add MetricSink sink operator + connection type (SQL-553)#37813mtabebe wants to merge 1 commit into
mtabebe wants to merge 1 commit into
Conversation
mtabebe
force-pushed
the
ma/prom-metrics/sql-553
branch
2 times, most recently
from
July 22, 2026 19:57
c911cea to
d5f1f36
Compare
mtabebe
marked this pull request as ready for review
July 22, 2026 20:28
mtabebe
force-pushed
the
ma/prom-metrics/sql-553
branch
from
July 22, 2026 20:41
d5f1f36 to
85d44b9
Compare
Problem:
The Prometheus cluster metrics feature needs a compute-side sink that folds a
dataflow's output rows into the process-local MetricsRegistry, so Prometheus can
scrape them from clusterd's existing /metrics endpoint.
Solution:
Add the MetricSink operator and its ComputeSinkConnection::MetricSink variant. A
dataflow whose terminal sink is a MetricSink folds its input rows into the
process-local MetricsRegistry, where Prometheus scrapes them from the existing
/metrics endpoint. This adds no authoring type, no catalog changes, and no user
DDL.
- compute-types: ComputeSinkConnection::MetricSink variant + MetricSinkConnection
(payload-free) + name().
- compute: metric_sink operator (frontier-gated SinkState fold + SinkCollector)
- adapter/optimize: shape_metric_sink_source + METRIC_NAME_PATTERN, the
metric_kind/name_valid column contract the operator reads.
- compute-client: specialize_command_for_replica arm (no storage metadata).
The six per-sink health gauges are mz_metric_sink_{frontier_ms,errors,
skipped,conflicts,collisions,null_values}, each carrying a sink="<id>" const
label.
Testing:
- New unit tests
Co-authored-by: Moritz Hoffmann <antiguru@gmail.com>
mtabebe
force-pushed
the
ma/prom-metrics/sql-553
branch
from
July 22, 2026 20:47
85d44b9 to
747f6d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
The Prometheus cluster metrics feature needs a compute-side sink that folds a dataflow's output rows into the process-local MetricsRegistry, so Prometheus can scrape them from clusterd's existing /metrics endpoint.
Solution:
Add the MetricSink operator and its ComputeSinkConnection::MetricSink variant. A dataflow whose terminal sink is a MetricSink folds its input rows into the process-local MetricsRegistry, where Prometheus scrapes them from the existing /metrics endpoint. This adds no authoring type, no catalog changes, and no user DDL.
The six per-sink health gauges are mz_metric_sink_{frontier_ms,errors, skipped,conflicts,collisions,null_values}, each carrying a sink="" const label.
Testing:
Co-authored by: Moritz Hoffmann antiguru@gmail.com