Interface TraceScope

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
NoopTraceScope

public interface TraceScope extends Closeable
An object which can propagate a datadog trace across multiple threads.
  • Method Details

    • close

      void close()
      Close the activated context and allow any underlying spans to finish.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • capture

      Deprecated.
      Replaced by Tracer.captureActiveSpan().

      When asynchronous propagation is enabled, prevent the currently active trace, which may differ from this scope instance, from reporting until the returned Continuation is either activated (and the returned scope is closed) or the continuation is canceled. Should be called on the parent thread.

      Returns:
      Continuation of the active span, no-op continuation if there's no active span or asynchronous propagation is disabled.
    • captureConcurrent

      @Deprecated default TraceScope.Continuation captureConcurrent()
      Deprecated.
      Replaced by capture().hold().
    • isAsyncPropagating

      @Deprecated default boolean isAsyncPropagating()
      Deprecated.
      Replaced by Tracer.isAsyncPropagationEnabled().

      Calling this method will check whether asynchronous propagation is enabled for the active scope, not this scope instance.

      Returns:
      true if asynchronous propagation is enabled for the active scope, false otherwise.
    • setAsyncPropagation

      @Deprecated default void setAsyncPropagation(boolean value)
      Deprecated.
      Replaced by Tracer.setAsyncPropagationEnabled(boolean)}.

      Calling this method will enable or disable asynchronous propagation for the active scope, not this scope instance.

      Parameters:
      value - true to enable asynchronous propagation, false to disable it.