Skip to content

Commit 4a6495a

Browse files
authored
Allow metric names with only a single character (prometheus#951)
Signed-off-by: Fabian Stäber <fabian@fstab.de>
1 parent fe02245 commit 4a6495a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/PrometheusNaming.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class PrometheusNaming {
1313
/**
1414
* Legal characters for metric names, including dot.
1515
*/
16-
private static final Pattern METRIC_NAME_PATTERN = Pattern.compile("^[a-zA-Z_.:][a-zA-Z0-9_.:]+$");
16+
private static final Pattern METRIC_NAME_PATTERN = Pattern.compile("^[a-zA-Z_.:][a-zA-Z0-9_.:]*$");
1717

1818
/**
1919
* Legal characters for label names, including dot.

0 commit comments

Comments
 (0)