From cdab2c820c2694d8c800fb41c6414bd37d20a4ac Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Sat, 20 Nov 2021 04:21:34 +0900 Subject: [PATCH] Remove gRPC dependency for export (#4674) --- dependencyManagement/build.gradle.kts | 4 ---- .../spring/spring-boot-autoconfigure/build.gradle.kts | 3 --- .../exporters/jaeger/JaegerSpanExporterAutoConfiguration.java | 3 +-- .../exporters/otlp/OtlpGrpcSpanExporterAutoConfiguration.java | 3 +-- .../spring/starters/jaeger-exporter-starter/build.gradle.kts | 1 - .../spring/starters/otlp-exporter-starter/build.gradle.kts | 1 - javaagent-exporters/build.gradle.kts | 2 -- javaagent/build.gradle.kts | 1 - 8 files changed, 2 insertions(+), 16 deletions(-) diff --git a/dependencyManagement/build.gradle.kts b/dependencyManagement/build.gradle.kts index d11c63ec49b6..140da3d100bb 100644 --- a/dependencyManagement/build.gradle.kts +++ b/dependencyManagement/build.gradle.kts @@ -11,10 +11,7 @@ data class DependencySet(val group: String, val version: String, val modules: Li val dependencyVersions = hashMapOf() rootProject.extra["versions"] = dependencyVersions -// IMPORTANT when updating otelVersion, make sure that grpcVersion below is >= the grpc version -// used by that otel version val otelVersion = "1.9.0" -val grpcVersion = "1.41.0" rootProject.extra["otelVersion"] = otelVersion // Need both BOM and -all @@ -116,7 +113,6 @@ val DEPENDENCIES = listOf( "org.spockframework:spock-junit4:2.0-groovy-2.5", "org.scala-lang:scala-library:2.11.12", "org.springframework.boot:spring-boot-dependencies:2.3.1.RELEASE", - "io.grpc:grpc-netty-shaded:${grpcVersion}", ) javaPlatform { diff --git a/instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts b/instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts index 588a5aed9ef8..996c359e7303 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts +++ b/instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts @@ -29,7 +29,6 @@ dependencies { compileOnly("io.opentelemetry:opentelemetry-exporter-jaeger") compileOnly("io.opentelemetry:opentelemetry-exporter-otlp") compileOnly("io.opentelemetry:opentelemetry-exporter-zipkin") - compileOnly("io.grpc:grpc-api:1.30.2") testImplementation("org.springframework.boot:spring-boot-starter-aop:${versions["org.springframework.boot"]}") testImplementation("org.springframework.boot:spring-boot-starter-webflux:${versions["org.springframework.boot"]}") @@ -49,8 +48,6 @@ dependencies { testImplementation("io.opentelemetry:opentelemetry-exporter-jaeger") testImplementation("io.opentelemetry:opentelemetry-exporter-otlp") testImplementation("io.opentelemetry:opentelemetry-exporter-zipkin") - testImplementation("io.grpc:grpc-api:1.30.2") - testImplementation("io.grpc:grpc-netty-shaded:1.30.2") testImplementation(project(":instrumentation-api-annotation-support")) // this only exists to make Intellij happy since it doesn't (currently at least) understand our diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterAutoConfiguration.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterAutoConfiguration.java index d88c88b91163..dc017ff3396b 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterAutoConfiguration.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/jaeger/JaegerSpanExporterAutoConfiguration.java @@ -5,7 +5,6 @@ package io.opentelemetry.instrumentation.spring.autoconfigure.exporters.jaeger; -import io.grpc.ManagedChannel; import io.opentelemetry.exporter.jaeger.JaegerGrpcSpanExporter; import io.opentelemetry.exporter.jaeger.JaegerGrpcSpanExporterBuilder; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; @@ -26,7 +25,7 @@ @AutoConfigureBefore(OpenTelemetryAutoConfiguration.class) @EnableConfigurationProperties(JaegerSpanExporterProperties.class) @ConditionalOnProperty(prefix = "otel.exporter.jaeger", name = "enabled", matchIfMissing = true) -@ConditionalOnClass({JaegerGrpcSpanExporter.class, ManagedChannel.class}) +@ConditionalOnClass(JaegerGrpcSpanExporter.class) public class JaegerSpanExporterAutoConfiguration { @Bean diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpGrpcSpanExporterAutoConfiguration.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpGrpcSpanExporterAutoConfiguration.java index 2a2e1b294580..a9d1553a4d09 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpGrpcSpanExporterAutoConfiguration.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpGrpcSpanExporterAutoConfiguration.java @@ -5,7 +5,6 @@ package io.opentelemetry.instrumentation.spring.autoconfigure.exporters.otlp; -import io.grpc.ManagedChannel; import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter; import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporterBuilder; import io.opentelemetry.instrumentation.spring.autoconfigure.OpenTelemetryAutoConfiguration; @@ -26,7 +25,7 @@ @AutoConfigureBefore(OpenTelemetryAutoConfiguration.class) @EnableConfigurationProperties(OtlpGrpcSpanExporterProperties.class) @ConditionalOnProperty(prefix = "otel.exporter.otlp", name = "enabled", matchIfMissing = true) -@ConditionalOnClass({OtlpGrpcSpanExporter.class, ManagedChannel.class}) +@ConditionalOnClass(OtlpGrpcSpanExporter.class) public class OtlpGrpcSpanExporterAutoConfiguration { @Bean diff --git a/instrumentation/spring/starters/jaeger-exporter-starter/build.gradle.kts b/instrumentation/spring/starters/jaeger-exporter-starter/build.gradle.kts index f1e377930c5a..f426855737eb 100644 --- a/instrumentation/spring/starters/jaeger-exporter-starter/build.gradle.kts +++ b/instrumentation/spring/starters/jaeger-exporter-starter/build.gradle.kts @@ -11,5 +11,4 @@ dependencies { api("org.springframework.boot:spring-boot-starter:${versions["org.springframework.boot"]}") api(project(":instrumentation:spring:starters:spring-starter")) api("io.opentelemetry:opentelemetry-exporter-jaeger") - implementation("io.grpc:grpc-netty-shaded:1.30.2") } diff --git a/instrumentation/spring/starters/otlp-exporter-starter/build.gradle.kts b/instrumentation/spring/starters/otlp-exporter-starter/build.gradle.kts index 8aa1a7039974..1dba59fe2031 100644 --- a/instrumentation/spring/starters/otlp-exporter-starter/build.gradle.kts +++ b/instrumentation/spring/starters/otlp-exporter-starter/build.gradle.kts @@ -11,5 +11,4 @@ dependencies { api("org.springframework.boot:spring-boot-starter:${versions["org.springframework.boot"]}") api(project(":instrumentation:spring:starters:spring-starter")) api("io.opentelemetry:opentelemetry-exporter-otlp") - implementation("io.grpc:grpc-netty-shaded:1.30.2") } diff --git a/javaagent-exporters/build.gradle.kts b/javaagent-exporters/build.gradle.kts index dea32a97eceb..026eda91a193 100644 --- a/javaagent-exporters/build.gradle.kts +++ b/javaagent-exporters/build.gradle.kts @@ -17,6 +17,4 @@ dependencies { implementation("io.prometheus:simpleclient_httpserver") implementation("io.opentelemetry:opentelemetry-exporter-zipkin") - - implementation("io.grpc:grpc-netty-shaded") } diff --git a/javaagent/build.gradle.kts b/javaagent/build.gradle.kts index f6bd97ea1fd5..08d355e131e9 100644 --- a/javaagent/build.gradle.kts +++ b/javaagent/build.gradle.kts @@ -83,7 +83,6 @@ dependencies { exporterSlimLibs("io.opentelemetry:opentelemetry-exporter-otlp") exporterSlimLibs("io.opentelemetry:opentelemetry-exporter-otlp-metrics") - exporterSlimLibs("io.grpc:grpc-okhttp:1.41.0") // We only have compileOnly dependencies on these to make sure they don't leak into POMs. licenseReportDependencies("com.github.ben-manes.caffeine:caffeine:$caffeine3Version") {