Skip to content

Commit

Permalink
Tag URI as unknown when pattern missing in JerseyKeyValues
Browse files Browse the repository at this point in the history
This applies the changes from gh-4326 that were made to JerseyTags to JerseyKeyValues.
  • Loading branch information
shakuzen committed Mar 4, 2024
1 parent f50a507 commit 66c1d47
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,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");

Expand Down Expand Up @@ -93,6 +96,9 @@ static KeyValue uri(RequestEvent event) {
}
}
String matchingPattern = JerseyTags.getMatchingPattern(event);
if (matchingPattern == null) {
return URI_UNKNOWN;
}
if (matchingPattern.equals("/")) {
return URI_ROOT;
}
Expand Down

0 comments on commit 66c1d47

Please sign in to comment.