Skip to content

Commit

Permalink
Polish "Jetty Client instrumentation with Observation API" (#3659)
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye authored Feb 21, 2023
1 parent d149f09 commit 4884ec8
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 VMware, Inc.
* Copyright 2023 VMware, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 VMware, Inc.
* Copyright 2023 VMware, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 VMware, Inc.
* Copyright 2023 VMware, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -49,7 +49,7 @@ public final class JettyClientKeyValues {

private static final KeyValue HOST_UNKNOWN = KeyValue.of("host", "UNKNOWN");

public static final KeyValue STATUS_UNKNOWN = KeyValue.of("status", "UNKNOWN");
private static final KeyValue STATUS_UNKNOWN = KeyValue.of("status", "UNKNOWN");

private static final Pattern TRAILING_SLASH_PATTERN = Pattern.compile("/$");

Expand All @@ -75,7 +75,6 @@ public static KeyValue method(Request request) {
* {@code request}.
* @param request the request
* @return the host KeyValue derived from request
* @since 1.7.0
*/
public static KeyValue host(Request request) {
return (request != null) ? KeyValue.of("host", request.getHost()) : HOST_UNKNOWN;
Expand All @@ -94,9 +93,10 @@ public static KeyValue status(@Nullable Result result) {
/**
* Creates a {@code uri} KeyValue based on the URI of the given {@code result}.
* {@code REDIRECTION} for 3xx responses, {@code NOT_FOUND} for 404 responses.
* @param request the request
* @param result the request result
* @param successfulUriPattern successful URI pattern
* @return the uri KeyValue derived from the request result
* @return the uri KeyValue derived from the request and its result
*/
public static KeyValue uri(Request request, @Nullable Result result,
BiFunction<Request, Result, String> successfulUriPattern) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public class JettyClientMetrics implements Request.Listener {
private final BiFunction<Request, Result, String> uriPatternFunction;

/**
* @deprecated use {@link JettyClientMetrics#builder(MeterRegistry, BiFunction)}
* instead.
* @deprecated since 1.11.0 in favor of
* {@link JettyClientMetrics#builder(MeterRegistry, BiFunction)}
*/
@Deprecated
protected JettyClientMetrics(MeterRegistry registry, JettyClientTagsProvider tagsProvider, String timingMetricName,
Expand Down Expand Up @@ -121,7 +121,7 @@ public void onQueued(Request request) {
* @param registry meter registry to use
* @param tagsProvider tags provider for customizing tagging
* @return builder
* @deprecated use {@link #builder(MeterRegistry, BiFunction)} instead;
* @deprecated since 1.11.0 in favor of {@link #builder(MeterRegistry, BiFunction)};
* {@link Builder#tagsProvider(JettyClientTagsProvider)} can be used to provide a
* custom tags provider
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 VMware, Inc.
* Copyright 2023 VMware, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ default Iterable<Tag> httpRequestTags(Result result) {
* that goes to a certain endpoint, regardless of the parameters to that endpoint.
* @param result The result which also contains the original request.
* @return A URI pattern with path variables and query parameter unsubstituted.
* @deprecated use {@link JettyClientMetrics#builder(MeterRegistry, BiFunction)}
* instead to configure the uri pattern function
* @deprecated since 1.11.0 in favor of
* {@link JettyClientMetrics#builder(MeterRegistry, BiFunction)} to configure the uri
* pattern function
*/
@Deprecated
String uriPattern(Result result);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 VMware, Inc.
* Copyright 2023 VMware, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 4884ec8

Please sign in to comment.