Make http.flavor spec compliant
MODIFY
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/HttpServerTracer.java
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/HttpServerTracer.java
@@ -195,6 +195,10 @@ public abstract class HttpServerTracer<REQUEST, RESPONSE, CONNECTION, STORAGE> e
protected void onConnectionAndRequest(Span span, CONNECTION connection, REQUEST request) {
String flavor = flavor(connection, request);
if (flavor != null) {
+ // remove HTTP/ prefix to comply with semantic conventions
+ if (flavor.startsWith("HTTP/")) {
+ flavor = flavor.substring("HTTP/".length());
+ }
span.setAttribute(SemanticAttributes.HTTP_FLAVOR, flavor);
}
span.setAttribute(SemanticAttributes.HTTP_CLIENT_IP, clientIP(connection, request));

MODIFY
instrumentation/apache-camel-2.20/javaagent/src/test/groovy/io/opentelemetry/javaagent/instrumentation/apachecamel/RestCamelTest.groovy
instrumentation/apache-camel-2.20/javaagent/src/test/groovy/io/opentelemetry/javaagent/instrumentation/apachecamel/RestCamelTest.groovy
@@ -91,7 +91,7 @@ class RestCamelTest extends AgentInstrumentationSpecification implements RetryOn
"$SemanticAttributes.HTTP_STATUS_CODE.key" 200
"$SemanticAttributes.HTTP_CLIENT_IP.key" "127.0.0.1"
"$SemanticAttributes.HTTP_USER_AGENT.key" String
- "$SemanticAttributes.HTTP_FLAVOR.key" "HTTP/1.1"
+ "$SemanticAttributes.HTTP_FLAVOR.key" "1.1"
"$SemanticAttributes.HTTP_METHOD.key" "GET"
"$SemanticAttributes.NET_PEER_IP.key" "127.0.0.1"
"$SemanticAttributes.NET_PEER_PORT.key" Long

MODIFY
instrumentation/apache-camel-2.20/javaagent/src/test/groovy/io/opentelemetry/javaagent/instrumentation/apachecamel/TwoServicesWithDirectClientCamelTest.groovy
instrumentation/apache-camel-2.20/javaagent/src/test/groovy/io/opentelemetry/javaagent/instrumentation/apachecamel/TwoServicesWithDirectClientCamelTest.groovy
@@ -128,7 +128,7 @@ class TwoServicesWithDirectClientCamelTest extends AgentInstrumentationSpecifica
"$SemanticAttributes.NET_PEER_PORT.key" Number
"$SemanticAttributes.NET_PEER_IP.key" InetAddress.getLocalHost().getHostAddress().toString()
"$SemanticAttributes.HTTP_USER_AGENT.key" "Jakarta Commons-HttpClient/3.1"
- "$SemanticAttributes.HTTP_FLAVOR.key" "HTTP/1.1"
+ "$SemanticAttributes.HTTP_FLAVOR.key" "1.1"
"$SemanticAttributes.HTTP_CLIENT_IP.key" InetAddress.getLocalHost().getHostAddress().toString()
}

MODIFY
instrumentation/dropwizard-testing/src/test/groovy/DropwizardTest.groovy
instrumentation/dropwizard-testing/src/test/groovy/DropwizardTest.groovy
@@ -104,7 +104,7 @@ class DropwizardTest extends HttpServerTest<DropwizardTestSupport> implements Ag
"${SemanticAttributes.HTTP_URL.key}" { it == "${endpoint.resolve(address)}" || it == "${endpoint.resolveWithoutFragment(address)}" }
"${SemanticAttributes.HTTP_METHOD.key}" method
"${SemanticAttributes.HTTP_STATUS_CODE.key}" endpoint.status
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" TEST_USER_AGENT
"${SemanticAttributes.HTTP_CLIENT_IP.key}" TEST_CLIENT_IP
}

MODIFY
instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsHttpServerTest.groovy
instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-testing/src/main/groovy/JaxRsHttpServerTest.groovy
@@ -189,7 +189,7 @@ abstract class JaxRsHttpServerTest<S> extends HttpServerTest<S> implements Agent
"${SemanticAttributes.HTTP_URL.key}" fullUrl.toString()
"${SemanticAttributes.HTTP_METHOD.key}" method
"${SemanticAttributes.HTTP_STATUS_CODE.key}" statusCode
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" TEST_USER_AGENT
"${SemanticAttributes.HTTP_CLIENT_IP.key}" TEST_CLIENT_IP
}

