Skip to content
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
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ subprojects {

"opentelemetry_gradle_plugin" to "1.33.0-alpha",
"byte_buddy" to "1.12.10",
"slf4j" to "2.0.7"
"slf4j" to "2.0.7",
"jackson" to "2.18.9"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is the same version as before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

jackson bumped from 2.16.1 to 2.18.9
the "slf4j" to "2.0.7", is being shown because it has , added in it

))
}

Expand Down
2 changes: 1 addition & 1 deletion javaagent-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ dependencies {
api("io.opentelemetry:opentelemetry-api:${versions["opentelemetry"]}")
api("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:${versions["opentelemetry"]}")
implementation("org.slf4j:slf4j-api:${versions["slf4j"]}")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.9")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions["jackson"]}")
}
48 changes: 47 additions & 1 deletion javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ plugins {
}

val versions: Map<String, String> by extra
val jacksonVersion: String = versions["jackson"]!!

configurations {
create("otelInstJacksonOverlay") {
isCanBeResolved = true
isCanBeConsumed = false
}
}

dependencies {
// pin released version or snapshot with pinned version
Expand All @@ -13,6 +21,11 @@ dependencies {
// https://dl.bintray.com/open-telemetry/maven/
implementation("io.opentelemetry.javaagent", "opentelemetry-javaagent", version = "${versions["opentelemetry_java_agent_all"]}")
implementation(project(":filter-api"))

add("otelInstJacksonOverlay", "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion")
add("otelInstJacksonOverlay", "com.fasterxml.jackson.core:jackson-core:$jacksonVersion")
add("otelInstJacksonOverlay", "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
add("otelInstJacksonOverlay", "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jacksonVersion")
}

base.archivesBaseName = "hypertrace-agent"
Expand Down Expand Up @@ -49,6 +62,14 @@ tasks.register<Copy>("extractOtelAgentJarInstClassdata") {

from(zipTree(otelJavaAgentJar)) {
include("inst/**")
// OTel ships Jackson 2.16.x in inst/; overlay with jacksonVersion after relocation
exclude("inst/com/fasterxml/**")
exclude("inst/org/yaml/**")
exclude("inst/META-INF/maven/com.fasterxml.jackson.core/**")
exclude("inst/META-INF/maven/com.fasterxml.jackson.dataformat/**")
exclude("inst/META-INF/maven/org.yaml/**")
exclude("inst/META-INF/versions/*/com/fasterxml/**")
exclude("inst/META-INF/versions/*/org/yaml/**")
rename("(^.*)\\.classdata$", "$1.class")
}

Expand Down Expand Up @@ -84,10 +105,35 @@ tasks.register<Copy>("extractRelocatedOtelClasses") {
into("$buildDir/tmp/relocated-otel-classes")
}

// Step 3c: Replace OTel's embedded Jackson with jacksonVersion
tasks.register<Copy>("overlayOtelInstJackson") {
description = "Replaces OTel embedded Jackson/SnakeYAML in inst/ with $jacksonVersion"

dependsOn("extractRelocatedOtelClasses")

val overlayJars = configurations["otelInstJacksonOverlay"].files

overlayJars.forEach { jar ->
from(zipTree(jar)) {
include("com/fasterxml/**")
include("org/yaml/**")
include("META-INF/maven/com.fasterxml.jackson.core/**")
include("META-INF/maven/com.fasterxml.jackson.dataformat/**")
include("META-INF/maven/org.yaml/**")
include("META-INF/versions/**/com/fasterxml/**")
include("META-INF/versions/**/org/yaml/**")
exclude("**/module-info.class")
}
}

into("$buildDir/tmp/relocated-otel-classes/inst/org/hypertrace")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

tasks.register("extractOtelInstrumentationToInst") {
description = "Removes empty directories from the relocated classes directory"

dependsOn("extractRelocatedOtelClasses")
dependsOn("overlayOtelInstJackson")

doLast {
// Find and delete empty directories
Expand Down
2 changes: 1 addition & 1 deletion otel-extensions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ dependencies {
api("com.google.protobuf:protobuf-java")
api("com.google.protobuf:protobuf-java-util")
// convert yaml to json, since java protobuf impl supports only json
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.9")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions["jackson"]}")
// fix vulnerability
constraints {
api("com.google.code.gson:gson:2.8.9")
Expand Down
2 changes: 1 addition & 1 deletion smoke-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies{
testImplementation("com.google.protobuf:protobuf-java-util:3.25.5")
testImplementation("org.spockframework:spock-core:1.3-groovy-2.5")
testImplementation("info.solidsoft.spock:spock-global-unroll:0.5.1")
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.18.9")
testImplementation("com.fasterxml.jackson.core:jackson-databind:${versions["jackson"]}")
testImplementation("org.codehaus.groovy:groovy-all:2.5.11")
testImplementation("io.opentelemetry.semconv:opentelemetry-semconv:${versions["opentelemetry_semconv"]}")
}
Expand Down
Loading