-
Notifications
You must be signed in to change notification settings - Fork 873
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
make rmi instrumentation indy-compatible + add module opener #12585
base: main
Are you sure you want to change the base?
Conversation
…nstrumentation into indy-rmi
...g/javaagent-tooling-java9/src/main/java/io/opentelemetry/javaagent/tooling/ModuleOpener.java
Outdated
Show resolved
Hide resolved
import java.util.Set; | ||
import java.util.logging.Logger; | ||
|
||
public class ModuleOpener { |
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.
Shouldn't there also be a no-op implementation of this class in the non-java9 tooling
project?
Otherwise we'll get a ClassNotFoundException
on Java 8 I think?
This is likely not covered by CI tests yet because we don't rund the indy tests on multiple java versions.
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.
The other classes from this module are used with a try/catch(UnsupportedClassVersionError)
, but here we can also use net.bytebuddy.utility.JavaModule#isSupported
, I've added that in 9c251f0
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.
Interesting, I though that the tooling-java9
project would be bundled as Multi Release Jar
part of #11457
This adds a new
ModuleOpener
that allows to open modules for indy instrumentation in a declarative way, this will later be required to implement the LDAP instrumentation.Existing module opens/exports that have been done with dedicated instrumentations like
io.opentelemetry.javaagent.instrumentation.rmi.context.jpms.ExposeRmiModuleInstrumentation
have been left as-is as they are still relevant for inlined instrumentation. Removing those will be possible once indy instrumentation is applied everywhere.Related PR in the Elastic APM agent where this approach was initially created by @JonasKunz : elastic/apm-agent-java#2977 (this one being also the one covering the LDAP instrumentation).
This new
ModuleOpener
is tested indirectly through RMI tests as it fails with indy instrumentation otherwise.