-
Notifications
You must be signed in to change notification settings - Fork 768
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
Conversation
...entelemetry/instrumentation/netty/v4_1/internal/client/HttpClientResponseTracingHandler.java
Show resolved
Hide resolved
...c/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4_1/NettyClientSingletons.java
Show resolved
Hide resolved
...c/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4_1/NettyServerSingletons.java
Show resolved
Hide resolved
} else if (handler | ||
.getClass() | ||
.getName() | ||
.startsWith("io.opentelemetry.instrumentation.netty.")) { | ||
pipeline.removeLast(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.*
.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
...y/src/main/java/io/opentelemetry/instrumentation/netty/v4_1/NettyClientTelemetryBuilder.java
Outdated
Show resolved
Hide resolved
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. |
I'm going to merge to make sure this makes it into the release, I'll open an issue to track adding tests |
Resolves #6734. Builds on #6811.