Repository navigation
Commit 852d26c
authored
fix(dropwizard5): use locale-independent placeholder keys in GraphiteNamePattern (#2619)
`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
Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>1 parent aee95f5 commit 852d26c
2 files changed
Lines changed: 15 additions & 1 deletion
File tree
- prometheus-metrics-instrumentation-dropwizard5/src
- main/java/io/prometheus/metrics/instrumentation/dropwizard5/labels
- test/java/io/prometheus/metrics/instrumentation/dropwizard5/labels
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
135 | 149 | | |
136 | 150 | | |
137 | 151 | | |
| |||
0 commit comments