Merge branch '2.2.x'
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user