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

Split out :instrumentation:netty:netty-4.1 library #6820

Merged
merged 4 commits into from Oct 10, 2022

Conversation

jack-berg
Copy link
Member

Resolves #6734. Builds on #6811.

@jack-berg jack-berg requested a review from a team as a code owner October 6, 2022 20:01
Comment on lines +156 to +160
} else if (handler
.getClass()
.getName()
.startsWith("io.opentelemetry.instrumentation.netty.")) {
pipeline.removeLast();
Copy link
Member

Choose a reason for hiding this comment

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

it's not clear to me why this is needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was a bit of a thorn in my side. So this instrumentation ensures that when a handler is removed, the associated otel tracing handler is also removed. But in splitting out the netty-4.1 javaagent stuff into a library, the package that the handlers lives in changes from io.opentelemetry.javaagent.instrumentation.netty.* to io.opentelemetry.instrumentation.netty.*.

Copy link
Member

Choose a reason for hiding this comment

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

inside the Java agent, io.opentelemetry.instrumentation.netty.* should be shaded to io.opentelemetry.javaagent.shaded.instrumentation.netty.*

oh! but this string will get correspondingly shaded. ok, makes sense to me now, thx

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 didn't know that shading detects and changes string usage.. That makes sense now that I think about it because I tried to use a matches with a regex instead of startsWith and it wouldn't work.

Copy link
Member

@mateuszrzeszutek mateuszrzeszutek left a comment

Choose a reason for hiding this comment

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

Can you add some tests for the extracted libraries? (the usual AbstractHttpClientTest/AbstractHttpServerTest implementations)
This could be done in another PR -- I suspect it's going to take a couple hundred LOCs to implement that.

@jack-berg
Copy link
Member Author

Can you add some tests for the extracted libraries? (the usual AbstractHttpClientTest/AbstractHttpServerTest implementations) This could be done in another PR -- I suspect it's going to take a couple hundred LOCs to implement that.

Sure I can definitely do that. And happy to do it in a follow up or in this PR. Do you have a preference?

@mateuszrzeszutek
Copy link
Member

Sure I can definitely do that. And happy to do it in a follow up or in this PR. Do you have a preference?

Nah, just do whatever's more comfortable to you.

@trask
Copy link
Member

trask commented Oct 10, 2022

I'm going to merge to make sure this makes it into the release, I'll open an issue to track adding tests

@trask trask merged commit d5aadba into open-telemetry:main Oct 10, 2022
LironKS pushed a commit to helios/opentelemetry-java-instrumentation that referenced this pull request Oct 23, 2022
LironKS pushed a commit to helios/opentelemetry-java-instrumentation that referenced this pull request Oct 31, 2022
LironKS pushed a commit to helios/opentelemetry-java-instrumentation that referenced this pull request Dec 4, 2022
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.

Split out netty library instrumentation
3 participants