Skip to content

Commit 66c1d47

Browse files
committed
Tag URI as unknown when pattern missing in JerseyKeyValues
This applies the changes from gh-4326 that were made to JerseyTags to JerseyKeyValues.
1 parent f50a507 commit 66c1d47

File tree

1 file changed

+6
-0
lines changed
  • micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jersey/server

1 file changed

+6
-0
lines changed

micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jersey/server/JerseyKeyValues.java

+6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ class JerseyKeyValues {
3838
private static final KeyValue URI_ROOT = JerseyObservationDocumentation.JerseyLegacyLowCardinalityTags.URI
3939
.withValue("root");
4040

41+
private static final KeyValue URI_UNKNOWN = JerseyObservationDocumentation.JerseyLegacyLowCardinalityTags.URI
42+
.withValue("UNKNOWN");
43+
4144
private static final KeyValue EXCEPTION_NONE = JerseyObservationDocumentation.JerseyLegacyLowCardinalityTags.EXCEPTION
4245
.withValue("None");
4346

@@ -93,6 +96,9 @@ static KeyValue uri(RequestEvent event) {
9396
}
9497
}
9598
String matchingPattern = JerseyTags.getMatchingPattern(event);
99+
if (matchingPattern == null) {
100+
return URI_UNKNOWN;
101+
}
96102
if (matchingPattern.equals("/")) {
97103
return URI_ROOT;
98104
}

0 commit comments

Comments
 (0)