Skip to content

Commit 1e070b5

Browse files
songxiaoshengsonglusheng
and
songlusheng
authored
Fix/bytes encoder cast exception (#15262)
* fix provider get baggage error * fix BytesEncoder Cast Exception * add zipkin-sender-urlconnection default * format code --------- Co-authored-by: songlusheng <[email protected]>
1 parent 65dc351 commit 1e070b5

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

dubbo-spring-boot-project/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/observability/zipkin/ZipkinAutoConfiguration.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,11 @@ public class ZipkinAutoConfiguration {
6767
public BytesEncoder<Span> spanBytesEncoder() {
6868
return SpanBytesEncoder.JSON_V2;
6969
}
70+
71+
@Bean
72+
@ConditionalOnProperty(prefix = DUBBO_TRACING_ZIPKIN_CONFIG_PREFIX, name = "endpoint")
73+
@ConditionalOnMissingBean
74+
public zipkin2.reporter.BytesEncoder<Span> reporterBytesEncoder() {
75+
return zipkin2.reporter.SpanBytesEncoder.JSON_V2;
76+
}
7077
}

dubbo-spring-boot-project/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/observability/zipkin/ZipkinConfigurations.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ static class ReporterConfiguration {
133133
@Bean
134134
@ConditionalOnMissingBean
135135
@ConditionalOnBean(Sender.class)
136-
AsyncReporter<Span> spanReporter(Sender sender, BytesEncoder<Span> encoder) {
137-
return AsyncReporter.builder(sender).build((zipkin2.reporter.BytesEncoder<Span>) encoder);
136+
AsyncReporter<Span> spanReporter(Sender sender, zipkin2.reporter.BytesEncoder<Span> encoder) {
137+
return AsyncReporter.builder(sender).build(encoder);
138138
}
139139
}
140140

dubbo-spring-boot-project/dubbo-spring-boot-starters/dubbo-tracing-brave-zipkin-spring-boot-starter/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
<groupId>io.zipkin.zipkin2</groupId>
4747
<artifactId>zipkin</artifactId>
4848
</dependency>
49+
<dependency>
50+
<groupId>io.zipkin.reporter2</groupId>
51+
<artifactId>zipkin-sender-urlconnection</artifactId>
52+
</dependency>
4953
</dependencies>
5054

5155
</project>

0 commit comments

Comments
 (0)