Merge branch '2.2.x'

This commit is contained in:
Adrian Cole
2020-05-18 20:20:40 +08:00
93 changed files with 1043 additions and 1382 deletions

View File

@@ -16,8 +16,9 @@
package sample;
import zipkin2.Span;
import zipkin2.reporter.Reporter;
import brave.handler.MutableSpan;
import brave.handler.SpanHandler;
import brave.propagation.TraceContext;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -45,8 +46,14 @@ public class SampleZipkinApplication {
// Use this for debugging (or if there is no Zipkin server running on port 9411)
@Bean
@ConditionalOnProperty(value = "sample.zipkin.enabled", havingValue = "false")
public Reporter<Span> spanReporter() {
return Reporter.CONSOLE;
public SpanHandler spanHandler() {
return new SpanHandler() {
@Override
public boolean end(TraceContext context, MutableSpan span, Cause cause) {
System.out.println(span.toString());
return true;
}
};
}
}