Class AsyncZipkinSpanHandler.Builder

    • Method Detail

      • messageMaxBytes

        public AsyncZipkinSpanHandler.Builder messageMaxBytes​(int messageMaxBytes)
        Since:
        2.14
        See Also:
        AsyncReporter.Builder.messageMaxBytes(int)
      • queuedMaxSpans

        public AsyncZipkinSpanHandler.Builder queuedMaxSpans​(int queuedMaxSpans)
        Since:
        2.14
        See Also:
        AsyncReporter.Builder.queuedMaxSpans(int)
      • alwaysReportSpans

        public AsyncZipkinSpanHandler.Builder alwaysReportSpans​(boolean alwaysReportSpans)
        Description copied from class: ZipkinSpanHandler.Builder
        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.

        Overrides:
        alwaysReportSpans in class ZipkinSpanHandler.Builder
        See Also:
        SamplingFlags.sampledLocal()
      • 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