Class ThreadLocalSpan

java.lang.Object
io.micrometer.tracing.ThreadLocalSpan

public class ThreadLocalSpan extends Object
Represents a Span stored in thread local.
Since:
1.0.0
  • Constructor Details

    • ThreadLocalSpan

      public ThreadLocalSpan(Tracer tracer)
      Creates a new instance of ThreadLocalSpan.
      Parameters:
      tracer - tracer
  • Method Details

    • set

      public void set(Span span)
      Sets given span and scope.
      Parameters:
      span - - span to be put in scope
    • get

      public SpanAndScope get()
      Returns the currently stored span and scope.
      Returns:
      span and scope
    • remove

      public SpanAndScope remove()
      Removes the current span from thread local and brings back the previous span to the current thread local.
      Returns:
      removed span of null if there was none