Class BraveSpan

java.lang.Object
brave.opentracing.BraveSpan
All Implemented Interfaces:
io.opentracing.Span

public final class BraveSpan
extends java.lang.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 Summary

    Modifier and Type Method Description
    BraveSpanContext context()  
    boolean equals​(java.lang.Object o)  
    void finish()  
    void finish​(long finishMicros)  
    java.lang.String getBaggageItem​(java.lang.String key)
    Returns null unless BaggagePropagation is in use
    int hashCode()  
    BraveSpan log​(long timestampMicroseconds, java.lang.String event)  
    BraveSpan log​(long timestampMicroseconds, java.util.Map<java.lang.String,​?> fields)  
    BraveSpan log​(java.lang.String event)  
    BraveSpan log​(java.util.Map<java.lang.String,​?> fields)  
    BraveSpan setBaggageItem​(java.lang.String key, java.lang.String value)
    This is a NOOP unless BaggagePropagation is in use
    BraveSpan setOperationName​(java.lang.String operationName)  
    <T> BraveSpan setTag​(io.opentracing.tag.Tag<T> tag, T value)  
    BraveSpan setTag​(java.lang.String key, boolean value)  
    BraveSpan setTag​(java.lang.String key, java.lang.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.
    BraveSpan setTag​(java.lang.String key, java.lang.String value)  
    java.lang.String toString()  
    brave.Span unwrap()
    Returns wrapped Span

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • 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​(java.lang.String key, java.lang.String value)
      Specified by:
      setTag in interface io.opentracing.Span
    • setTag

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

      public BraveSpan setTag​(java.lang.String key, java.lang.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​(java.util.Map<java.lang.String,​?> fields)
      Specified by:
      log in interface io.opentracing.Span
    • log

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

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

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

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

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

      public BraveSpan setOperationName​(java.lang.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
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • equals

      public final boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class java.lang.Object