Package io.opentelemetry.sdk.trace
Class SdkTracer
- java.lang.Object
-
- io.opentelemetry.sdk.trace.SdkTracer
-
- All Implemented Interfaces:
ExtendedTracer
,Tracer
final class SdkTracer extends java.lang.Object implements ExtendedTracer
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
FALLBACK_SPAN_NAME
private InstrumentationScopeInfo
instrumentationScopeInfo
private static Tracer
NOOP_TRACER
private TracerSharedState
sharedState
private boolean
tracerEnabled
-
Constructor Summary
Constructors Constructor Description SdkTracer(TracerSharedState sharedState, InstrumentationScopeInfo instrumentationScopeInfo, TracerConfig tracerConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) InstrumentationScopeInfo
getInstrumentationScopeInfo()
boolean
isEnabled()
Returnstrue
if the tracer is enabled.SpanBuilder
spanBuilder(java.lang.String spanName)
Returns aSpanBuilder
to create and start a newSpan
.
-
-
-
Field Detail
-
FALLBACK_SPAN_NAME
static final java.lang.String FALLBACK_SPAN_NAME
- See Also:
- Constant Field Values
-
NOOP_TRACER
private static final Tracer NOOP_TRACER
-
sharedState
private final TracerSharedState sharedState
-
instrumentationScopeInfo
private final InstrumentationScopeInfo instrumentationScopeInfo
-
tracerEnabled
private boolean tracerEnabled
-
-
Constructor Detail
-
SdkTracer
SdkTracer(TracerSharedState sharedState, InstrumentationScopeInfo instrumentationScopeInfo, TracerConfig tracerConfig)
-
-
Method Detail
-
spanBuilder
public SpanBuilder spanBuilder(java.lang.String spanName)
Description copied from interface:Tracer
- Specified by:
spanBuilder
in interfaceTracer
- Parameters:
spanName
- The name of the returned Span.- Returns:
- a
Span.Builder
to create and start a newSpan
.
-
getInstrumentationScopeInfo
InstrumentationScopeInfo getInstrumentationScopeInfo()
-
isEnabled
public boolean isEnabled()
Description copied from interface:ExtendedTracer
Returnstrue
if the tracer is enabled.This allows callers to avoid unnecessary compute when nothing is consuming the data. Because the response is subject to change over the application, callers should call this before each call to
Tracer.spanBuilder(String)
.- Specified by:
isEnabled
in interfaceExtendedTracer
-
-