[FLINK-40648][metrics] Do not report a metric whose variables collide into one label name - #29171
Open
MartijnVisser wants to merge 1 commit into
Open
MartijnVisser wants to merge 1 commit into
MartijnVisser wants to merge 1 commit into
Conversation
Collaborator
1 task
… 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)
MartijnVisser
force-pushed
the
FLINK-40648-duplicate-label
branch
from
September 15, 2026 11:48
a46560b to
cd40837
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
Two metric group variables that differ only in characters we replace become one label name. Prometheus then rejects the whole scrape, so one such metric costs us every other metric of that process.
Brief change log
Verifying this change
This change added tests and can be verified as follows:
metricIsNotReportedWhenTwoVariablesSanitiseToTheSameLabelNamefails 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 colliding metric that used to be reported no longer isDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Opus 5)