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

Migrate muzzle plugin to kotlin script. #3388

Merged
merged 4 commits into from
Jun 24, 2021

Conversation

anuraaga
Copy link
Contributor

No description provided.


val muzzleConfig = extensions.create<MuzzleExtension>("muzzle")

val muzzleTooling by configurations.creating {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Creating the configurations in the plugin instead of the project like before as plugins normally do. I haven't quite been able to reason out the difference between these configurations yet (intuitively I'd expect us to only need one classpath when muzzling) but have reproduced the split for now.

Copy link
Member

Choose a reason for hiding this comment

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

I think one of them (muzzleTooling) is supposed to be used as the agent classpath source (to be able to load InstrumentationModule), the other (muzzleBootstrap) should be a base for the "instrumented application" classpath - add the library jar for a given version to our bootstrap classes and pass it to the check method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah thanks that makes sense!

val userUrls = objects.fileCollection()
logger.info("Creating task classpath")
userUrls.from(muzzleTaskConfiguration.resolvedConfiguration.files)
return classpathLoader(userUrls.plus(muzzleTooling), ClassLoader.getPlatformClassLoader())
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't that be the bootstrap conf?

Suggested change
return classpathLoader(userUrls.plus(muzzleTooling), ClassLoader.getPlatformClassLoader())
return classpathLoader(userUrls.plus(muzzleBootstrap), ClassLoader.getPlatformClassLoader())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops - guess it still passed since bootstrap gets included transitively

@anuraaga anuraaga merged commit eb897a8 into open-telemetry:main Jun 24, 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.

None yet

3 participants