-
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
Support for multiple extension jars by scanning the given folder #3226
Conversation
javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ExtensionLoader.java
Outdated
Show resolved
Hide resolved
@@ -490,7 +490,7 @@ public void onComplete( | |||
|
|||
private static boolean isIgnored(Class<?> c) { | |||
ClassLoader cl = c.getClassLoader(); | |||
if (cl instanceof AgentClassLoader || cl instanceof ExtensionClassLoader) { | |||
if (cl instanceof AgentClassLoader) { |
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.
What's the reason for this change? Do we want to redefine extension classes?
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 reason for this change is there is no more ExtensionClassLoader
. I can change for MultipleParentClassLoader
, but there may be different instance of it, not created by us.
And I don't know if there is any actual implication of this check.
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.
As far as I understand adding MultipleParentClassLoader
here won't help as it doesn't define any classes. You could change delegates used by MultipleParentClassLoader
to be sublcasses of URLClassLoader
and filter by that class or add a marker interface which could be used here.
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.
But do we actually need this?
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.
It's an optimization to avoid retransforming classes that were loaded by the extension before we set up the bytebuddy transformers, @laurit's idea seems simple enough to be worth keeping.
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.
Done.
javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ExtensionLoader.java
Outdated
Show resolved
Hide resolved
@@ -30,6 +30,7 @@ ext { | |||
} | |||
|
|||
repositories { | |||
mavenLocal() |
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.
Remove or order at bottom?
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.
Will remove in later PR when we have suitable snapshots published.
Documentation will follow later when we are ready to declare this stable.