-
Notifications
You must be signed in to change notification settings - Fork 866
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 agent instrumentation for Ratpack 1.7+ #12572
Conversation
cdbef3f
to
9e0c64a
Compare
These tests run locally and the test error seems to be occurring in any PR that is triggering a run of the test partitions (see https://github.com/open-telemetry/opentelemetry-java-instrumentation/actions/runs/11629696246/job/32387158964?pr=12553) and not loading from cache. Not sure what to do with this since it doesn't appear to be related to this change. |
@laurit Thanks, can you send which test fails for you and which gradle command you are running?
Can you explain why you think I should do that? I would expect in a ratpack 1.7 application, that the 1.4 instrumentation is there and it's critical for passing along the OTEL context information through ratpack's async model. |
0a9215b
to
b70e529
Compare
It fails for me. Try running
Our tests are set up so that we test with the earliest version, which is also the version in the module name, and with the latest version |
This adds instrumentation that only works starting in ratpack 1.6 because of methods that were introduced to allow HttpClient interception. All the server side instrumentation from 1.4 works fine in later versions. All this change really does is add ratpack level instrumentation for http client calls instead of netty level (which causes supression).
Yeah, this all passes for me. I'm running with OpenJDK Termurin 17. |
I checked and (btw a couple of the latest CI failures outside of the ratpack module are due to #12579 which will get cleared up if you rebase) |
Figured this out - I had disabled the shadow relocation so I could debug the instrumentation. Reenabling it causes the failure. I'll find some time to work out the issues. |
So I suspect the issue is that in the test class, I'm not working with the shaded versions of some of these classes - https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/12572/files#diff-0a231ce184aa699e90d480be72001173b246f78a2104827ae473df46f9a6595dR37 Any suggestions on the idiomatic way to do this? In an actual Ratpack app, the ExecInitializer gets bound into the server's registry when it's built, but in these tests, we're using the Ratpack |
4a71280
to
6e420d4
Compare
Got this all working now and the tests pass. I had to change a bit of the instrumentation to make it work consistently with with |
26e1bf3
to
093aeaa
Compare
...va/io/opentelemetry/javaagent/instrumentation/ratpack/v1_7/RatpackInstrumentationModule.java
Outdated
Show resolved
Hide resolved
...src/main/java/io/opentelemetry/javaagent/instrumentation/ratpack/v1_7/RatpackSingletons.java
Outdated
Show resolved
Hide resolved
...src/main/java/io/opentelemetry/javaagent/instrumentation/ratpack/v1_7/DownstreamWrapper.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/opentelemetry/instrumentation/ratpack/v1_7/OpenTelemetryExecInitializer.java
Show resolved
Hide resolved
...rc/main/java/io/opentelemetry/instrumentation/ratpack/v1_7/OpenTelemetryExecInterceptor.java
Show resolved
Hide resolved
...ary/src/main/java/io/opentelemetry/instrumentation/ratpack/v1_7/RatpackTelemetryBuilder.java
Outdated
Show resolved
Hide resolved
c7e5d8b
to
0009c4f
Compare
@laurit updated with your feedback and rebase on the recent release. |
...a/io/opentelemetry/javaagent/instrumentation/ratpack/v1_7/ServerRegistryInstrumentation.java
Outdated
Show resolved
Hide resolved
...java/io/opentelemetry/instrumentation/ratpack/v1_7/internal/RatpackHttpAttributesGetter.java
Outdated
Show resolved
Hide resolved
...rary/src/main/java/io/opentelemetry/instrumentation/ratpack/v1_7/internal/RatpackGetter.java
Outdated
Show resolved
Hide resolved
...o/opentelemetry/instrumentation/ratpack/v1_7/internal/RatpackHttpClientAttributesGetter.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/opentelemetry/instrumentation/ratpack/v1_7/internal/RequestHeaderSetter.java
Show resolved
Hide resolved
...ava/io/opentelemetry/javaagent/instrumentation/ratpack/v1_7/RatpackPooledHttpClientTest.java
Outdated
Show resolved
Hide resolved
Pushed changes from review. Test failures don't appear to be related to this change. |
...src/main/java/io/opentelemetry/javaagent/instrumentation/ratpack/v1_7/RatpackSingletons.java
Outdated
Show resolved
Hide resolved
...pentelemetry/javaagent/instrumentation/ratpack/v1_7/RequestActionSupportInstrumentation.java
Outdated
Show resolved
Hide resolved
...telemetry/instrumentation/ratpack/v1_7/internal/RatpackClientInstrumenterBuilderFactory.java
Outdated
Show resolved
Hide resolved
...telemetry/instrumentation/ratpack/v1_7/internal/RatpackServerInstrumenterBuilderFactory.java
Outdated
Show resolved
Hide resolved
...ava/io/opentelemetry/javaagent/instrumentation/ratpack/v1_7/RatpackForkedHttpClientTest.java
Outdated
Show resolved
Hide resolved
336ba6e
to
55aa9c5
Compare
55aa9c5
to
6ad7e61
Compare
import org.junit.jupiter.api.condition.OS; | ||
import ratpack.http.client.HttpClientReadTimeoutException; | ||
|
||
public final class RatpackTestSingletons { |
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.
since this class doesn't really contain any singletons it might be more appropriate to call it RatpackTesUtil
Implements agent based instrumentation for ratpack 1.7+ including http client instrumentation.