-
- All Implemented Interfaces:
-
com.datadog.trace.api.EndpointCheckpointer,com.datadog.trace.api.Tracer,com.datadog.trace.api.internal.InternalTracer,com.datadog.trace.bootstrap.instrumentation.api.AgentTracer.TracerAPI,com.datadog.trace.bootstrap.instrumentation.api.ScopeStateAware
public class CoreTracer implements AgentTracer.TracerAPI
Main entrypoint into the tracer implementation. In addition to implementing com.datadog.trace.api.Tracer and TracerAPI, it coordinates many functions necessary creating, reporting, and propagating traces
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classCoreTracer.CoreTracerBuilderpublic classCoreTracer.CoreSpanBuilderSpans are built using this builder
-
Field Summary
Fields Modifier and Type Field Description private final intpartialFlushMinSpansprivate Timertimerprivate final TagInterceptortagInterceptor
-
Method Summary
Modifier and Type Method Description intgetPartialFlushMinSpans()TimergetTimer()TagInterceptorgetTagInterceptor()CoreTracer.ConfigSnapshotcaptureTraceConfig()voidonRootSpanFinished(AgentSpan root, EndpointTracker tracker)Callback to be called when a root span is written (together with the trace) EndpointTrackeronRootSpanStarted(AgentSpan root)Callback to be called when a root span is started ScopeStatenewScopeState()CoreTracer.CoreSpanBuilderbuildSpan(String instrumentationName, CharSequence operationName)AgentSpanstartSpan(String instrumentationName, CharSequence spanName)Create and start a new span. AgentSpanstartSpan(String instrumentationName, CharSequence spanName, long startTimeMicros)Create and start a new span with a given start time. AgentSpanstartSpan(String instrumentationName, CharSequence spanName, AgentSpan.Context parent)Create and start a new span with an explicit parent. AgentSpanstartSpan(String instrumentationName, CharSequence spanName, AgentSpan.Context parent, long startTimeMicros)Create and start a new span with an explicit parent and a given start time. AgentScopeactivateSpan(AgentSpan span)AgentScopeactivateSpan(AgentSpan span, ScopeSource source)AgentScopeactivateSpan(AgentSpan span, ScopeSource source, boolean isAsyncPropagating)AgentScope.ContinuationcaptureSpan(AgentSpan span)voidclosePrevious(boolean finishSpan)AgentScopeactivateNext(AgentSpan span)AgentSpanactiveSpan()AgentScopeactiveScope()AgentPropagationpropagate()AgentSpannoopSpan()StringgetTraceId()Get the trace id of the active trace. StringgetSpanId()Get the span id of the active span of the active trace. StringgetTraceId(AgentSpan span)StringgetSpanId(AgentSpan span)voidaddScopeListener(ScopeListener listener)Attach a scope listener to the global scope manager voidregisterCheckpointer(EndpointCheckpointer implementation)Registers the checkpointer voidregisterTimer(Timer timer)voidclose()voidflush()ProfilingContextIntegrationgetProfilingContext()-
Methods inherited from class com.datadog.trace.bootstrap.instrumentation.api.AgentTracer.TracerAPI
activateSpan, addScopeListener, buildSpan, buildSpan, captureSpan, captureTraceConfig, registerCheckpointer, startSpan, startSpan, startSpan, startSpan -
Methods inherited from class com.datadog.trace.api.EndpointCheckpointer
onRootSpanFinished, onRootSpanStarted -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getPartialFlushMinSpans
int getPartialFlushMinSpans()
-
getTagInterceptor
TagInterceptor getTagInterceptor()
-
captureTraceConfig
CoreTracer.ConfigSnapshot captureTraceConfig()
-
onRootSpanFinished
void onRootSpanFinished(AgentSpan root, EndpointTracker tracker)
Callback to be called when a root span is written (together with the trace)
- Parameters:
tracker- the endpoint tracker
-
onRootSpanStarted
EndpointTracker onRootSpanStarted(AgentSpan root)
Callback to be called when a root span is started
-
newScopeState
ScopeState newScopeState()
-
buildSpan
CoreTracer.CoreSpanBuilder buildSpan(String instrumentationName, CharSequence operationName)
-
startSpan
AgentSpan startSpan(String instrumentationName, CharSequence spanName)
Create and start a new span.
- Parameters:
instrumentationName- The instrumentation creating the span.spanName- The span operation name.
-
startSpan
AgentSpan startSpan(String instrumentationName, CharSequence spanName, long startTimeMicros)
Create and start a new span with a given start time.
- Parameters:
instrumentationName- The instrumentation creating the span.spanName- The span operation name.startTimeMicros- The span start time, in microseconds.
-
startSpan
AgentSpan startSpan(String instrumentationName, CharSequence spanName, AgentSpan.Context parent)
Create and start a new span with an explicit parent.
- Parameters:
instrumentationName- The instrumentation creating the span.spanName- The span operation name.parent- The parent span context.
-
startSpan
AgentSpan startSpan(String instrumentationName, CharSequence spanName, AgentSpan.Context parent, long startTimeMicros)
Create and start a new span with an explicit parent and a given start time.
- Parameters:
instrumentationName- The instrumentation creating the span.spanName- The span operation name.parent- The parent span context.startTimeMicros- The span start time, in microseconds.
-
activateSpan
AgentScope activateSpan(AgentSpan span)
-
activateSpan
AgentScope activateSpan(AgentSpan span, ScopeSource source)
-
activateSpan
AgentScope activateSpan(AgentSpan span, ScopeSource source, boolean isAsyncPropagating)
-
captureSpan
AgentScope.Continuation captureSpan(AgentSpan span)
-
closePrevious
void closePrevious(boolean finishSpan)
-
activateNext
AgentScope activateNext(AgentSpan span)
-
activeSpan
AgentSpan activeSpan()
-
activeScope
AgentScope activeScope()
-
propagate
AgentPropagation propagate()
-
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.
-
getTraceId
String getTraceId(AgentSpan span)
-
addScopeListener
void addScopeListener(ScopeListener listener)
Attach a scope listener to the global scope manager
- Parameters:
listener- listener to attach
-
registerCheckpointer
void registerCheckpointer(EndpointCheckpointer implementation)
Registers the checkpointer
-
registerTimer
void registerTimer(Timer timer)
-
close
void close()
-
flush
void flush()
-
getProfilingContext
ProfilingContextIntegration getProfilingContext()
-
-
-
-