Skip to content

persist: keep per-shard series that match an enable regex - #39601

Merged
mtabebe merged 1 commit into
MaterializeInc:mainfrom
mtabebe:michaelabebe/per-103-persist-enable-regex
Oct 7, 2026
Merged

mtabebe merged 1 commit into
MaterializeInc:mainfrom
mtabebe:michaelabebe/per-103-persist-enable-regex

Conversation

@mtabebe

@mtabebe mtabebe commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem

When persist_shard_metrics leaves out the per-shard families (the summary and none modes), we lose the per-shard drill-down that we might need.

E.g., mz_persist_shard_update_count{name=$source}.

The aggregates show how bad things are and the heaviest hitter but not all the metrics for one shard. However, turning per-shard series back on for the whole environment would bring the cardinality problem right back.

Solution

Add persist_per_shard_metrics_enable_regex, if the regex isn't empty it keeps the series whose shard or name label matches, and drops the rest.

Testing

New tests check that matching a shard id brings back exactly that shard's series in all 28 families, identical to the ones in the both mode, and that matching by name and by an alternation keeps exactly the matched shards. They also check that an empty regex keeps none, and that an unanchored pattern over-matches as documented: it keeps every name it is a substring of, and a fragment of one shard's id also keeps shards whose name contains it

Closes: PER-103

Problem

When persist_shard_metrics leaves out the per-shard families (the
summary and none modes), we lose the per-shard drill-down
that we might need.

E.g., mz_persist_shard_update_count{name=$source}.

The aggregates show how bad things are and the heaviest hitter but not
all the metrics for one shard. However, turning per-shard series back on
for the whole environment would bring the cardinality problem right back.

Solution

Add persist_per_shard_metrics_enable_regex, if the regex isn't empty
it keeps the series whose shard or name label matches, and drops the rest.

Testing

New tests check that matching a shard id brings back exactly that
shard's series in all 28 families, identical to the ones in the both
mode, and that matching by name and by an alternation keeps exactly
the matched shards. They also check that an empty regex keeps none, and
that an unanchored pattern over-matches as documented: it keeps every
name it is a substring of, and a fragment of one shard's id also keeps
shards whose name contains it

Closes: PER-103
@mtabebe

mtabebe commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Last in the stack: #39354

@mtabebe
mtabebe requested a review from Alphadelta14 October 6, 2026 23:32
@mtabebe
mtabebe marked this pull request as ready for review October 6, 2026 23:33
@mtabebe
mtabebe requested review from a team as code owners October 6, 2026 23:33
@mtabebe
mtabebe merged commit a6733d9 into MaterializeInc:main Oct 7, 2026
88 checks passed
@bosconi bosconi mentioned this pull request Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants