Change keyvalue name to http.url in server observations
This commit changes the new high cardinality key value from "uri.expanded" to "http.url" in order to align with the OTel specification, since there is no need for backwards compatibility on this new metadata. Closes gh-29254
This commit is contained in:
@@ -113,10 +113,10 @@ public enum ClientObservation implements DocumentedObservation {
|
||||
/**
|
||||
* HTTP request URI.
|
||||
*/
|
||||
URI_EXPANDED {
|
||||
HTTP_URL {
|
||||
@Override
|
||||
public String asString() {
|
||||
return "uri.expanded";
|
||||
return "http.url";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public class DefaultClientObservationConvention implements ClientObservationConv
|
||||
|
||||
private static final KeyValue EXCEPTION_NONE = KeyValue.of(ClientObservation.LowCardinalityKeyNames.EXCEPTION, "none");
|
||||
|
||||
private static final KeyValue URI_EXPANDED_NONE = KeyValue.of(ClientHttpObservation.HighCardinalityKeyNames.URI_EXPANDED, "none");
|
||||
private static final KeyValue URI_EXPANDED_NONE = KeyValue.of(ClientHttpObservation.HighCardinalityKeyNames.HTTP_URL, "none");
|
||||
|
||||
private static final KeyValue CLIENT_NAME_NONE = KeyValue.of(ClientHttpObservation.HighCardinalityKeyNames.CLIENT_NAME, "none");
|
||||
|
||||
@@ -140,7 +140,7 @@ public class DefaultClientObservationConvention implements ClientObservationConv
|
||||
|
||||
protected KeyValue uriExpanded(ClientObservationContext context) {
|
||||
if (context.getCarrier() != null) {
|
||||
return KeyValue.of(ClientObservation.HighCardinalityKeyNames.URI_EXPANDED, context.getCarrier().url().toASCIIString());
|
||||
return KeyValue.of(ClientObservation.HighCardinalityKeyNames.HTTP_URL, context.getCarrier().url().toASCIIString());
|
||||
}
|
||||
return URI_EXPANDED_NONE;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ class DefaultClientObservationConventionTests {
|
||||
.contains(KeyValue.of("method", "none"), KeyValue.of("uri", "none"), KeyValue.of("status", "CLIENT_ERROR"),
|
||||
KeyValue.of("exception", "none"), KeyValue.of("outcome", "UNKNOWN"));
|
||||
assertThat(this.observationConvention.getHighCardinalityKeyValues(context)).hasSize(2)
|
||||
.contains(KeyValue.of("client.name", "none"), KeyValue.of("uri.expanded", "none"));
|
||||
.contains(KeyValue.of("client.name", "none"), KeyValue.of("http.url", "none"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -72,7 +72,7 @@ class DefaultClientObservationConventionTests {
|
||||
.contains(KeyValue.of("method", "none"), KeyValue.of("uri", "none"), KeyValue.of("status", "CLIENT_ERROR"),
|
||||
KeyValue.of("exception", "IllegalStateException"), KeyValue.of("outcome", "UNKNOWN"));
|
||||
assertThat(this.observationConvention.getHighCardinalityKeyValues(context)).hasSize(2)
|
||||
.contains(KeyValue.of("client.name", "none"), KeyValue.of("uri.expanded", "none"));
|
||||
.contains(KeyValue.of("client.name", "none"), KeyValue.of("http.url", "none"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -85,7 +85,7 @@ class DefaultClientObservationConventionTests {
|
||||
.contains(KeyValue.of("exception", "none"), KeyValue.of("method", "GET"), KeyValue.of("uri", "/resource/{id}"),
|
||||
KeyValue.of("status", "200"), KeyValue.of("outcome", "SUCCESS"));
|
||||
assertThat(this.observationConvention.getHighCardinalityKeyValues(context)).hasSize(2)
|
||||
.contains(KeyValue.of("client.name", "none"), KeyValue.of("uri.expanded", "/resource/42"));
|
||||
.contains(KeyValue.of("client.name", "none"), KeyValue.of("http.url", "/resource/42"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -93,7 +93,7 @@ class DefaultClientObservationConventionTests {
|
||||
ClientObservationContext context = createContext(ClientRequest.create(HttpMethod.GET, URI.create("/resource/42")).build());
|
||||
assertThat(this.observationConvention.getLowCardinalityKeyValues(context))
|
||||
.contains(KeyValue.of("method", "GET"), KeyValue.of("uri", "none"));
|
||||
assertThat(this.observationConvention.getHighCardinalityKeyValues(context)).hasSize(2).contains(KeyValue.of("uri.expanded", "/resource/42"));
|
||||
assertThat(this.observationConvention.getHighCardinalityKeyValues(context)).hasSize(2).contains(KeyValue.of("http.url", "/resource/42"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user