Class AsyncZipkinSpanHandler.Builder
- java.lang.Object
-
- zipkin2.reporter.brave.ZipkinSpanHandler.Builder
-
- zipkin2.reporter.brave.AsyncZipkinSpanHandler.Builder
-
- Enclosing class:
- AsyncZipkinSpanHandler
public static final class AsyncZipkinSpanHandler.Builder extends ZipkinSpanHandler.Builder
- Since:
- 2.14
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AsyncZipkinSpanHandler.BuilderalwaysReportSpans(boolean alwaysReportSpans)When true, all spanssampled locallyare reported to the span reporter, even if they aren't sampled remotely.AsyncZipkinSpanHandlerbuild()Builds an async span handler that encodes zipkin spans according to the sender's encoding.AsyncZipkinSpanHandlerbuild(BytesEncoder<brave.handler.MutableSpan> encoder)Builds an async span handler that encodes zipkin spans according to the encoder.AsyncZipkinSpanHandler.BuildercloseTimeout(long timeout, TimeUnit unit)AsyncZipkinSpanHandler.BuildererrorTag(brave.Tag<Throwable> errorTag)Sets the "error" tag when absent andMutableSpan.error()is present.AsyncZipkinSpanHandler.BuildermessageMaxBytes(int messageMaxBytes)AsyncZipkinSpanHandler.BuildermessageTimeout(long timeout, TimeUnit unit)AsyncZipkinSpanHandler.Buildermetrics(ReporterMetrics metrics)AsyncZipkinSpanHandler.BuilderqueuedMaxBytes(int queuedMaxBytes)Deprecated.This will be removed in version 4.0.AsyncZipkinSpanHandler.BuilderqueuedMaxSpans(int queuedMaxSpans)AsyncZipkinSpanHandler.BuilderthreadFactory(ThreadFactory threadFactory)
-
-
-
Method Detail
-
threadFactory
public AsyncZipkinSpanHandler.Builder threadFactory(ThreadFactory threadFactory)
- Since:
- 2.14
- See Also:
AsyncReporter.Builder.threadFactory(ThreadFactory)
-
metrics
public AsyncZipkinSpanHandler.Builder metrics(ReporterMetrics metrics)
- Since:
- 2.14
- See Also:
AsyncReporter.Builder.metrics(ReporterMetrics)
-
messageMaxBytes
public AsyncZipkinSpanHandler.Builder messageMaxBytes(int messageMaxBytes)
- Since:
- 2.14
- See Also:
AsyncReporter.Builder.messageMaxBytes(int)
-
messageTimeout
public AsyncZipkinSpanHandler.Builder messageTimeout(long timeout, TimeUnit unit)
- Since:
- 2.14
- See Also:
AsyncReporter.Builder.messageTimeout(long, TimeUnit)
-
closeTimeout
public AsyncZipkinSpanHandler.Builder closeTimeout(long timeout, TimeUnit unit)
- Since:
- 2.14
- See Also:
AsyncReporter.Builder.closeTimeout(long, TimeUnit)
-
queuedMaxSpans
public AsyncZipkinSpanHandler.Builder queuedMaxSpans(int queuedMaxSpans)
- Since:
- 2.14
- See Also:
AsyncReporter.Builder.queuedMaxSpans(int)
-
queuedMaxBytes
@Deprecated public AsyncZipkinSpanHandler.Builder queuedMaxBytes(int queuedMaxBytes)
Deprecated.This will be removed in version 4.0. UsequeuedMaxSpans(int)instead.Maximum backlog of span bytes reported vs sent. Disabled by default
-
errorTag
public AsyncZipkinSpanHandler.Builder errorTag(brave.Tag<Throwable> errorTag)
Description copied from class:ZipkinSpanHandler.BuilderSets the "error" tag when absent andMutableSpan.error()is present.Note: Zipkin format uses the "error" tag, but alternative formats may have a different tag name or a field entirely. Hence, we only create the "error" tag here, and only if not previously set.
- Overrides:
errorTagin classZipkinSpanHandler.Builder
-
alwaysReportSpans
public AsyncZipkinSpanHandler.Builder alwaysReportSpans(boolean alwaysReportSpans)
Description copied from class:ZipkinSpanHandler.BuilderWhen true, all spanssampled locallyare reported to the span reporter, even if they aren't sampled remotely. Defaults tofalse.The primary use case is to implement a sampling overlay, such as boosting the sample rate for a subset of the network depending on the value of a baggage field. This means that data will report when either the trace is normally sampled, or secondarily sampled via a custom header.
This is simpler than a custom
SpanHandler, because you don't have to duplicate transport mechanics already implemented in thespan reporter. However, this assumes your backend can properly process the partial traces implied when using conditional sampling. For example, if your sampling condition is not consistent on a call tree, the resulting data could appear broken.- Overrides:
alwaysReportSpansin classZipkinSpanHandler.Builder- See Also:
SamplingFlags.sampledLocal()
-
build
public AsyncZipkinSpanHandler build()
Builds an async span handler that encodes zipkin spans according to the sender's encoding.- Specified by:
buildin classZipkinSpanHandler.Builder
-
build
public AsyncZipkinSpanHandler build(BytesEncoder<brave.handler.MutableSpan> encoder)
Builds an async span handler that encodes zipkin spans according to the encoder.Note: The input encoder must use the same error tag implementation as configured by
errorTag(Tag).- Since:
- 3.1
-
-