adapter: add the first curated metric sinks (sizes and errors) (SQL-556) - #38528
Open
mtabebe wants to merge 1 commit into
Open
adapter: add the first curated metric sinks (sizes and errors) (SQL-556)#38528mtabebe wants to merge 1 commit into
mtabebe wants to merge 1 commit into
Conversation
mtabebe
force-pushed
the
ma/prom-metrics/sql-556-curated-metrics
branch
from
August 27, 2026 18:00
3235c00 to
62b0af0
Compare
mtabebe
force-pushed
the
ma/prom-metrics/sql-556-curated-metrics
branch
from
August 27, 2026 20:10
62b0af0 to
bea5072
Compare
mtabebe
force-pushed
the
ma/prom-metrics/sql-556-curated-metrics
branch
3 times, most recently
from
September 3, 2026 00:49
9d5e103 to
89ca9ec
Compare
Problem: SQL-555 landed the machinery to install curated metric sinks on every replica, but `CURATED` was empty, so nothing ran at boot. Solution: Add the two v1 definitions: `mz_metric_arrangement_sizes` (three gauge families) and `mz_metric_dataflow_errors` (one gauge). Both read the raw `..._raw` logs, not the derived views, which re-aggregate expensively. The sizes sink labels each series with the exported object's `GlobalId`, not the timely dataflow id, which churns across re-renders. A dataflow with no export, like a subscribe, falls back to an `unattributable` bucket so its bytes still count. The errors sink reads the raw log rather than `mz_compute_error_counts` because that view joins in `mz_compute_dependencies`, a storage-managed source that `ensure_reads_only_logs` rejects: reading it would couple the sink's frontier to envd. Elapsed stays out of v1, its log churns continuously and cost 14% of a 2-worker replica even raw-sourced. `curated_definitions_plan` only called `plan_source`, so a definition that broke the log-only contract still passed the test but crash-looped the coordinator at boot. It now runs `ensure_reads_only_logs` too. Testing: - Unit tests plan each definition and run the log-only gate. - metric-sink.td gains a curated section and a multi-cluster, multi-replica section. - metric-sink.td covers both the attributable and `unattributable` id paths. - The MetricSink platform check now asserts the curated sinks survive a boot, which covers restart, upgrade, and zero-downtime. Co-Authored-By: Moritz Hoffmann <antiguru@gmail.com>
mtabebe
force-pushed
the
ma/prom-metrics/sql-556-curated-metrics
branch
from
September 3, 2026 01:29
89ca9ec to
1610837
Compare
mtabebe
marked this pull request as ready for review
September 3, 2026 09:28
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.
SQL-555 landed the machinery to install curated metric sinks on every
replica, but
CURATEDwas empty, so nothing ran at boot.Solution:
Add the two v1 definitions:
mz_metric_arrangement_sizes(three gaugefamilies) and
mz_metric_dataflow_errors(one gauge). Both read the raw..._rawlogs, not the derived views, which re-aggregate expensively.The sizes sink labels each series with the exported object's
GlobalId, not thetimely dataflow id, which churns across re-renders. A dataflow with no export,
like a subscribe, falls back to an
unattributablebucket so its bytes still count.The errors sink reads the raw log rather than
mz_compute_error_countsbecause that view joins in
mz_compute_dependencies, a storage-managedsource that
ensure_reads_only_logsrejects: reading it would couple thesink's frontier to envd. Elapsed stays out of v1, its log churns
continuously and cost 14% of a 2-worker replica even raw-sourced.
curated_definitions_planonly calledplan_source, so a definition thatbroke the log-only contract still passed the test but crash-looped the
coordinator at boot. It now runs
ensure_reads_only_logstoo.Testing:
multi-replica section.
unattributableid paths.which covers restart, upgrade, and zero-downtime.