-
Notifications
You must be signed in to change notification settings - Fork 867
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
Rmi instrumentation on jdk17 #4577
Conversation
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.
Nice 👍
...opentelemetry/javaagent/instrumentation/rmi/context/jpms/ExposeRmiModuleInstrumentation.java
Outdated
Show resolved
Hide resolved
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.
any thoughts what it would take to run the normal rmi instrumentation tests using JPMS?
@Override | ||
public ElementMatcher<TypeDescription> typeMatcher() { | ||
ElementMatcher.Junction<TypeDescription> notInstrumented = | ||
new ElementMatcher.Junction.AbstractBase<TypeDescription>() { | ||
|
||
@Override | ||
public boolean matches(TypeDescription target) { | ||
return !instrumented.get(); | ||
} | ||
}; | ||
|
||
return notInstrumented.and(nameStartsWith("sun.rmi")); | ||
} |
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 is a good trick to file away 😄
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 did it this way mostly because for every class that matches this gets logged
io.opentelemetry.javaagent.tooling.AgentInstaller$TransformLoggingListener - Transformed sun.rmi.server.WeakClassHashMap -- null
What I really wanted was to make this module start before RmiContextPropagationInstrumentationModule
so that io.opentelemetry.javaagent.instrumentation.rmi.context.server.ContextDispatcher
could access sun.rmi.server.Dispatcher
. Perhaps a cleaner alternative would be to have some sort of api for declaring dependency on an internal package so this could be handled in HelperInjector
.
...opentelemetry/javaagent/instrumentation/rmi/context/jpms/ExposeRmiModuleInstrumentation.java
Outdated
Show resolved
Hide resolved
...opentelemetry/javaagent/instrumentation/rmi/context/jpms/ExposeRmiModuleInstrumentation.java
Outdated
Show resolved
Hide resolved
…avaagent/instrumentation/rmi/context/jpms/ExposeRmiModuleInstrumentation.java Co-authored-by: Trask Stalnaker <[email protected]>
* Rmi instrumentation on jdk17 * address review comment, make muzzle happy * Update instrumentation/rmi/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/context/jpms/ExposeRmiModuleInstrumentation.java Co-authored-by: Trask Stalnaker <[email protected]> * review comment Co-authored-by: Trask Stalnaker <[email protected]>
Resolves #4552