Interface ScopedSpan

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
NoopScopedSpan

@ExperimentalApi public interface ScopedSpan extends AutoCloseable
An auto-closeable that represents scoped span. It provides interface for all the span operations.
Opensearch.experimental:
  • Field Details

    • NO_OP

      static final ScopedSpan NO_OP
      No-op Scope implementation
  • Method Details

    • addAttribute

      void addAttribute(String key, String value)
      Adds string attribute to the Span.
      Parameters:
      key - attribute key
      value - attribute value
    • addAttribute

      void addAttribute(String key, long value)
      Adds long attribute to the Span.
      Parameters:
      key - attribute key
      value - attribute value
    • addAttribute

      void addAttribute(String key, double value)
      Adds double attribute to the Span.
      Parameters:
      key - attribute key
      value - attribute value
    • addAttribute

      void addAttribute(String key, boolean value)
      Adds boolean attribute to the Span.
      Parameters:
      key - attribute key
      value - attribute value
    • addEvent

      void addEvent(String event)
      Adds an event to the Span.
      Parameters:
      event - event name
    • setError

      void setError(Exception exception)
      Records error in the span
      Parameters:
      exception - exception to be recorded
    • close

      void close()
      closes the scope
      Specified by:
      close in interface AutoCloseable