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

Remove slim artifact #5251

Merged
merged 4 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion javaagent-tooling/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ dependencies {
implementation("io.opentelemetry:opentelemetry-sdk-extension-resources")
implementation("io.opentelemetry:opentelemetry-extension-noop-api")

// Only the logging exporter is included in our slim distribution so we include it here.
// Other exporters are in javaagent-exporters
implementation("io.opentelemetry:opentelemetry-exporter-logging")

Expand Down
42 changes: 2 additions & 40 deletions javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,8 @@ val exporterLibs by configurations.creating {
isCanBeResolved = true
isCanBeConsumed = false
}
// this configuration collects just exporter libs for slim artifact (also placed in the agent classloader & isolated from the instrumented application)
val exporterSlimLibs by configurations.creating {
isCanBeResolved = true
isCanBeConsumed = false
}

// exclude dependencies that are to be placed in bootstrap from agent libs - they won't be added to inst/
listOf(baseJavaagentLibs, javaagentLibs, exporterLibs, exporterSlimLibs).forEach {
listOf(baseJavaagentLibs, javaagentLibs, exporterLibs).forEach {
it.run {
exclude("org.slf4j")
exclude("io.opentelemetry", "opentelemetry-api")
Expand Down Expand Up @@ -77,9 +71,6 @@ dependencies {

exporterLibs(project(":javaagent-exporters"))

exporterSlimLibs("io.opentelemetry:opentelemetry-exporter-otlp")
exporterSlimLibs("io.opentelemetry:opentelemetry-exporter-otlp-metrics")

// concurrentlinkedhashmap-lru and weak-lock-free are copied in to the instrumentation-api module
licenseReportDependencies("com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2")
licenseReportDependencies("com.blogspot.mydailyjava:weak-lock-free:0.18")
Expand Down Expand Up @@ -150,12 +141,6 @@ tasks {
archiveFileName.set("exporterLibs-relocated.jar")
}

val relocateExporterSlimLibs by registering(ShadowJar::class) {
configurations = listOf(exporterSlimLibs)

archiveFileName.set("exporterSlimLibs-relocated.jar")
}

// Includes everything needed for OOTB experience
val shadowJar by existing(ShadowJar::class) {
configurations = listOf(bootstrapLibs)
Expand Down Expand Up @@ -185,21 +170,6 @@ tasks {
}
}

// Includes instrumentations plus the OTLP/gRPC exporters
val slimShadowJar by registering(ShadowJar::class) {
configurations = listOf(bootstrapLibs)

dependsOn(relocateJavaagentLibs, relocateExporterSlimLibs)
isolateClasses(relocateJavaagentLibs.get().outputs.files)
isolateClasses(relocateExporterSlimLibs.get().outputs.files)

archiveClassifier.set("slim")

manifest {
attributes(shadowJar.get().manifest.attributes)
}
}

// Includes only the agent machinery and required instrumentations
val baseJavaagentJar by registering(ShadowJar::class) {
configurations = listOf(bootstrapLibs)
Expand All @@ -226,7 +196,7 @@ tasks {
}

assemble {
dependsOn(shadowJar, slimShadowJar, baseJavaagentJar)
dependsOn(shadowJar, baseJavaagentJar)
}

withType<Test>().configureEach {
Expand All @@ -248,14 +218,6 @@ tasks {
named("generateLicenseReport").configure {
dependsOn(cleanLicenses)
}

publishing {
publications {
named<MavenPublication>("maven") {
artifact(slimShadowJar)
}
}
}
}

licenseReport {
Expand Down