Skip to content
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

Test undertow and armeria http2 server #11361

Merged
merged 2 commits into from
May 15, 2024

Conversation

laurit
Copy link
Contributor

@laurit laurit commented May 15, 2024

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.

@laurit laurit requested a review from a team as a code owner May 15, 2024 14:02

public static String normalizeHttpVersion(String version) {
if ("2.0".equals(version)) {
return "2";
Copy link
Contributor Author

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/")) {
Copy link
Contributor Author

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.

Comment on lines -754 to +766
.hasEntrySatisfying(
NetworkAttributes.NETWORK_PROTOCOL_VERSION,
entry -> assertThat(entry).isIn("1.1", "2.0"));
.containsEntry(
NetworkAttributes.NETWORK_PROTOCOL_VERSION, options.useHttp2 ? "2" : "1.1");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice ❤️

@trask trask merged commit defd7cb into open-telemetry:main May 15, 2024
53 checks passed
@laurit laurit deleted the test-http2-server branch May 17, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants