Package datadog.trace.context
Interface TraceScope
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
NoopTraceScope
An object which can propagate a datadog trace across multiple threads.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceUsed to pass async context between workers. -
Method Summary
Modifier and TypeMethodDescriptiondefault TraceScope.Continuationcapture()Deprecated.default TraceScope.ContinuationDeprecated.Replaced bycapture().hold().voidclose()Close the activated context and allow any underlying spans to finish.default booleanDeprecated.Replaced byTracer.isAsyncPropagationEnabled().default voidsetAsyncPropagation(boolean value) Deprecated.Replaced byTracer.setAsyncPropagationEnabled(boolean)}.
-
Method Details
-
close
void close()Close the activated context and allow any underlying spans to finish.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
capture
Deprecated.Replaced byTracer.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.Replaced bycapture().hold(). -
isAsyncPropagating
Deprecated.Replaced byTracer.isAsyncPropagationEnabled().Calling this method will check whether asynchronous propagation is enabled for the active scope, not this scope instance.
- Returns:
trueif asynchronous propagation is enabled for the active scope,falseotherwise.
-
setAsyncPropagation
Deprecated.Replaced byTracer.setAsyncPropagationEnabled(boolean)}.Calling this method will enable or disable asynchronous propagation for the active scope, not this scope instance.
- Parameters:
value-trueto enable asynchronous propagation,falseto disable it.
-
Tracer.captureActiveSpan().