Class ZipkinSpanHandler.Builder

    • Method Detail

      • errorTag

        public ZipkinSpanHandler.Builder errorTag​(brave.Tag<Throwable> errorTag)
        Sets the "error" tag when absent and MutableSpan.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 spans sampled locally are reported to the span reporter, even if they aren't sampled remotely. Defaults to false.

        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 the span 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()