Create exporter starters
MODIFY
gradle/dependencies.gradle
gradle/dependencies.gradle
@@ -22,7 +22,8 @@ ext {
bytebuddy : "1.10.10",
scala : "2.11.12", // Last version to support Java 7 (2.12+ require Java 8+)
kotlin : "1.3.72",
- coroutines : "1.3.0"
+ coroutines : "1.3.0",
+ springboot : "2.3.1.RELEASE",
]
deps = [
@@ -35,6 +36,7 @@ ext {
opentelemetryJaeger : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-exporters-jaeger', version: versions.opentelemetry),
opentelemetryOtlp : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-exporters-otlp', version: versions.opentelemetryOther),
opentelemetryZipkin : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-exporters-zipkin', version: versions.opentelemetryOther),
+ opentelemetryLogging : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-exporters-logging', version: versions.opentelemetryOther),
// General
slf4j : "org.slf4j:slf4j-api:${versions.slf4j}",

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"
dependencies {
api deps.opentelemetryApi

MODIFY
instrumentation-core/spring/spring-boot-autoconfigure/spring-boot-autoconfigure.gradle
instrumentation-core/spring/spring-boot-autoconfigure/spring-boot-autoconfigure.gradle
-plugins {
- id 'org.springframework.boot' version '2.3.0.RELEASE'
- id 'io.spring.dependency-management' version '1.0.9.RELEASE'
-}
-
ext {
minJavaVersionForTests = JavaVersion.VERSION_1_8
}
@@ -10,33 +5,34 @@ ext {
group = 'io.opentelemetry.instrumentation'
apply from: "$rootDir/gradle/java.gradle"
+apply from: "$rootDir/gradle/publish.gradle"
sourceCompatibility = '8'
-bootJar {
- enabled = false
-}
-
dependencies {
- annotationProcessor "org.springframework.boot:spring-boot-autoconfigure-processor"
- implementation "org.springframework.boot:spring-boot-starter-validation"
+ implementation group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: versions.springboot
+ 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'
- testImplementation('org.springframework.boot:spring-boot-starter-test') {
+ testImplementation(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: versions.springboot) {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
- 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')
-
- api deps.opentelemetryApi
+ 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 "io.opentelemetry:opentelemetry-exporters-logging:0.6.0"
+ compileOnly group: 'io.grpc', name: 'grpc-api', version: '1.24.0'
+ compileOnly deps.opentelemetryLogging
compileOnly deps.opentelemetryJaeger
compileOnly deps.opentelemetryOtlp
compileOnly deps.opentelemetryZipkin
-
- compileOnly group: 'io.grpc', name: 'grpc-api', version: '1.24.0'
}
test {

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
@@ -2,6 +2,7 @@ group = 'io.opentelemetry.instrumentation'
apply plugin: 'java'
apply from: "$rootDir/gradle/java.gradle"
+apply from: "$rootDir/gradle/publish.gradle"
dependencies {

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
@@ -7,10 +7,11 @@ ext {
noShadowPublish = true
}
-apply from: "$rootDir/gradle/java.gradle"
-
group = 'io.opentelemetry.instrumentation'
+apply from: "$rootDir/gradle/java.gradle"
+apply from: "$rootDir/gradle/publish.gradle"
+
dependencies {
compileOnly project(':auto-bootstrap')
@@ -25,7 +26,6 @@ shadowJar {
relocate 'io.opentelemetry.instrumentation.springwebflux.client', 'io.opentelemetry.auto.instrumentation.springwebflux.client.shaded'
}
-
testSets {
latestDepTest {
dirName = 'test'

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'
apply from: "$rootDir/gradle/java.gradle"
+apply from: "$rootDir/gradle/publish.gradle"
dependencies {
// copy-paste from instrumentation-core-aws-sdk:aws-sdk-2.2-core:

ADD
instrumentation-core/spring/starters/jaeger-exporter-starter/jaeger-exporter-starter.gradle
+ext {
+ minJavaVersionForTests = JavaVersion.VERSION_1_8
+ springbootVersion = "2.3.1.RELEASE"
+}
+
+group = 'io.opentelemetry.instrumentation'
+
+apply from: "$rootDir/gradle/java.gradle"
+apply from: "$rootDir/gradle/publish.gradle"
+
+sourceCompatibility = '8'
+
+dependencies {
+ api group: "org.springframework.boot", name: "spring-boot-starter", version: versions.springboot
+ api project(':instrumentation-core:spring:starters:spring-starter')
+ api deps.opentelemetryJaeger
+ implementation group: "io.grpc", name: "grpc-netty-shaded", version: "1.30.2"
+}
+

ADD
instrumentation-core/spring/starters/otlp-exporter-starter/otlp-exporter-starter.gradle
+ext {
+ minJavaVersionForTests = JavaVersion.VERSION_1_8
+}
+
+group = 'io.opentelemetry.instrumentation'
+
+apply from: "$rootDir/gradle/java.gradle"
+apply from: "$rootDir/gradle/publish.gradle"
+
+sourceCompatibility = '8'
+
+dependencies {
+ api group: "org.springframework.boot", name: "spring-boot-starter", version: versions.springboot
+ api project(':instrumentation-core:spring:starters:spring-starter')
+ api deps.opentelemetryOtlp
+ implementation group: "io.grpc", name: "grpc-netty-shaded", version: "1.30.2"
+}
+

ADD
instrumentation-core/spring/starters/spring-starter/spring-starter.gradle
+ext {
+ minJavaVersionForTests = JavaVersion.VERSION_1_8
+}
+
+group = 'io.opentelemetry.instrumentation'
+
+apply from: "$rootDir/gradle/java.gradle"
+apply from: "$rootDir/gradle/publish.gradle"
+
+sourceCompatibility = '8'
+
+dependencies {
+ api group: "org.springframework.boot", name: "spring-boot-starter", version: versions.springboot
+ api project(':instrumentation-core:spring:spring-boot-autoconfigure')
+ api deps.opentelemetryApi
+ api deps.opentelemetryLogging
+ api deps.opentelemetrySdk
+}

ADD
instrumentation-core/spring/starters/zipkin-exporter-starter/zipkin-exporter-starter.gradle
+ext {
+ minJavaVersionForTests = JavaVersion.VERSION_1_8
+}
+
+group = 'io.opentelemetry.instrumentation'
+
+apply from: "$rootDir/gradle/java.gradle"
+apply from: "$rootDir/gradle/publish.gradle"
+
+sourceCompatibility = '8'
+
+dependencies {
+ api group: "org.springframework.boot", name: "spring-boot-starter", version: versions.springboot
+ api project(':instrumentation-core:spring:starters:spring-starter')
+ api deps.opentelemetryZipkin
+}
+

MODIFY
settings.gradle
settings.gradle
@@ -159,6 +159,11 @@ include ':instrumentation-core:spring:spring-web-3.1'
include ':instrumentation-core:spring:spring-webflux-5.0'
include ':instrumentation-core:spring:spring-webmvc-3.1'
+include ':instrumentation-core:spring:starters:spring-starter'
+include ':instrumentation-core:spring:starters:jaeger-exporter-starter'
+include ':instrumentation-core:spring:starters:otlp-exporter-starter'
+include ':instrumentation-core:spring:starters:zipkin-exporter-starter'
+
// exporter adapters
include ":auto-exporters"
include ":auto-exporters:jaeger"

Create exporter starters (#815)