Package io.opentelemetry.sdk.trace
Class SdkTracer
java.lang.Object
io.opentelemetry.sdk.trace.SdkTracer
- All Implemented Interfaces:
ExtendedTracer
,Tracer
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String
private final InstrumentationScopeInfo
private static final Tracer
private final TracerSharedState
private boolean
-
Constructor Summary
ConstructorsConstructorDescriptionSdkTracer
(TracerSharedState sharedState, InstrumentationScopeInfo instrumentationScopeInfo, TracerConfig tracerConfig) -
Method Summary
Modifier and TypeMethodDescription(package private) InstrumentationScopeInfo
boolean
Returnstrue
if the tracer is enabled.spanBuilder
(String spanName) Returns aSpanBuilder
to create and start a newSpan
.
-
Field Details
-
FALLBACK_SPAN_NAME
- See Also:
-
NOOP_TRACER
-
instrumentationScopeInfo
-
tracerEnabled
private boolean tracerEnabled
-
-
Constructor Details
-
Method Details
-
spanBuilder
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
-