Add gradle plugin for SDK extensions
ADD
conventions/src/main/kotlin/otel.sdk-extension.gradle.kts
+// SDK extensions are very similar to library instrumentations, they can be used without the javaagent
+// but since they depend on the SDK they must be loaded by the agent CL in the javaagent
+
+plugins {
+ id("io.opentelemetry.instrumentation.library-instrumentation")
+
+ id("otel.jacoco-conventions")
+ id("otel.java-conventions")
+ id("otel.publish-conventions")
+}
+
+extra["mavenGroupId"] = "io.opentelemetry.instrumentation"
+
+base.archivesName.set(projectDir.parentFile.name)

MODIFY
instrumentation/spring/spring-boot-resources/library/build.gradle.kts
instrumentation/spring/spring-boot-resources/library/build.gradle.kts
plugins {
- id("otel.library-instrumentation")
+ id("otel.sdk-extension")
}
dependencies {

MODIFY
javaagent/build.gradle.kts
javaagent/build.gradle.kts
@@ -108,6 +108,12 @@ project(":instrumentation").subprojects {
add(javaagentLibs.name, project(subProj.path))
}
}
+
+ plugins.withId("otel.sdk-extension") {
+ javaagentDependencies.run {
+ add(javaagentLibs.name, project(subProj.path))
+ }
+ }
}
tasks {

Add gradle plugin for SDK extensions (#6558)