Remove Java OTel SDK injection #987
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The code when donated had support for experimental dynamic injection of the OTel Java SDK, since we didn't support Java TLS. This support didn't fully work, since some of the OTel SDK instrumentations don't work with dynamic injection. For example, gRPC never worked, because the interceptor is injected at build time, so OBI had to see the start of the Java process, which is not feasible.
I experimented recently with making various patches to the Java OTel SDK to support dynamic attach, and while I got things to work for gRPC and Netty, I was working on an old branch (2.14). After I attempted to migrate my code to the latest Java OTel SDK, I realised that many instrumentations that worked in my version don't work anymore, mainly because of refactoring in the Java OTel SDK to support java invoke dynamic (i.e. they call it indy). Many instrumentation have been modified to not pass data through locals, but through separate container classes which cannot be found by the application class loader. I attempted to fix this but I failed.
Since this is not a supported mode for the Java OTel SDK, and things have moved in the opposite direction, I'm removing our code for this here, but I'm keeping the injection classes, because we are going to use those to inject the OBI Java agent for TLS support.