Class ThreadLocalSpan

java.lang.Object
org.springframework.cloud.sleuth.ThreadLocalSpan

public class ThreadLocalSpan extends Object
Represents a Span stored in thread local.
Since:
3.1.0
Author:
Marcin Grzejszczak
  • Constructor Details

    • ThreadLocalSpan

      public ThreadLocalSpan(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:
      currently stored span and scope
    • remove

      public void remove()
      Removes the current span from thread local and brings back the previous span to the current thread local.