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

Support for multiple extension jars by scanning the given folder #3226

Merged
merged 4 commits into from
Jun 11, 2021

Conversation

iNikem
Copy link
Contributor

@iNikem iNikem commented Jun 8, 2021

Documentation will follow later when we are ready to declare this stable.

@@ -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) {
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -30,6 +30,7 @@ ext {
}

repositories {
mavenLocal()
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@iNikem iNikem mentioned this pull request Jun 10, 2021
@trask trask merged commit aa4f07d into open-telemetry:main Jun 11, 2021
@trask trask mentioned this pull request Jun 12, 2021
@iNikem iNikem deleted the multi-extension branch June 12, 2021 08:03
robododge pushed a commit to robododge/opentelemetry-java-instrumentation that referenced this pull request Jun 17, 2021
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.

5 participants