Skip to content

Commit 73337c1

Browse files
Simplify regex
Co-authored-by: Jay DeLuca <jaydeluca4@gmail.com> Signed-off-by: Liam Clarke-Hutchinson <liam@steelsky.co.nz>
1 parent 6746915 commit 73337c1

File tree

1 file changed

+1
-1
lines changed
  • prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/labels

1 file changed

+1
-1
lines changed

prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/MapperConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
public final class MapperConfig {
1919
// Each part of the metric name between dots. Accepts letters, digits, underscores, hyphens,
2020
// colons, and glob wildcards (*) to support a broad range of metric naming conventions.
21-
private static final String METRIC_PART_REGEX = "[a-zA-Z_0-9*][a-zA-Z0-9_:\\-*]*";
21+
private static final String METRIC_PART_REGEX = "[a-zA-Z_0-9*][a-zA-Z0-9_:*-]*";
2222
// Simplified GLOB: accepts single-level names, dot-separated names, and glob patterns with '*'.
2323
// The pattern requires at least one non-empty segment and does not allow empty segments (double
2424
// dots) or empty/whitespace-only strings. The '**' glob is rejected separately in validateMatch.

0 commit comments

Comments
 (0)