Support configuring queuedMaxSpans in AsyncReporter (#2157)
This commit is contained in:
@@ -128,8 +128,8 @@ public class ZipkinAutoConfiguration {
|
||||
CheckResult checkResult = checkResult(zipkinExecutor, sender, 1_000L);
|
||||
logCheckResult(sender, checkResult);
|
||||
|
||||
// historical constraint. Note: AsyncReporter supports memory bounds
|
||||
AsyncReporter<Span> asyncReporter = AsyncReporter.builder(sender).queuedMaxSpans(1000)
|
||||
// Note: AsyncReporter supports memory bounds
|
||||
AsyncReporter<Span> asyncReporter = AsyncReporter.builder(sender).queuedMaxSpans(zipkin.getQueuedMaxSpans())
|
||||
.messageTimeout(zipkin.getMessageTimeout(), TimeUnit.SECONDS).metrics(reporterMetrics)
|
||||
.build(zipkin.getEncoder());
|
||||
|
||||
|
||||
@@ -75,6 +75,11 @@ public class ZipkinProperties {
|
||||
|
||||
private Locator locator = new Locator();
|
||||
|
||||
/**
|
||||
* Maximum backlog of spans reported vs sent.
|
||||
*/
|
||||
private int queuedMaxSpans = 1000;
|
||||
|
||||
public Locator getLocator() {
|
||||
return this.locator;
|
||||
}
|
||||
@@ -147,6 +152,14 @@ public class ZipkinProperties {
|
||||
this.encoder = encoder;
|
||||
}
|
||||
|
||||
public int getQueuedMaxSpans() {
|
||||
return queuedMaxSpans;
|
||||
}
|
||||
|
||||
public void setQueuedMaxSpans(int queuedMaxSpans) {
|
||||
this.queuedMaxSpans = queuedMaxSpans;
|
||||
}
|
||||
|
||||
/** When enabled, spans are gzipped before sent to the zipkin server. */
|
||||
public static class Compression {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user