Class SdkTracerProvider
- java.lang.Object
-
- io.opentelemetry.sdk.trace.SdkTracerProvider
-
- All Implemented Interfaces:
io.opentelemetry.api.trace.TracerProvider,Closeable,AutoCloseable
public final class SdkTracerProvider extends Object implements io.opentelemetry.api.trace.TracerProvider, Closeable
Tracerprovider implementation forTracerProvider.This class is not intended to be used in application code and it is used only by
OpenTelemetry. However, if you need a custom implementation of the factory, you can create one as needed.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SdkTracerProviderBuilderbuilder()Returns a newSdkTracerProviderBuilderforSdkTracerProvider.voidclose()Attempts to stop all the activity for thisTracer.io.opentelemetry.sdk.common.CompletableResultCodeforceFlush()Requests the active span processor to process all span events that have not yet been processed and returns aCompletableResultCodewhich is completed when the flush is finished.io.opentelemetry.api.trace.Tracerget(String instrumentationName)io.opentelemetry.api.trace.Tracerget(String instrumentationName, String instrumentationVersion)SamplergetSampler()Returns the configuredSampler.SpanLimitsgetSpanLimits()Returns theSpanLimitsthat are currently applied to created spans.io.opentelemetry.sdk.common.CompletableResultCodeshutdown()Attempts to stop all the activity for thisTracer.io.opentelemetry.api.trace.TracerBuildertracerBuilder(String instrumentationName)
-
-
-
Method Detail
-
builder
public static SdkTracerProviderBuilder builder()
Returns a newSdkTracerProviderBuilderforSdkTracerProvider.- Returns:
- a new
SdkTracerProviderBuilderforSdkTracerProvider.
-
get
public io.opentelemetry.api.trace.Tracer get(String instrumentationName)
- Specified by:
getin interfaceio.opentelemetry.api.trace.TracerProvider
-
get
public io.opentelemetry.api.trace.Tracer get(String instrumentationName, String instrumentationVersion)
- Specified by:
getin interfaceio.opentelemetry.api.trace.TracerProvider
-
tracerBuilder
public io.opentelemetry.api.trace.TracerBuilder tracerBuilder(@Nullable String instrumentationName)
- Specified by:
tracerBuilderin interfaceio.opentelemetry.api.trace.TracerProvider
-
getSpanLimits
public SpanLimits getSpanLimits()
Returns theSpanLimitsthat are currently applied to created spans.
-
shutdown
public io.opentelemetry.sdk.common.CompletableResultCode shutdown()
Attempts to stop all the activity for thisTracer. CallsSpanProcessor.shutdown()for all registeredSpanProcessors.The returned
CompletableResultCodewill be completed when all the Spans are processed.After this is called, newly created
Spans will be no-ops.After this is called, further attempts at re-using or reconfiguring this instance will result in undefined behavior. It should be considered a terminal operation for the SDK implementation.
- Returns:
- a
CompletableResultCodewhich is completed when all the span processors have been shut down.
-
forceFlush
public io.opentelemetry.sdk.common.CompletableResultCode forceFlush()
Requests the active span processor to process all span events that have not yet been processed and returns aCompletableResultCodewhich is completed when the flush is finished.- See Also:
SpanProcessor.forceFlush()
-
close
public void close()
Attempts to stop all the activity for thisTracer. CallsSpanProcessor.shutdown()for all registeredSpanProcessors.This operation may block until all the Spans are processed. Must be called before turning off the main application to ensure all data are processed and exported.
After this is called, newly created
Spans will be no-ops.After this is called, further attempts at re-using or reconfiguring this instance will result in undefined behavior. It should be considered a terminal operation for the SDK implementation.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-