Extract agent shadow configuration to conventions script. - #3256
Merged
Conversation
anuraaga
requested review from
iNikem,
jkwatson,
laurit,
mateuszrzeszutek,
pavolloffay,
trask and
tylerbenson
as code owners
June 11, 2021 10:06
mateuszrzeszutek
approved these changes
Jun 11, 2021
iNikem
approved these changes
Jun 11, 2021
trask
approved these changes
Jun 11, 2021
trask
left a comment
Member
There was a problem hiding this comment.
We have been desparately in need of making this common logic for a long time
💯
added 2 commits
June 12, 2021 13:48
…nstrumentation into shadow-conventions
anuraaga
commented
Jun 12, 2021
| */ | ||
| public class ReferenceCollector { | ||
|
|
||
| // ReferenceCollector's classloader has a parent including the Gradle classpath, such as buildSrc |
Contributor
Author
There was a problem hiding this comment.
It turns out we were previously loading SPI helper resources from buildSrc before our own classpath. Adding shadow to buildSrc, for use in the convention plugin, broke log4j instrumentation since shadow (probably incorrectly, it seems to be the log4j default) bundles in a log4j service file.
anuraaga
commented
Jun 12, 2021
| implementation("org.ow2.asm:asm:7.0-beta") | ||
| implementation("org.ow2.asm:asm-tree:7.0-beta") | ||
| implementation("org.apache.httpcomponents:httpclient:4.5.10") | ||
| // When updating, also update dependencyManagement/dependencyManagement.gradle.kts |
Contributor
Author
There was a problem hiding this comment.
/cc @iNikem I bundled in an update to the byte buddy gradle plugin into this PR (it didn't fix the problem I was seeing but was my first try :P)
robododge
pushed a commit
to robododge/opentelemetry-java-instrumentation
that referenced
this pull request
Jun 17, 2021
…etry#3256) * Extract agent shadow configuration to conventions script. * Remove redundant plugin version declaration * Resource loader doesn't load from buildSrc * Comments about byte buddy version * Fix ReferenceCollectorTest 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.
We have been desparately in need of making this common logic for a long time. And for fixing the -all jar, I am expecting yet another project that contains the bundle of exporters with the shadow configuration. So finally did it.
I am using this relatively new pattern of conventions plugins
https://docs.gradle.org/current/samples/sample_convention_plugins.html
Eventually we can migrate all the
gradle/*.gradlefiles to conventions to allow using thepluginsblock everywhere.