Skip to content

Commit 32e3deb

Browse files
authored
Update tests now that netty captures http.scheme (#4807)
1 parent 28d5b80 commit 32e3deb

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

instrumentation/ratpack-1.4/testing/src/main/groovy/io/opentelemetry/instrumentation/ratpack/server/AbstractRatpackRoutesTest.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ abstract class AbstractRatpackRoutesTest extends InstrumentationSpecification {
117117
if (extraAttributes.contains(SemanticAttributes.HTTP_URL)) {
118118
"$SemanticAttributes.HTTP_URL" "http://localhost:${app.bindPort}/${path}"
119119
} else {
120-
// 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
121-
"$SemanticAttributes.HTTP_SCHEME" { it == "http" || it == null }
120+
"$SemanticAttributes.HTTP_SCHEME" "http"
122121
"$SemanticAttributes.HTTP_HOST" "localhost:${app.bindPort}"
123122
"$SemanticAttributes.HTTP_TARGET" "/$path"
124123
}

testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpServerTest.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,7 @@ abstract class HttpServerTest<SERVER> extends InstrumentationSpecification imple
666666
"$SemanticAttributes.HTTP_USER_AGENT" TEST_USER_AGENT
667667

668668
"$SemanticAttributes.HTTP_HOST" { it == "localhost" || it == "localhost:${port}" }
669-
// 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
670-
"$SemanticAttributes.HTTP_SCHEME" { it == "http" || it == null }
669+
"$SemanticAttributes.HTTP_SCHEME" "http"
671670
"$SemanticAttributes.HTTP_TARGET" endpoint.resolvePath(address).getPath() + "${endpoint == QUERY_PARAM ? "?${endpoint.body}" : ""}"
672671

673672
if (extraAttributes.contains(SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH)) {

0 commit comments

Comments
 (0)