-
public class GlobalDatadogTracerA holder object for managing and retrieving a global instance of the DatadogTracer.
This object is used to share same instance of DatadogTracer across different integrations such as
OkHttp, Kotlin's coroutines, ect.
-
-
Field Summary
Fields Modifier and Type Field Description public final static GlobalDatadogTracerINSTANCE
-
Method Summary
Modifier and Type Method Description final static BooleanregisterIfAbsent(DatadogTracerĀ tracer)Registers the provided tracer as the global tracer if no tracer is currently registered. final static DatadogTracerget()Retrieves the current active tracer for Datadog, or a no-operation tracer if none is active. final DatadogTracergetOrNull()Retrieves the current instance of the DatadogTracer, if available. final Unitclear()Clears the current instance of the global Datadog tracer. -
-
Method Detail
-
registerIfAbsent
final static Boolean registerIfAbsent(DatadogTracerĀ tracer)
Registers the provided tracer as the global tracer if no tracer is currently registered.
- Parameters:
tracer- The tracer to register as the global tracer.
-
get
final static DatadogTracer get()
Retrieves the current active tracer for Datadog, or a no-operation tracer if none is active.
-
getOrNull
final DatadogTracer getOrNull()
Retrieves the current instance of the DatadogTracer, if available.
-
-
-
-