Interface Span

All Superinterfaces:
AutoCloseable

public interface Span extends AutoCloseable
Represents a span in a trace.
  • Method Details

    • close

      void close()
      Close the span.
      Specified by:
      close in interface AutoCloseable
    • setStatus

      Span setStatus(Span.Status status, String description)
      Set the status of this span with a description.
      Parameters:
      status - the status
      description - the description of the status
      Returns:
      this
    • setStatus

      default Span setStatus(Span.Status status)
      Set the status of this span.
      Parameters:
      status - the status
      Returns:
      this
    • recordException

      Span recordException(Throwable throwable)
      Record an exception in this span.
      Parameters:
      throwable - the throwable to record
      Returns:
      this
    • setError

      default Span setError(Throwable throwable)
      Set the status of this span to ERROR and record the exception. The description of the status will be set to the exception message.
      Parameters:
      throwable - the throwable to record
      Returns:
      this
    • setAttribute

      Span setAttribute(String key, String value)
      Set a String attribute.
      Parameters:
      key - The attribute key
      value - the attribute value
      Returns:
      this
    • setAttribute

      Span setAttribute(String key, boolean value)
      Set a boolean attribute.
      Parameters:
      key - The attribute key
      value - the attribute value
      Returns:
      this
    • setAttribute

      Span setAttribute(String key, long value)
      Set a long attribute.
      Parameters:
      key - The attribute key
      value - the attribute value
      Returns:
      this
    • setAttribute

      Span setAttribute(String key, double value)
      Set a double attribute.
      Parameters:
      key - The attribute key
      value - the attribute value
      Returns:
      this