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.StringFALLBACK_SPAN_NAMEprivate InstrumentationScopeInfoinstrumentationScopeInfoprivate static TracerNOOP_TRACERprivate TracerSharedStatesharedStateprivate booleantracerEnabled
-
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) InstrumentationScopeInfogetInstrumentationScopeInfo()booleanisEnabled()Returnstrueif the tracer is enabled.SpanBuilderspanBuilder(java.lang.String spanName)Returns aSpanBuilderto 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:
spanBuilderin interfaceTracer- Parameters:
spanName- The name of the returned Span.- Returns:
- a
Span.Builderto create and start a newSpan.
-
getInstrumentationScopeInfo
InstrumentationScopeInfo getInstrumentationScopeInfo()
-
isEnabled
public boolean isEnabled()
Description copied from interface:ExtendedTracerReturnstrueif 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:
isEnabledin interfaceExtendedTracer
-
-