Package datadog.trace.api
Interface Tracer
public interface Tracer
A class with Datadog tracer features.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddTraceInterceptor(TraceInterceptor traceInterceptor) Add a new interceptor to the tracer.Deprecated.Unstable API.Get the span id of the active span of the active trace.Get the trace id of the active trace.booleanDeprecated.Unstable API.voidsetAsyncPropagationEnabled(boolean asyncPropagationEnabled) Deprecated.Unstable API.
-
Method Details
-
getTraceId
String getTraceId()Get the trace id of the active trace. Returns 0 if there is no active trace. -
getSpanId
String getSpanId()Get the span id of the active span of the active trace. Returns 0 if there is no active trace. -
addTraceInterceptor
Add a new interceptor to the tracer. Interceptors with duplicate priority to existing ones are ignored.- Parameters:
traceInterceptor-- Returns:
- false if an interceptor with same priority exists.
-
muteTracing
TraceScope muteTracing() -
captureActiveSpan
Deprecated.Unstable API. Might be removed at any time.When asynchronous propagation is enabled, prevent the currently active trace 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.
-
isAsyncPropagationEnabled
Deprecated.Unstable API. Might be removed at any time.Checks whether asynchronous propagation is enabled, meaning this context will propagate across asynchronous boundaries.- Returns:
trueif asynchronous propagation is enabled,falseotherwise.
-
setAsyncPropagationEnabled
Deprecated.Unstable API. Might be removed at any time.Enables or disables asynchronous propagation for the active span.Asynchronous propagation is enabled by default from
ConfigDefaults.DEFAULT_ASYNC_PROPAGATING.- Parameters:
asyncPropagationEnabled-trueto enable asynchronous propagation,falseto disable it.
-