Class BraveSpan

  • All Implemented Interfaces:
    io.opentracing.Span

    public final class BraveSpan
    extends Object
    implements io.opentracing.Span
    Holds the Span used by the underlying Tracer.

    This type also includes hooks to integrate with the underlying Tracer. Ex you can access the underlying span with unwrap()

    Operations to add data to the span are ignored once finish() or finish(long) are called.

    • Method Detail

      • unwrap

        public final brave.Span unwrap()
        Returns wrapped Span
      • context

        public BraveSpanContext context()
        Specified by:
        context in interface io.opentracing.Span
      • setTag

        public BraveSpan setTag​(String key,
                                String value)
        Specified by:
        setTag in interface io.opentracing.Span
      • setTag

        public BraveSpan setTag​(String key,
                                boolean value)
        Specified by:
        setTag in interface io.opentracing.Span
      • setTag

        public BraveSpan setTag​(String key,
                                Number value)
        Note:If the key is Tags.SAMPLING_PRIORITY and the value is zero, the current span will be abandoned and future references to the context() will be unsampled. This does not affect the active span, nor does it affect any equivalent instances of this object. This is a best efforts means to handle late sampling decisions.
        Specified by:
        setTag in interface io.opentracing.Span
      • setTag

        public <T> BraveSpan setTag​(io.opentracing.tag.Tag<T> tag,
                                    T value)
        Specified by:
        setTag in interface io.opentracing.Span
      • log

        public BraveSpan log​(Map<String,​?> fields)
        Specified by:
        log in interface io.opentracing.Span
      • log

        public BraveSpan log​(long timestampMicroseconds,
                             Map<String,​?> fields)
        Specified by:
        log in interface io.opentracing.Span
      • log

        public BraveSpan log​(String event)
        Specified by:
        log in interface io.opentracing.Span
      • log

        public BraveSpan log​(long timestampMicroseconds,
                             String event)
        Specified by:
        log in interface io.opentracing.Span
      • setBaggageItem

        public BraveSpan setBaggageItem​(String key,
                                        String value)
        This is a NOOP unless BaggagePropagation is in use
        Specified by:
        setBaggageItem in interface io.opentracing.Span
      • getBaggageItem

        public String getBaggageItem​(String key)
        Returns null unless BaggagePropagation is in use
        Specified by:
        getBaggageItem in interface io.opentracing.Span
      • setOperationName

        public BraveSpan setOperationName​(String operationName)
        Specified by:
        setOperationName in interface io.opentracing.Span
      • finish

        public void finish()
        Specified by:
        finish in interface io.opentracing.Span
      • finish

        public void finish​(long finishMicros)
        Specified by:
        finish in interface io.opentracing.Span
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object