Adds the ability to configure things needed by stackdriver
We will eventually need to change the encoder to use their format. Also, stackdriver does not support shared spans.
This commit is contained in:
@@ -20,6 +20,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import brave.sampler.Sampler;
|
||||
import zipkin2.Span;
|
||||
import zipkin2.codec.BytesEncoder;
|
||||
import zipkin2.reporter.AsyncReporter;
|
||||
import zipkin2.reporter.InMemoryReporterMetrics;
|
||||
import zipkin2.reporter.Reporter;
|
||||
@@ -78,13 +79,20 @@ public class ZipkinAutoConfiguration {
|
||||
public Reporter<Span> reporter(
|
||||
ReporterMetrics reporterMetrics,
|
||||
ZipkinProperties zipkin,
|
||||
Sender sender
|
||||
Sender sender,
|
||||
BytesEncoder<Span> spanBytesEncoder
|
||||
) {
|
||||
return AsyncReporter.builder(sender)
|
||||
.queuedMaxSpans(1000) // historical constraint. Note: AsyncReporter supports memory bounds
|
||||
.messageTimeout(zipkin.getMessageTimeout(), TimeUnit.SECONDS)
|
||||
.metrics(reporterMetrics)
|
||||
.build(zipkin.getEncoder());
|
||||
.build(spanBytesEncoder);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public BytesEncoder<Span> spanBytesEncoder(ZipkinProperties zipkinProperties) {
|
||||
return zipkinProperties.getEncoder();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
Reference in New Issue
Block a user