MODIFY
instrumentation/jsp-2.3/javaagent/src/test/groovy/JspInstrumentationBasicTests.groovy
instrumentation/jsp-2.3/javaagent/src/test/groovy/JspInstrumentationBasicTests.groovy
@@ -94,7 +94,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/$jspWebappContext/$jspFileName"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -153,7 +153,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/$jspWebappContext/getQuery.jsp?$queryString"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -209,7 +209,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/$jspWebappContext/post.jsp"
"${SemanticAttributes.HTTP_METHOD.key}" "POST"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -274,7 +274,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/$jspWebappContext/$jspFileName"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 500
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -344,7 +344,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/$jspWebappContext/includes/includeHtml.jsp"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -401,7 +401,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/$jspWebappContext/includes/includeMulti.jsp"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -498,7 +498,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/$jspWebappContext/$jspFileName"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 500
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -549,7 +549,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/$jspWebappContext/$staticFile"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}

MODIFY
instrumentation/jsp-2.3/javaagent/src/test/groovy/JspInstrumentationForwardTests.groovy
instrumentation/jsp-2.3/javaagent/src/test/groovy/JspInstrumentationForwardTests.groovy
@@ -92,7 +92,7 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/$jspWebappContext/$forwardFromFileName"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -172,7 +172,7 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/$jspWebappContext/forwards/forwardToHtml.jsp"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -229,7 +229,7 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/$jspWebappContext/forwards/forwardToIncludeMulti.jsp"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -350,7 +350,7 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/$jspWebappContext/forwards/forwardToJspForward.jsp"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -449,7 +449,7 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/$jspWebappContext/forwards/forwardToCompileError.jsp"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 500
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -518,7 +518,7 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/$jspWebappContext/forwards/forwardToNonExistent.jsp"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 404
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}

MODIFY
instrumentation/ratpack-1.4/javaagent/src/test/groovy/RatpackOtherTest.groovy
instrumentation/ratpack-1.4/javaagent/src/test/groovy/RatpackOtherTest.groovy
@@ -80,7 +80,7 @@ class RatpackOtherTest extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "${app.address.resolve(path)}"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}

MODIFY
instrumentation/spark-2.3/javaagent/src/test/groovy/SparkJavaBasedTest.groovy
instrumentation/spark-2.3/javaagent/src/test/groovy/SparkJavaBasedTest.groovy
@@ -56,7 +56,7 @@ class SparkJavaBasedTest extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" "http://localhost:$port/param/asdf1234"
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}

