Rmi instrumentation on jdk17 - #4577
Merged
Merged
Conversation
laurit
requested review from
anuraaga,
iNikem,
jkwatson,
mateuszrzeszutek,
pavolloffay,
trask and
tylerbenson
as code owners
November 3, 2021 12:54
mateuszrzeszutek
approved these changes
Nov 3, 2021
trask
approved these changes
Nov 3, 2021
trask
left a comment
Member
There was a problem hiding this comment.
any thoughts what it would take to run the normal rmi instrumentation tests using JPMS?
Comment on lines
+29
to
+41
| @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")); | ||
| } |
Member
There was a problem hiding this comment.
this is a good trick to file away 😄
Contributor
Author
There was a problem hiding this comment.
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.
…avaagent/instrumentation/rmi/context/jpms/ExposeRmiModuleInstrumentation.java Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
This was referenced Nov 3, 2021
RashmiRam
pushed a commit
to RashmiRam/opentelemetry-auto-instr-java
that referenced
this pull request
May 23, 2022
* 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 <trask.stalnaker@gmail.com> * review comment Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Resolves #4552