diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index b2e45cf7016..7781cbf37c5 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -122,8 +122,8 @@ 3.14.0 0.1.35 1.13.0 - 1.26.0 - 2.16.4 + 1.39.0 + 3.4.0 1.3.0 3.3 0.16.0 diff --git a/dubbo-metrics/dubbo-tracing/pom.xml b/dubbo-metrics/dubbo-tracing/pom.xml index 2979b08cd92..77cf3aed8ef 100644 --- a/dubbo-metrics/dubbo-tracing/pom.xml +++ b/dubbo-metrics/dubbo-tracing/pom.xml @@ -115,5 +115,10 @@ log4j-slf4j-impl test + + io.zipkin.reporter2 + zipkin-reporter + true + diff --git a/dubbo-metrics/dubbo-tracing/src/main/java/org/apache/dubbo/tracing/exporter/zipkin/ZipkinSpanExporter.java b/dubbo-metrics/dubbo-tracing/src/main/java/org/apache/dubbo/tracing/exporter/zipkin/ZipkinSpanExporter.java index c2b3d1bb4fc..0c1678bff4c 100644 --- a/dubbo-metrics/dubbo-tracing/src/main/java/org/apache/dubbo/tracing/exporter/zipkin/ZipkinSpanExporter.java +++ b/dubbo-metrics/dubbo-tracing/src/main/java/org/apache/dubbo/tracing/exporter/zipkin/ZipkinSpanExporter.java @@ -20,8 +20,8 @@ import org.apache.dubbo.rpc.model.ApplicationModel; import zipkin2.Span; -import zipkin2.codec.BytesEncoder; -import zipkin2.codec.SpanBytesEncoder; +import zipkin2.reporter.BytesEncoder; +import zipkin2.reporter.SpanBytesEncoder; /** * Zipkin span exporter for OTel. @@ -30,8 +30,9 @@ public class ZipkinSpanExporter { public static io.opentelemetry.sdk.trace.export.SpanExporter getSpanExporter( ApplicationModel applicationModel, ExporterConfig.ZipkinConfig zipkinConfig) { + BytesEncoder spanBytesEncoder = getSpanBytesEncoder(applicationModel); return io.opentelemetry.exporter.zipkin.ZipkinSpanExporter.builder() - .setEncoder(getSpanBytesEncoder(applicationModel)) + .setEncoder(spanBytesEncoder) .setEndpoint(zipkinConfig.getEndpoint()) .setReadTimeout(zipkinConfig.getReadTimeout()) .build(); diff --git a/dubbo-metrics/dubbo-tracing/src/main/java/org/apache/dubbo/tracing/exporter/zipkin/ZipkinSpanHandler.java b/dubbo-metrics/dubbo-tracing/src/main/java/org/apache/dubbo/tracing/exporter/zipkin/ZipkinSpanHandler.java index 2e870e422be..d60c10415d0 100644 --- a/dubbo-metrics/dubbo-tracing/src/main/java/org/apache/dubbo/tracing/exporter/zipkin/ZipkinSpanHandler.java +++ b/dubbo-metrics/dubbo-tracing/src/main/java/org/apache/dubbo/tracing/exporter/zipkin/ZipkinSpanHandler.java @@ -21,9 +21,9 @@ import brave.handler.SpanHandler; import zipkin2.Span; -import zipkin2.codec.BytesEncoder; -import zipkin2.codec.SpanBytesEncoder; import zipkin2.reporter.AsyncReporter; +import zipkin2.reporter.BytesEncoder; +import zipkin2.reporter.SpanBytesEncoder; import zipkin2.reporter.urlconnection.URLConnectionSender; /** @@ -43,7 +43,8 @@ public static SpanHandler getSpanHandler( sender = builder.build(); } - AsyncReporter spanReporter = AsyncReporter.builder(sender).build(getSpanBytesEncoder(applicationModel)); + BytesEncoder spanBytesEncoder = getSpanBytesEncoder(applicationModel); + AsyncReporter spanReporter = AsyncReporter.builder(sender).build(spanBytesEncoder); return zipkin2.reporter.brave.ZipkinSpanHandler.newBuilder(spanReporter).build(); }