Skip to content
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

Merged
merged 4 commits into from
Nov 3, 2021
Merged

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Nov 3, 2021

Resolves #4552

Copy link
Member

@mateuszrzeszutek mateuszrzeszutek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

Copy link
Member

@trask trask left a 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?

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"));
}
Copy link
Member

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 😄

Copy link
Contributor Author

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.

laurit and others added 2 commits November 3, 2021 19:52
…avaagent/instrumentation/rmi/context/jpms/ExposeRmiModuleInstrumentation.java

Co-authored-by: Trask Stalnaker <[email protected]>
@trask trask merged commit 40ef4be into open-telemetry:main 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 <[email protected]>

* review comment

Co-authored-by: Trask Stalnaker <[email protected]>
@laurit laurit deleted the rmi-server-jdk17 branch July 6, 2023 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support JDK 17
3 participants