Class NoopSpanScope

java.lang.Object
org.opensearch.telemetry.tracing.noop.NoopSpanScope
All Implemented Interfaces:
AutoCloseable, SpanScope

public final class NoopSpanScope extends Object implements SpanScope
No-op implementation of SpanScope
Opensearch.internal:
  • Constructor Details

    • NoopSpanScope

      public NoopSpanScope()
      No-args constructor
  • Method Details

    • addSpanAttribute

      public void addSpanAttribute(String key, String value)
      Description copied from interface: SpanScope
      Adds string attribute to the Span.
      Specified by:
      addSpanAttribute in interface SpanScope
      Parameters:
      key - attribute key
      value - attribute value
    • addSpanAttribute

      public void addSpanAttribute(String key, long value)
      Description copied from interface: SpanScope
      Adds long attribute to the Span.
      Specified by:
      addSpanAttribute in interface SpanScope
      Parameters:
      key - attribute key
      value - attribute value
    • addSpanAttribute

      public void addSpanAttribute(String key, double value)
      Description copied from interface: SpanScope
      Adds double attribute to the Span.
      Specified by:
      addSpanAttribute in interface SpanScope
      Parameters:
      key - attribute key
      value - attribute value
    • addSpanAttribute

      public void addSpanAttribute(String key, boolean value)
      Description copied from interface: SpanScope
      Adds boolean attribute to the Span.
      Specified by:
      addSpanAttribute in interface SpanScope
      Parameters:
      key - attribute key
      value - attribute value
    • addSpanEvent

      public void addSpanEvent(String event)
      Description copied from interface: SpanScope
      Adds an event to the Span.
      Specified by:
      addSpanEvent in interface SpanScope
      Parameters:
      event - event name
    • setError

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

      public void close()
      Description copied from interface: SpanScope
      closes the scope
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface SpanScope