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

Add option to create span on new netty connection #3707

Merged
merged 8 commits into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add comment
  • Loading branch information
laurit committed Jul 28, 2021
commit 4b6195c120f7e28e1cee7c4d9c668d93244bcc01
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ public void endConnectionSpan(
Channel channel,
Throwable throwable) {
if (context != null) {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: using alwaysCreateConnectSpan will probably allow JIT to skip the else part easily when that property is true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added alwaysCreateConnectSpan check, though I suspect that it won't change much for jit as I believe it speculatively removes branches that have not executed anyway.

// if context is present we started span in startConnectionSpan
endConnectionSpan(context, channel, throwable);
} else if (throwable != null && shouldStartSpan(parentContext, CLIENT)) {
iNikem marked this conversation as resolved.
Show resolved Hide resolved
// if we didn't start span in startConnectionSpan create a span only when the request fails
// and when not inside a client span
connectionFailure(parentContext, remoteAddress, channel, throwable);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ public void endConnectionSpan(
Channel channel,
Throwable throwable) {
if (context != null) {
// if context is present we started span in startConnectionSpan
endConnectionSpan(context, channel, throwable);
} else if (throwable != null && shouldStartSpan(parentContext, CLIENT)) {
// if we didn't start span in startConnectionSpan create a span only when the request fails
// and when not inside a client span
connectionFailure(parentContext, remoteAddress, channel, throwable);
}
}
Expand Down