Class ZipkinSpanHandler.Builder
- java.lang.Object
-
- zipkin2.reporter.brave.ZipkinSpanHandler.Builder
-
- Direct Known Subclasses:
AsyncZipkinSpanHandler.Builder
- Enclosing class:
- ZipkinSpanHandler
public abstract static class ZipkinSpanHandler.Builder extends Object
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ZipkinSpanHandler.BuilderalwaysReportSpans(boolean alwaysReportSpans)When true, all spanssampled locallyare reported to the span reporter, even if they aren't sampled remotely.abstract brave.handler.SpanHandlerbuild()ZipkinSpanHandler.BuildererrorTag(brave.Tag<Throwable> errorTag)Sets the "error" tag when absent andMutableSpan.error()is present.
-
-
-
Method Detail
-
errorTag
public ZipkinSpanHandler.Builder errorTag(brave.Tag<Throwable> errorTag)
Sets 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.
- Since:
- 2.13
-
alwaysReportSpans
public ZipkinSpanHandler.Builder alwaysReportSpans(boolean alwaysReportSpans)
When 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.- Since:
- 2.13
- See Also:
SamplingFlags.sampledLocal()
-
build
public abstract brave.handler.SpanHandler build()
-
-