Interface Tracer


public interface Tracer
A class with Datadog tracer features.
  • 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

      boolean addTraceInterceptor(TraceInterceptor traceInterceptor)
      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 boolean 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:
      true if asynchronous propagation is enabled, false otherwise.
    • setAsyncPropagationEnabled

      @Deprecated void setAsyncPropagationEnabled(boolean asyncPropagationEnabled)
      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 - true to enable asynchronous propagation, false to disable it.