Interface SpanScope

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
NoopSpanScope

public interface SpanScope extends AutoCloseable
An auto-closeable that represents scope of the span. It provides interface for all the span operations.
  • Field Details

    • NO_OP

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

    • addSpanAttribute

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

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

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

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

      void addSpanEvent(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