Skip to content

Commit

Permalink
Cenbtralize version management
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKunz committed Jan 15, 2025
1 parent 618f5ac commit 9206ea5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ dependencies {
testImplementation("io.opentelemetry.javaagent:opentelemetry-testing-common")
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")

add("codegen", "io.opentelemetry.javaagent:opentelemetry-javaagent-tooling:2.11.0-alpha")
add("muzzleBootstrap", "io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations-support")
add("muzzleTooling", "io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api")
add("muzzleTooling", "io.opentelemetry.javaagent:opentelemetry-javaagent-tooling:2.11.0-alpha")
val agentVersion = catalog.findVersion("opentelemetryJavaagentAlpha").get()
add("codegen", "io.opentelemetry.javaagent:opentelemetry-javaagent-tooling:${agentVersion}")
add("muzzleBootstrap", "io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations-support:${agentVersion}")
add("muzzleTooling", "io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api:${agentVersion}")
add("muzzleTooling", "io.opentelemetry.javaagent:opentelemetry-javaagent-tooling:${agentVersion}")
}

fun relocatePackages( shadowJar : ShadowJar) {
Expand Down
6 changes: 6 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ opentelemetryContribAlpha = "1.42.0-alpha"
# reference the "incubating" version explicitly
opentelemetrySemconvAlpha = "1.29.0-alpha"

# instrumented libraries
openaiClient = "0.11.0"

[libraries]

# transitively provides 'opentelemetry-instrumentation-bom' (non-alpha)
Expand Down Expand Up @@ -76,6 +79,9 @@ ant = "org.apache.ant:ant:1.10.15"
# ASM is currently only used during compile-time, so it is okay to diverge from the version used in ByteBuddy
asm = "org.ow2.asm:asm:9.7"

# Instrumented libraries
openaiClient = {group = "com.openai", name = "openai-java", version.ref ="openaiClient"}

[bundles]

semconv = ["opentelemetrySemconv", "opentelemetrySemconvIncubating"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ plugins {
}

dependencies {
compileOnly("com.openai:openai-java:0.11.2")
compileOnly(catalog.openaiClient)
testImplementation(catalog.openaiClient)

testImplementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2")
testImplementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.2")
testImplementation("com.openai:openai-java:0.8.1")
testImplementation("org.slf4j:slf4j-simple:2.0.16")
testImplementation(catalog.wiremock)
}

muzzle {
// TODO: setup muzzle to check older versions of openAI client
}

tasks.withType<Test>().configureEach {
// The instrumentation is experimental and therefore disabled by default, it needs to be explicitly enabled
Expand Down

0 comments on commit 9206ea5

Please sign in to comment.