Skip to content

fix(dropwizard5): use locale-independent placeholder keys in GraphiteNamePattern - #2619

Merged
zeitlinger merged 1 commit into
prometheus:mainfrom
sharanggupta:graphite-name-pattern-locale
Oct 29, 2026
Merged

zeitlinger merged 1 commit into
prometheus:mainfrom
sharanggupta:graphite-name-pattern-locale

Conversation

@sharanggupta

Copy link
Copy Markdown
Contributor

GraphiteNamePattern.extractParameters builds its placeholder keys with String.format("${%d}", ...), so under a default locale with non-ASCII digits such as ar-EG the first key is ${٠} and CustomLabelMapper leaves ${0} in the mapped name and labels (app_requests_${0}_total instead of app_requests_get_total). This builds the keys with string concatenation, which does not depend on the locale, and also covers the dropwizard module since it uses the same mapper. The new GraphiteNamePatternTest case runs with ar-EG as the default locale and fails without the fix.

@zeitlinger

…NamePattern

extractParameters formatted the "${n}" keys with the default locale, so
under a locale such as ar-EG the keys used Arabic-Indic digits and
CustomLabelMapper left "${0}" unreplaced in mapped names and labels.
Build the keys with string concatenation instead.

Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>

@zeitlinger zeitlinger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@zeitlinger
zeitlinger enabled auto-merge (squash) October 29, 2026 12:04
@zeitlinger
zeitlinger merged commit 852d26c into prometheus:main Oct 29, 2026
18 checks passed
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