MODIFY
instrumentation/spring/README.md
instrumentation/spring/README.md
@@ -773,13 +773,13 @@ SpanWrapper{
delegate=RecordEventsReadableSpan{traceId=TraceId{traceId=52d6edec17bbf842cf5032ebce2043f8}, spanId=SpanId{spanId=57f0106dd1121b54},
parentSpanId=SpanId{spanId=0000000000000000}, name=WebMVCTracingFilter.doFilterInteral, kind=SERVER, attributes={http.status_code=AttributeValueLong{longValue=200},
sampling.probability=AttributeValueDouble{doubleValue=1.0}, net.peer.port=AttributeValueLong{longValue=57578},
-http.user_agent=AttributeValueString{stringValue=PostmanRuntime/7.26.2}, http.flavor=AttributeValueString{stringValue=HTTP/1.1},
+http.user_agent=AttributeValueString{stringValue=PostmanRuntime/7.26.2}, http.flavor=AttributeValueString{stringValue=1.1},
http.url=AttributeValueString{stringValue=/message}, net.peer.ip=AttributeValueString{stringValue=0:0:0:0:0:0:0:1},
http.method=AttributeValueString{stringValue=GET}, http.client_ip=AttributeValueString{stringValue=0:0:0:0:0:0:0:1}},
status=Status{canonicalCode=OK, description=null}, totalRecordedEvents=0, totalRecordedLinks=0, startEpochNanos=1598409410399317331, endEpochNanos=1598409411045782693},
resolvedLinks=[], resolvedEvents=[], attributes={http.status_code=AttributeValueLong{longValue=200}, sampling.probability=AttributeValueDouble{doubleValue=1.0},
net.peer.port=AttributeValueLong{longValue=57578}, http.user_agent=AttributeValueString{stringValue=PostmanRuntime/7.26.2},
-http.flavor=AttributeValueString{stringValue=HTTP/1.1}, http.url=AttributeValueString{stringValue=/message},
+http.flavor=AttributeValueString{stringValue=1.1}, http.url=AttributeValueString{stringValue=/message},
net.peer.ip=AttributeValueString{stringValue=0:0:0:0:0:0:0:1}, http.method=AttributeValueString{stringValue=GET},
http.client_ip=AttributeValueString{stringValue=0:0:0:0:0:0:0:1}}, totalAttributeCount=9, totalRecordedEvents=0,
status=Status{canonicalCode=OK, description=null}, name=WebMVCTracingFilter.doFilterInteral, endEpochNanos=1598409411045782693, hasEnded=true
@@ -803,13 +803,13 @@ SpanWrapper{
delegate=RecordEventsReadableSpan{traceId=TraceId{traceId=52d6edec17bbf842cf5032ebce2043f8}, spanId=SpanId{spanId=b4ae77c523215f9d},
parentSpanId=SpanId{spanId=15b72a8e85c842c5}, name=WebMVCTracingFilter.doFilterInteral, kind=SERVER,
attributes={http.status_code=AttributeValueLong{longValue=200}, net.peer.port=AttributeValueLong{longValue=40174},
-http.user_agent=AttributeValueString{stringValue=Java/11.0.8}, http.flavor=AttributeValueString{stringValue=HTTP/1.1},
+http.user_agent=AttributeValueString{stringValue=Java/11.0.8}, http.flavor=AttributeValueString{stringValue=1.1},
http.url=AttributeValueString{stringValue=/time}, net.peer.ip=AttributeValueString{stringValue=127.0.0.1},
http.method=AttributeValueString{stringValue=GET}, http.client_ip=AttributeValueString{stringValue=127.0.0.1}},
status=Status{canonicalCode=OK, description=null}, totalRecordedEvents=0, totalRecordedLinks=0, startEpochNanos=1598409410680549805,
endEpochNanos=1598409410921631068}, resolvedLinks=[], resolvedEvents=[], attributes={http.status_code=AttributeValueLong{longValue=200},
net.peer.port=AttributeValueLong{longValue=40174}, http.user_agent=AttributeValueString{stringValue=Java/11.0.8},
-http.flavor=AttributeValueString{stringValue=HTTP/1.1}, http.url=AttributeValueString{stringValue=/time},
+http.flavor=AttributeValueString{stringValue=1.1}, http.url=AttributeValueString{stringValue=/time},
net.peer.ip=AttributeValueString{stringValue=127.0.0.1}, http.method=AttributeValueString{stringValue=GET},
http.client_ip=AttributeValueString{stringValue=127.0.0.1}}, totalAttributeCount=8, totalRecordedEvents=0,
status=Status{canonicalCode=OK, description=null}, name=WebMVCTracingFilter.doFilterInteral, endEpochNanos=1598409410921631068, hasEnded=true
@@ -930,7 +930,7 @@ Shown below is the sample trace generated by `MainService` and `TimeService` usi
},
"tags":{
"http.client_ip":"127.0.0.1",
- "http.flavor":"HTTP/1.1",
+ "http.flavor":"1.1",
"http.method":"GET",
"http.status_code":"200",
"http.url":"/time",
@@ -972,7 +972,7 @@ Shown below is the sample trace generated by `MainService` and `TimeService` usi
},
"tags":{
"http.client_ip":"0:0:0:0:0:0:0:1",
- "http.flavor":"HTTP/1.1",
+ "http.flavor":"1.1",
"http.method":"GET",
"http.status_code":"200",
"http.url":"/message",

MODIFY
instrumentation/spring/spring-boot-autoconfigure/README.md
instrumentation/spring/spring-boot-autoconfigure/README.md
@@ -226,7 +226,7 @@ The traces below were exported using Zipkin.
},
"tags":{
"http.client_ip":"0:0:0:0:0:0:0:1",
- "http.flavor":"HTTP/1.1",
+ "http.flavor":"1.1",
"http.method":"GET",
"http.status_code":"200",
"http.url":"/spring-webmvc/sample",

MODIFY
instrumentation/spring/spring-webflux-5.0/javaagent/src/test/groovy/SpringWebfluxTest.groovy
instrumentation/spring/spring-webflux-5.0/javaagent/src/test/groovy/SpringWebfluxTest.groovy
@@ -67,7 +67,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" url
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -133,7 +133,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" url
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -221,7 +221,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" url
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -288,7 +288,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" url
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 404
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -332,7 +332,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" url
"${SemanticAttributes.HTTP_METHOD.key}" "POST"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 202
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -381,7 +381,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" url
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 500
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -447,7 +447,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" url
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 307
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -476,7 +476,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" finalUrl
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}
@@ -520,7 +520,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" url
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}

