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

End netty client span before callbacks #7737

Merged
merged 1 commit into from
Feb 6, 2023
Merged

End netty client span before callbacks #7737

merged 1 commit into from
Feb 6, 2023

Conversation

trask
Copy link
Member

@trask trask commented Feb 5, 2023

netty 3.8 already ends client span before callbacks:

if (msg.getMessage() instanceof HttpResponse) {
instrumenter()
.end(
requestAndContexts.context(),
requestAndContexts.request(),
(HttpResponse) msg.getMessage(),
NettyErrorHolder.getOrDefault(requestAndContexts.context(), null));
requestContextsField.set(ctx.getChannel(), null);
}
// We want the callback in the scope of the parent, not the client span
try (Scope ignored = requestAndContexts.parentContext().makeCurrent()) {
ctx.sendUpstream(msg);
}

@trask trask marked this pull request as ready for review February 5, 2023 02:06
@trask trask requested a review from a team February 5, 2023 02:06
@trask trask merged commit b9918ab into open-telemetry:main Feb 6, 2023
@trask trask deleted the netty-end-span-before-callback branch February 6, 2023 16:16
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.

2 participants