clean up spring dependencies
MODIFY
gradle/instrumentation-library.gradle
gradle/instrumentation-library.gradle
@@ -7,21 +7,25 @@ group = 'io.opentelemetry.instrumentation'
apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/publish.gradle"
-apply plugin: 'com.github.johnrengelman.shadow'
-
archivesBaseName = projectDir.parentFile.name
dependencies {
// TODO(anuraaga): We currently include common instrumentation logic like decorators in the
// bootstrap, but we need to move it out so manual instrumentation does not depend on code from
// the agent, like Agent.
- api project(':auto-bootstrap')
+ api(project(':auto-bootstrap')){
+ exclude group: 'org.slf4j', module: 'slf4j-simple'
+ }
api deps.opentelemetryApi
testImplementation project(':testing-common')
}
+if (!ext.properties.noShadow) {
+
+ apply plugin: 'com.github.johnrengelman.shadow'
+
shadowJar {
archiveClassifier = 'agent'
@@ -29,6 +33,7 @@ shadowJar {
relocate "io.opentelemetry.instrumentation.${javaSubPackage}", "io.opentelemetry.auto.instrumentation.${javaSubPackage}.shaded"
}
+}
afterEvaluate {
archivesBaseName = 'opentelemetry-' + archivesBaseName

MODIFY
instrumentation-core/servlet/servlet.gradle
instrumentation-core/servlet/servlet.gradle
-group = 'io.opentelemetry.instrumentation'
-
-apply from: "$rootDir/gradle/java.gradle"
-apply from: "$rootDir/gradle/publish.gradle"
+ext {
+ javaSubPackage = 'servlet'
+}
+apply from: "$rootDir/gradle/instrumentation-library.gradle"
dependencies {
- api deps.opentelemetryApi
- api project(':auto-bootstrap')
-
implementation deps.slf4j
compileOnly group: 'javax.servlet', name: 'servlet-api', version: '2.3'
}
-

MODIFY
instrumentation-core/spring/spring-boot-autoconfigure/spring-boot-autoconfigure.gradle
instrumentation-core/spring/spring-boot-autoconfigure/spring-boot-autoconfigure.gradle
@@ -14,30 +14,27 @@ dependencies {
annotationProcessor group: 'org.springframework.boot', name: 'spring-boot-autoconfigure-processor', version: versions.springboot
implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
- implementation(project(':instrumentation-core:spring:spring-webmvc-3.1')) {
- exclude group: 'org.slf4j', module: 'slf4j-simple'
- }
- implementation(project(':instrumentation-core:spring:spring-web-3.1')) {
- exclude group: 'org.slf4j', module: 'slf4j-simple'
- }
- implementation(project(':instrumentation-core:spring:spring-webflux-5.0')) {
- exclude group: 'org.slf4j', module: 'slf4j-simple'
- }
+ compileOnly group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: versions.springboot
+ compileOnly group: 'org.springframework.boot', name: 'spring-boot-starter-webflux', version: versions.springboot
+ implementation project(':instrumentation-core:spring:spring-webmvc-3.1')
+ implementation project(':instrumentation-core:spring:spring-web-3.1')
+ implementation project(':instrumentation-core:spring:spring-webflux-5.0')
- compileOnly group: 'io.grpc', name: 'grpc-api', version: '1.24.0'
+ compileOnly group: 'io.grpc', name: 'grpc-api', version: '1.30.2'
compileOnly deps.opentelemetryLogging
compileOnly deps.opentelemetryJaeger
compileOnly deps.opentelemetryOtlp
compileOnly deps.opentelemetryZipkin
+ testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-webflux', version: versions.springboot
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: versions.springboot
testImplementation(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: versions.springboot) {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation deps.opentelemetrySdk
- testImplementation group: 'io.grpc', name: 'grpc-api', version: '1.24.0'
- testImplementation group: "io.grpc", name: "grpc-netty-shaded", version: "1.24.0"
+ testImplementation group: 'io.grpc', name: 'grpc-api', version: '1.30.2'
+ testImplementation group: 'io.grpc', name: 'grpc-netty-shaded', version: '1.30.2'
testImplementation deps.opentelemetryLogging
testImplementation deps.opentelemetryJaeger
testImplementation deps.opentelemetryOtlp

MODIFY
instrumentation-core/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMVCFilterAutoConfiguration.java
instrumentation-core/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMVCFilterAutoConfiguration.java
@@ -18,15 +18,18 @@ package io.opentelemetry.instrumentation.spring.autoconfigure.webmvc;
import io.opentelemetry.instrumentation.springwebmvc.WebMVCTracingFilter;
import io.opentelemetry.trace.Tracer;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.web.filter.OncePerRequestFilter;
/** Configures {@link WebMVCFilter} for tracing. */
@Configuration
@EnableConfigurationProperties(WebMVCProperties.class)
@ConditionalOnProperty(prefix = "opentelemetry.trace.web", name = "enabled", matchIfMissing = true)
+@ConditionalOnClass(OncePerRequestFilter.class)
public class WebMVCFilterAutoConfiguration {
@Bean

MODIFY
instrumentation-core/spring/spring-web-3.1/spring-web-3.1.gradle
instrumentation-core/spring/spring-web-3.1/spring-web-3.1.gradle
-group = 'io.opentelemetry.instrumentation'
+ext{
+ noShadow = true
+}
-apply plugin: 'java'
-apply from: "$rootDir/gradle/java.gradle"
-apply from: "$rootDir/gradle/publish.gradle"
+apply from: "$rootDir/gradle/instrumentation-library.gradle"
dependencies {
-
- // copy-paste from instrumentation-core-aws-sdk:aws-sdk-2.2-core:
- // TODO(anuraaga): We currently include common instrumentation logic like decorators in the
- // bootstrap, but we need to move it out so manual instrumentation does not depend on code from
- // the agent, like Agent.
- api project(':auto-bootstrap')
-
- api "org.springframework:spring-web:3.1.0.RELEASE"
- api deps.opentelemetryApi
-
- testImplementation "org.springframework:spring-test:3.1.0.RELEASE"
-}
-
-testSets {
- latestDepTest {
- dirName = 'test'
- }
+ compileOnly "org.springframework:spring-web:3.1.0.RELEASE"
}
\ No newline at end of file

MODIFY
instrumentation-core/spring/spring-webflux-5.0/spring-webflux-5.0.gradle
instrumentation-core/spring/spring-webflux-5.0/spring-webflux-5.0.gradle
-plugins {
- id "com.github.johnrengelman.shadow"
-}
-
ext {
minJavaVersionForTests = JavaVersion.VERSION_1_8
- noShadowPublish = true
+ javaSubPackage = 'springwebflux.client'
}
-group = 'io.opentelemetry.instrumentation'
-
-apply from: "$rootDir/gradle/java.gradle"
-apply from: "$rootDir/gradle/publish.gradle"
+apply from: "$rootDir/gradle/instrumentation-library.gradle"
dependencies {
- compileOnly project(':auto-bootstrap')
-
- api group: 'org.springframework', name: 'spring-webflux', version: '5.0.0.RELEASE'
- api group: 'io.projectreactor.ipc', name: 'reactor-netty', version: '0.7.0.RELEASE'
- api deps.opentelemetryApi
-}
-
-shadowJar {
- archiveClassifier = 'agent'
- configurations = []
- relocate 'io.opentelemetry.instrumentation.springwebflux.client', 'io.opentelemetry.auto.instrumentation.springwebflux.client.shaded'
-}
-
-testSets {
- latestDepTest {
- dirName = 'test'
- }
+ compileOnly group: 'org.springframework', name: 'spring-webflux', version: '5.0.0.RELEASE'
+ compileOnly group: 'io.projectreactor.ipc', name: 'reactor-netty', version: '0.7.0.RELEASE'
}
\ No newline at end of file

MODIFY
instrumentation-core/spring/spring-webmvc-3.1/spring-webmvc-3.1.gradle
instrumentation-core/spring/spring-webmvc-3.1/spring-webmvc-3.1.gradle
-group = 'io.opentelemetry.instrumentation'
+ext{
+ noShadow = true
+}
-apply from: "$rootDir/gradle/java.gradle"
-apply from: "$rootDir/gradle/publish.gradle"
+apply from: "$rootDir/gradle/instrumentation-library.gradle"
dependencies {
- // copy-paste from instrumentation-core-aws-sdk:aws-sdk-2.2-core:
- // TODO(anuraaga): We currently include common instrumentation logic like decorators in the
- // bootstrap, but we need to move it out so manual instrumentation does not depend on code from
- // the agent, like Agent.
- api project(':auto-bootstrap')
+ api project(':instrumentation-core:servlet')
- api deps.opentelemetryApi
compileOnly group: 'org.springframework', name: 'spring-webmvc', version: '3.1.0.RELEASE'
-
compileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
- api project(':instrumentation-core:servlet')
-
- testImplementation group: 'org.springframework', name: 'spring-test', version: '3.1.0.RELEASE'
-}
-
-test {
- useJUnitPlatform()
}

clean up spring dependencies (#878)