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

Trace SSL handshakes in netty 4.1 #4604

Merged
merged 3 commits into from
Nov 10, 2021

Conversation

mateuszrzeszutek
Copy link
Member

@mateuszrzeszutek mateuszrzeszutek commented Nov 6, 2021

This PR adds telemetry to netty's SSL handshakes. It only includes netty 4.1 changes -- I'll implement the same thing in netty 4.0 and reactor-netty once this PR is merged.

CC @lmolkova

}
span(3) {
name "SSL handshake"
kind INTERNAL
Copy link
Member

Choose a reason for hiding this comment

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

should RESOLVE, CONNECT and SSL handshake be CLIENT spans? (users would need to enable outgoing-span-suppression-by-type=true, or we could consider making suppression-by-type the default)

sort of related, what do you think of converting the "error-only" spans into span events on the current span? this way those would still get captured even when using the "no nested CLIENT spans" setting

I can create an issue to discuss both of these further since they have broader impact than just this PR

Copy link
Member Author

Choose a reason for hiding this comment

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

I can create an issue to discuss both of these further since they have broader impact than just this PR

Yes, please! There's a lot of things going on here that we could discuss before establishing a "common pattern" for tracing these things.

should RESOLVE, CONNECT and SSL handshake be CLIENT spans?

I think it makes sense for them to be CLIENT spans. I was following the current implementation, which used INTERNAL everywhere though.

users would need to enable outgoing-span-suppression-by-type=true, or we could consider making suppression-by-type the default)

In plain netty the connection phase and actually sending the HTTP request are completely separate; so all those low-level spans are not the children of the CLIENT span. In case of "normal"/higher-level HTTP clients I think it'd make perfect sense for them to be nested under the HTTP CLIENT span.

sort of related, what do you think of converting the "error-only" spans into span events on the current span? this way those would still get captured even when using the "no nested CLIENT spans" setting

Hmm, do we want that in all cases? Or only when nested spans are disabled?
Using spans for these operations (as opposing to events) enables gathering timing and exception information; e.g. you know that SSL handshake took 10 seconds and threw an exception, and it failed before the HTTP request was sent.

Copy link
Member

Choose a reason for hiding this comment

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

👍 created issue to continue discussion #4617

Mateusz Rzeszutek and others added 2 commits November 9, 2021 07:34
…testing/junit/http/HttpClientTestServer.java

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
@trask trask merged commit 4719e4c into open-telemetry:main Nov 10, 2021
@mateuszrzeszutek mateuszrzeszutek deleted the netty-ssl branch November 11, 2021 06:14
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
* Trace SSL handshakes in netty 4.1

* Update testing-common/src/main/java/io/opentelemetry/instrumentation/testing/junit/http/HttpClientTestServer.java

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

* remove unneeded bit of code

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
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