[FLINK-32649][metrics] Do not report a metric whose variables differ from an earlier metric of the same name - #29172
Open
MartijnVisser wants to merge 2 commits into
Open
MartijnVisser wants to merge 2 commits into
MartijnVisser wants to merge 2 commits into
Conversation
Collaborator
… into one label name Two metric group variables that differ only in characters the filter replaces become the same label name. Prometheus rejects such a body and abandons the whole scrape, so reporting the metric costs every other metric of the process. Removal has to tolerate a metric that was never registered. Generated-by: Claude Code (Claude Opus 5)
…from an earlier metric of the same name A collector is stored under the scoped metric name alone, so a metric whose variables differ from the first one registered reuses it and its values are published under the other metric's label names. Generated-by: Claude Code (Claude Opus 5)
MartijnVisser
force-pushed
the
FLINK-32649-label-binding
branch
from
September 15, 2026 11:48
17294dd to
0140aaf
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.
What is the purpose of the change
We store a collector under the metric name alone, so a metric whose variables differ from the first of that name reuses it and its values go out under the wrong label names. Depends on #29171.
Brief change log
Verifying this change
This change added tests and can be verified as follows:
metricIsNotReportedWhenItsVariablesDifferFromAnEarlierMetricOfTheSameNamefails before this change and passes after itDoes this pull request potentially affect one of the following parts:
@Public(Evolving): yes,AbstractPrometheusReporteris@PublicEvolving. No signature changes, but a mismatching metric that used to be reported under the wrong label names no longer isDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Opus 5)