opentelemetry-java-instrume.../dd-trace-api/src/main/java/datadog/trace/context/TraceScope.java

29 lines
712 B
Java

package datadog.trace.context;
/** An object when can propagate a datadog trace across multiple threads. */
public interface TraceScope {
/**
* Prevent the trace attached to this TraceScope from reporting until the returned Continuation
* finishes.
*
* <p>Should be called on the parent thread.
*/
Continuation capture();
/** Close the activated context and allow any underlying spans to finish. */
void close();
/** Used to pass async context between workers. */
interface Continuation {
/**
* Activate the continuation.
*
* <p>Should be called on the child thread.
*/
TraceScope activate();
/** Cancel the continuation. */
void close();
}
}