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

Implement HTTP resend spec for Reactor Netty (excl CONNECT spans) #8111

Merged

Conversation

mateuszrzeszutek
Copy link
Member

Part of #5722

Similar to #7652, it implements the resend spec in Reactor Netty. This PR does not include the connection error span implementation, since that requires some changes in the Netty instrumentation as well. It does prepare the code for the connection error changes though -- I'll just add them in a separate PR (based on this one) to make things easier to read.

@mateuszrzeszutek mateuszrzeszutek requested a review from a team March 22, 2023 15:17
Comment on lines +117 to 126
if (HttpClientResend.get(instrumentationContexts.getParentContext()) == 0) {
// TODO: emit connection error span

// FIXME: this branch requires lots of changes around the NettyConnectionInstrumenter
// currently it also creates that connection error span (when the connection telemetry is
// turned off), but without HTTP semantics - it does not have access to any HTTP information
// after all
// it should be possible to completely disable it, and just start and end the span here
// this requires lots of refactoring and pretty uninteresting changes in the netty code, so
// I'll do that in a separate PR - for better readability
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Here's where the connection span will be added -- similar to the ConnectionErrorSpanInterceptor in the OkHttp instrumentation, it's only emitted on error and when there were no HTTP requests made.

@mateuszrzeszutek
Copy link
Member Author

@open-telemetry/java-instrumentation-approvers please review this PR 🙏

Copy link
Contributor

@breedx-splk breedx-splk left a comment

Choose a reason for hiding this comment

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

Looks good to me. A few small nits, otherwise looking good. Not having the error span in there makes the state a little weird, but I definitely prefer this incremental work. 👍🏻

@@ -78,6 +78,12 @@ public final void waitAndAssertSortedTraces(
waitAndAssertTraces(traceComparator, Arrays.asList(assertions), true);
}

public final void waitAndAssertSortedTraces(
Copy link
Contributor

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

Comment on lines +114 to +116
equalTo(SemanticAttributes.USER_AGENT_ORIGINAL, USER_AGENT),
equalTo(SemanticAttributes.HTTP_STATUS_CODE, 200),
equalTo(SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH, 0),
Copy link
Member

Choose a reason for hiding this comment

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

nice

Comment on lines +112 to +114
// TODO: remove this test altogether? this scenario is (was) only implemented in reactor-netty,
// all other HTTP clients worked in a different way
// optionsBuilder.enableTestCallbackWithImplicitParent();
Copy link
Member

Choose a reason for hiding this comment

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

👍

Comment on lines +18 to +19
public String getUrlFull(HttpClientRequest request) {
return request.resourceUrl();
Copy link
Member

Choose a reason for hiding this comment

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

so much better 😅

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.

3 participants