Remove mentions of http.url attribute in server instrumentations
MODIFY
docs/semantic-conventions.md
docs/semantic-conventions.md
@@ -23,10 +23,8 @@ are implemented by Java autoinstrumentation and which ones are not.
| `http.route` | N | - |
| `http.client_ip` | N | + |
-**[1]:** Most server instrumentations capture `http.scheme`, `http.host`, and `http.target`
-(and do not capture `http.url`).
-Netty instrumentation is currently the only exception to this rule. Netty instrumentation
-captures `http.url` (and does not capture `http.scheme`, `http.host`, or `http.target`).
+**[1]:** Server instrumentations capture `http.scheme`, `http.host`, and `http.target` and do not
+capture `http.url`.
**[2]:** In case of Armeria, return values are [SessionProtocol](https://github.com/line/armeria/blob/master/core/src/main/java/com/linecorp/armeria/common/SessionProtocol.java),
not values defined by spec.
@@ -49,7 +47,8 @@ not values defined by spec.
| `http.response_content_length` | N | - |
| `http.response_content_length_uncompressed` | N | - |
-**[1]:** `http.scheme`, `http.host` and `http.target` are unnecessary since `http.url` is captured.
+**[1]:** Client instrumentations capture `http.url` and do not capture `http.scheme`, `http.host`
+and `http.target`.
**[2]:** In case of Armeria, return values are [SessionProtocol](https://github.com/line/armeria/blob/master/core/src/main/java/com/linecorp/armeria/common/SessionProtocol.java),
not values defined by spec.

MODIFY
instrumentation/undertow-1.4/javaagent/src/test/groovy/UndertowServerTest.groovy
instrumentation/undertow-1.4/javaagent/src/test/groovy/UndertowServerTest.groovy
@@ -106,10 +106,7 @@ class UndertowServerTest extends HttpServerTest<Undertow> implements AgentTestTr
@Override
List<AttributeKey<?>> extraAttributes() {
[
- SemanticAttributes.HTTP_HOST,
SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH,
- SemanticAttributes.HTTP_SCHEME,
- SemanticAttributes.HTTP_TARGET,
SemanticAttributes.NET_PEER_NAME,
SemanticAttributes.NET_TRANSPORT
]

MODIFY
testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpServerTest.groovy
testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpServerTest.groovy
@@ -628,15 +628,10 @@ abstract class HttpServerTest<SERVER> extends InstrumentationSpecification imple
"${SemanticAttributes.HTTP_FLAVOR.key}" { it == "1.1" || it == "2.0" }
"${SemanticAttributes.HTTP_USER_AGENT.key}" TEST_USER_AGENT
- if (extraAttributes.contains(SemanticAttributes.HTTP_URL)) {
- // netty instrumentation uses this
- "${SemanticAttributes.HTTP_URL.key}" { it == "${endpoint.resolve(address)}" || it == "${endpoint.resolveWithoutFragment(address)}" }
- } else {
+ "${SemanticAttributes.HTTP_HOST}" { it == "localhost" || it == "localhost:${port}" }
// TODO netty does not set http.scheme - refactor HTTP server tests so that it's possible to specify extracted attributes, like in HTTP client tests
"${SemanticAttributes.HTTP_SCHEME}" { it == "http" || it == null }
- "${SemanticAttributes.HTTP_HOST}" { it == "localhost" || it == "localhost:${port}" }
"${SemanticAttributes.HTTP_TARGET}" endpoint.resolvePath(address).getPath() + "${endpoint == QUERY_PARAM ? "?${endpoint.body}" : ""}"
- }
if (extraAttributes.contains(SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH)) {
"${SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH}" Long
@@ -658,7 +653,7 @@ abstract class HttpServerTest<SERVER> extends InstrumentationSpecification imple
if (extraAttributes.contains(SemanticAttributes.HTTP_SERVER_NAME)) {
"${SemanticAttributes.HTTP_SERVER_NAME}" String
}
- if (endpoint == ServerEndpoint.CAPTURE_HEADERS) {
+ if (endpoint == CAPTURE_HEADERS) {
"http.request.header.x_test_request" { it == ["test"] }
"http.response.header.x_test_response" { it == ["test"] }
}
@@ -688,15 +683,10 @@ abstract class HttpServerTest<SERVER> extends InstrumentationSpecification imple
"${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" TEST_USER_AGENT
- if (extraAttributes.contains(SemanticAttributes.HTTP_URL)) {
- // netty instrumentation uses this
- "${SemanticAttributes.HTTP_URL.key}" endpoint.resolve(address).toString() + "?id=$requestId"
- } else {
- "${SemanticAttributes.HTTP_HOST}" "localhost:${port}"
+ "${SemanticAttributes.HTTP_HOST}" { it == "localhost" || it == "localhost:${port}" }
// TODO netty does not set http.scheme - refactor HTTP server tests so that it's possible to specify extracted attributes, like in HTTP client tests
"${SemanticAttributes.HTTP_SCHEME}" { it == "http" || it == null }
"${SemanticAttributes.HTTP_TARGET}" endpoint.resolvePath(address).getPath() + "?id=$requestId"
- }
if (extraAttributes.contains(SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH)) {
"${SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH}" Long

Remove mentions of http.url attribute in server instrumentations (#4394)