MODIFY
instrumentation/spring/spring-webmvc-3.1/javaagent/src/test/groovy/test/boot/SpringBootBasedTest.groovy
instrumentation/spring/spring-webmvc-3.1/javaagent/src/test/groovy/test/boot/SpringBootBasedTest.groovy
@@ -206,7 +206,7 @@ class SpringBootBasedTest extends HttpServerTest<ConfigurableApplicationContext>
"${SemanticAttributes.HTTP_URL.key}" { it == "${endpoint.resolve(address)}" || it == "${endpoint.resolveWithoutFragment(address)}" }
"${SemanticAttributes.HTTP_METHOD.key}" method
"${SemanticAttributes.HTTP_STATUS_CODE.key}" endpoint.status
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" TEST_USER_AGENT
"${SemanticAttributes.HTTP_CLIENT_IP.key}" TEST_CLIENT_IP
}

MODIFY
instrumentation/vertx-reactive-3.5/javaagent/src/test/groovy/VertxReactivePropagationTest.groovy
instrumentation/vertx-reactive-3.5/javaagent/src/test/groovy/VertxReactivePropagationTest.groovy
@@ -61,7 +61,7 @@ class VertxReactivePropagationTest extends AgentInstrumentationSpecification {
"${SemanticAttributes.HTTP_URL.key}" url
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" String
"${SemanticAttributes.HTTP_CLIENT_IP.key}" "127.0.0.1"
}

MODIFY
smoke-tests/src/test/groovy/io/opentelemetry/smoketest/AppServerTest.groovy
smoke-tests/src/test/groovy/io/opentelemetry/smoketest/AppServerTest.groovy
@@ -83,6 +83,9 @@ abstract class AppServerTest extends SmokeTest {
and: "Client and server spans for the remote call"
traces.countFilteredAttributes("http.url", "http://localhost:8080/app/headers") == 2
+ and: "Number of spans with http protocol version"
+ traces.countFilteredAttributes("http.flavor", "1.1") == 3
+
and: "Number of spans tagged with current otel library version"
traces.countFilteredResourceAttributes("telemetry.auto.version", currentAgentVersion) == 3
@@ -212,6 +215,9 @@ abstract class AppServerTest extends SmokeTest {
and: "The span for the initial web request"
traces.countFilteredAttributes("http.url", url) == 1
+ and: "Number of spans with http protocol version"
+ traces.countFilteredAttributes("http.flavor", "1.1") == 1
+
and: "Number of spans tagged with current otel library version"
traces.countFilteredResourceAttributes("telemetry.auto.version", currentAgentVersion) == traces.countSpans()
@@ -301,6 +307,9 @@ abstract class AppServerTest extends SmokeTest {
and: "The span for the initial web request"
traces.countFilteredAttributes("http.url", url) == 1
+ and: "Number of spans with http protocol version"
+ traces.countFilteredAttributes("http.flavor", "1.1") == 1
+
and: "Number of spans tagged with current otel library version"
traces.countFilteredResourceAttributes("telemetry.auto.version", currentAgentVersion) == traces.countSpans()
@@ -350,6 +359,9 @@ abstract class AppServerTest extends SmokeTest {
and: "Client and server spans for the remote call"
traces.countFilteredAttributes("http.url", "http://localhost:8080/app/headers") == 2
+ and: "Number of spans with http protocol version"
+ traces.countFilteredAttributes("http.flavor", "1.1") == 3
+
and: "Number of spans tagged with current otel library version"
traces.countFilteredResourceAttributes("telemetry.auto.version", currentAgentVersion) == 3

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
@@ -499,7 +499,7 @@ abstract class HttpServerTest<SERVER> extends InstrumentationSpecification imple
"${SemanticAttributes.HTTP_URL.key}" { it == "${endpoint.resolve(address)}" || it == "${endpoint.resolveWithoutFragment(address)}" }
"${SemanticAttributes.HTTP_METHOD.key}" method
"${SemanticAttributes.HTTP_STATUS_CODE.key}" endpoint.status
- "${SemanticAttributes.HTTP_FLAVOR.key}" "HTTP/1.1"
+ "${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
"${SemanticAttributes.HTTP_USER_AGENT.key}" TEST_USER_AGENT
}
}

Make http.flavor spec compliant (#2370)