Class NoopSpan

java.lang.Object
org.opensearch.telemetry.tracing.noop.NoopSpan
All Implemented Interfaces:
Span

@InternalApi public class NoopSpan extends Object implements Span
No-op implementation of Span
Opensearch.internal:
  • Field Details

    • INSTANCE

      public static final NoopSpan INSTANCE
      No-op Span instance
  • Method Details

    • endSpan

      public void endSpan()
      Description copied from interface: Span
      Ends the span
      Specified by:
      endSpan in interface Span
    • getParentSpan

      public Span getParentSpan()
      Description copied from interface: Span
      Returns span's parent span
      Specified by:
      getParentSpan in interface Span
    • getSpanName

      public String getSpanName()
      Description copied from interface: Span
      Returns the name of the Span
      Specified by:
      getSpanName in interface Span
    • addAttribute

      public void addAttribute(String key, String value)
      Description copied from interface: Span
      Adds string type attribute in the span
      Specified by:
      addAttribute in interface Span
      Parameters:
      key - of the attribute
      value - value of the attribute
    • addAttribute

      public void addAttribute(String key, Long value)
      Description copied from interface: Span
      Adds long type attribute in the span
      Specified by:
      addAttribute in interface Span
      Parameters:
      key - of the attribute
      value - value of the attribute
    • addAttribute

      public void addAttribute(String key, Double value)
      Description copied from interface: Span
      Adds double type attribute in the span
      Specified by:
      addAttribute in interface Span
      Parameters:
      key - of the attribute
      value - value of the attribute
    • addAttribute

      public void addAttribute(String key, Boolean value)
      Description copied from interface: Span
      Adds boolean type attribute in the span
      Specified by:
      addAttribute in interface Span
      Parameters:
      key - of the attribute
      value - value of the attribute
    • setError

      public void setError(Exception exception)
      Description copied from interface: Span
      Records error in the span
      Specified by:
      setError in interface Span
      Parameters:
      exception - exception to be recorded
    • addEvent

      public void addEvent(String event)
      Description copied from interface: Span
      Adds an event in the span
      Specified by:
      addEvent in interface Span
      Parameters:
      event - name of the event
    • getTraceId

      public String getTraceId()
      Description copied from interface: Span
      Returns traceId of the span
      Specified by:
      getTraceId in interface Span
      Returns:
      span's traceId
    • getSpanId

      public String getSpanId()
      Description copied from interface: Span
      Returns spanId of the span
      Specified by:
      getSpanId in interface Span
      Returns:
      span's spanId