-
Notifications
You must be signed in to change notification settings - Fork 944
Test undertow and armeria http2 server #11361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
public static String normalizeHttpVersion(String version) { | ||
if ("2.0".equals(version)) { | ||
return "2"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
public static String getVersion(@Nullable String protocol) { | ||
if (protocol != null && protocol.startsWith("HTTP/")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I extracted an util class because this same pattern is used in many instrumentations and all of them probably report http2 version as 2.0
instead of 2
.
testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpServerTest.groovy
Show resolved
Hide resolved
.hasEntrySatisfying( | ||
NetworkAttributes.NETWORK_PROTOCOL_VERSION, | ||
entry -> assertThat(entry).isIn("1.1", "2.0")); | ||
.containsEntry( | ||
NetworkAttributes.NETWORK_PROTOCOL_VERSION, options.useHttp2 ? "2" : "1.1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice ❤️
This PR adds http2 server tests for armeria and undertow. It also fixes a bug in undertow instrumentation where
HttpServerResponseMutator
didn't work in undertow with http2.