Update tests now that netty captures http.scheme (#4807)

This commit is contained in:
Trask Stalnaker 2021-12-06 11:57:33 -08:00 committed by GitHub
parent 28d5b80ecf
commit 32e3deb9cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -117,8 +117,7 @@ abstract class AbstractRatpackRoutesTest extends InstrumentationSpecification {
if (extraAttributes.contains(SemanticAttributes.HTTP_URL)) {
"$SemanticAttributes.HTTP_URL" "http://localhost:${app.bindPort}/${path}"
} else {
// 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_SCHEME" "http"
"$SemanticAttributes.HTTP_HOST" "localhost:${app.bindPort}"
"$SemanticAttributes.HTTP_TARGET" "/$path"
}

View File

@ -666,8 +666,7 @@ abstract class HttpServerTest<SERVER> extends InstrumentationSpecification imple
"$SemanticAttributes.HTTP_USER_AGENT" TEST_USER_AGENT
"$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_SCHEME" "http"
"$SemanticAttributes.HTTP_TARGET" endpoint.resolvePath(address).getPath() + "${endpoint == QUERY_PARAM ? "?${endpoint.body}" : ""}"
if (extraAttributes.contains(SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH)) {