diff --git a/ext/micrometer/src/main/java/org/glassfish/jersey/micrometer/server/JerseyKeyValues.java b/ext/micrometer/src/main/java/org/glassfish/jersey/micrometer/server/JerseyKeyValues.java index 8e73635132..d8b6c3de96 100644 --- a/ext/micrometer/src/main/java/org/glassfish/jersey/micrometer/server/JerseyKeyValues.java +++ b/ext/micrometer/src/main/java/org/glassfish/jersey/micrometer/server/JerseyKeyValues.java @@ -41,6 +41,9 @@ class JerseyKeyValues { private static final KeyValue URI_ROOT = JerseyObservationDocumentation.JerseyLegacyLowCardinalityTags.URI .withValue("root"); + private static final KeyValue URI_UNKNOWN = JerseyObservationDocumentation.JerseyLegacyLowCardinalityTags.URI + .withValue("UNKNOWN"); + private static final KeyValue EXCEPTION_NONE = JerseyObservationDocumentation.JerseyLegacyLowCardinalityTags.EXCEPTION .withValue("None"); @@ -106,6 +109,9 @@ static KeyValue uri(RequestEvent event) { } } String matchingPattern = JerseyTags.getMatchingPattern(event); + if (matchingPattern == null) { + return URI_UNKNOWN; + } if (matchingPattern.equals("/")) { return URI_ROOT; }