Class NoopScopedSpan

java.lang.Object
org.opensearch.telemetry.tracing.noop.NoopScopedSpan
All Implemented Interfaces:
AutoCloseable, ScopedSpan

@InternalApi public final class NoopScopedSpan extends Object implements ScopedSpan
No-op implementation of SpanScope
Opensearch.internal:
  • Constructor Details

    • NoopScopedSpan

      public NoopScopedSpan()
      No-args constructor
  • Method Details

    • addAttribute

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

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

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

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

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

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

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