-
- All Implemented Interfaces:
-
com.datadog.trace.api.EndpointCheckpointer,com.datadog.trace.bootstrap.instrumentation.api.AgentTracer.TracerAPI
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 final TagInterceptortagInterceptor
-
Method Summary
Modifier and Type Method Description intgetPartialFlushMinSpans()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 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)AgentSpanactiveSpan()AgentPropagationpropagate()StringgetTraceId()StringgetSpanId()StringgetTraceId(AgentSpan span)StringgetSpanId(AgentSpan span)voidaddScopeListener(ScopeListener listener)Attach a scope listener to the global scope manager voidclose()voidflush()-
Methods inherited from class com.datadog.trace.bootstrap.instrumentation.api.AgentTracer.TracerAPI
activateSpan, addScopeListener, buildSpan, buildSpan, captureTraceConfig, 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
-
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)
-
activeSpan
AgentSpan activeSpan()
-
propagate
AgentPropagation propagate()
-
getTraceId
String getTraceId()
-
getTraceId
String getTraceId(AgentSpan span)
-
addScopeListener
void addScopeListener(ScopeListener listener)
Attach a scope listener to the global scope manager
- Parameters:
listener- listener to attach
-
close
void close()
-
flush
void flush()
-
-
-
-