Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
Signed-off-by: Johnny Lim <[email protected]>
  • Loading branch information
izeye committed Jan 30, 2025
1 parent 71d31e3 commit 9d25b5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,14 @@ public KeyValues getLowCardinalityKeyValues(HttpClientContext context) {
return KeyValues.of(
HttpClientObservationDocumentation.LowCardinalityKeys.METHOD.withValue(httpRequest.method()),
HttpClientObservationDocumentation.LowCardinalityKeys.URI
.withValue(getUri(httpRequest, context.getResponse(), context.getUriMapper())),
.withValue(getUri(httpRequest, context.getUriMapper())),
HttpClientObservationDocumentation.LowCardinalityKeys.STATUS
.withValue(getStatus(context.getResponse())),
HttpClientObservationDocumentation.LowCardinalityKeys.OUTCOME
.withValue(getOutcome(context.getResponse())));
}

String getUri(HttpRequest request, @Nullable HttpResponse<?> httpResponse,
Function<HttpRequest, String> uriMapper) {
String getUri(HttpRequest request, Function<HttpRequest, String> uriMapper) {
return uriMapper.apply(request);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ private <T> void stopObservationOrTimer(
instrumentation.stop(DefaultHttpClientObservationConvention.INSTANCE.getName(), "Timer for JDK's HttpClient",
() -> Tags.of(HttpClientObservationDocumentation.LowCardinalityKeys.METHOD.asString(), request.method(),
HttpClientObservationDocumentation.LowCardinalityKeys.URI.asString(),
DefaultHttpClientObservationConvention.INSTANCE.getUri(request, res, uriMapper),
DefaultHttpClientObservationConvention.INSTANCE.getUri(request, uriMapper),
HttpClientObservationDocumentation.LowCardinalityKeys.STATUS.asString(),
DefaultHttpClientObservationConvention.INSTANCE.getStatus(res),
HttpClientObservationDocumentation.LowCardinalityKeys.OUTCOME.asString(),
Expand Down

0 comments on commit 9d25b5e

Please sign in to comment.