Fix wrong uri tag for client observation convention

Prior to this commit, a client sending a request to
"https://example.org" would record the wrong URI tag as
"/https://example.org".

This commit ensures that the scheme+host part is matched correctly in
the default client observation conventions.

See gh-33867
This commit is contained in:
ZLATAN628 2024-11-11 13:49:43 +08:00 committed by Brian Clozel
parent f06853a339
commit 5666e363d1
2 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ public class DefaultClientRequestObservationConvention implements ClientRequestO
private static final String DEFAULT_NAME = "http.client.requests";
private static final Pattern PATTERN_BEFORE_PATH = Pattern.compile("^https?://[^/]+/");
private static final Pattern PATTERN_BEFORE_PATH = Pattern.compile("^https?://[^/]+/?");
private static final KeyValue URI_NONE = KeyValue.of(LowCardinalityKeyNames.URI, KeyValue.NONE_VALUE);

View File

@ -43,7 +43,7 @@ public class DefaultClientRequestObservationConvention implements ClientRequestO
private static final String ROOT_PATH = "/";
private static final Pattern PATTERN_BEFORE_PATH = Pattern.compile("^https?://[^/]+/");
private static final Pattern PATTERN_BEFORE_PATH = Pattern.compile("^https?://[^/]+/?");
private static final KeyValue URI_NONE = KeyValue.of(LowCardinalityKeyNames.URI, KeyValue.NONE_VALUE);