Interface ScopedSpan


public interface ScopedSpan
Represents the "current span" until end() ()} is called.
Since:
1.0.0
  • Field Details

    • NOOP

      static final ScopedSpan NOOP
      A noop implementation.
  • Method Details

    • isNoop

      boolean isNoop()
      Returns:
      true when no recording is done and nothing is reported to an external system. However, this span should still be injected into outgoing requests. Use this flag to avoid performing expensive computation.
    • context

      TraceContext context()
      Returns:
      TraceContext corresponding to this span.
    • name

      ScopedSpan name(String name)
      Sets a name on this span.
      Parameters:
      name - name to set on the span
      Returns:
      this span
    • tag

      ScopedSpan tag(String key, String value)
      Sets a tag on this span.
      Parameters:
      key - tag key
      value - tag value
      Returns:
      this span
    • event

      ScopedSpan event(String value)
      Sets an event on this span.
      Parameters:
      value - event name to set on the span
      Returns:
      this span
    • error

      ScopedSpan error(Throwable throwable)
      Records an exception for this span.
      Parameters:
      throwable - to record
      Returns:
      this span
    • end

      void end()
      Ends the span. The span gets stopped and recorded if not noop.