Interface SdkTracerManagement
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
SdkTracerProvider
public interface SdkTracerManagement extends Closeable
"Management" interface for the Tracing SDK. This interface exposes methods for configuring the Tracing SDK, as well as several lifecycle methods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
addSpanProcessor(SpanProcessor spanProcessor)
Deprecated.UseSdkTracerProvider.addSpanProcessor(SpanProcessor)
when initializing the SDKdefault void
close()
Attempts to stop all the activity for thisTracer
.io.opentelemetry.sdk.common.CompletableResultCode
forceFlush()
Requests the active span processor to process all span events that have not yet been processed and returns aCompletableResultCode
which is completed when the flush is finished.TraceConfig
getActiveTraceConfig()
Returns the activeTraceConfig
.io.opentelemetry.sdk.common.CompletableResultCode
shutdown()
Attempts to stop all the activity for thisTracer
.void
updateActiveTraceConfig(TraceConfig traceConfig)
Deprecated.UseSdkTracerProviderBuilder.setTraceConfig(Supplier)
to register a supplier ofTraceConfig
if you need to make dynamic updates.
-
-
-
Method Detail
-
getActiveTraceConfig
TraceConfig getActiveTraceConfig()
Returns the activeTraceConfig
.- Returns:
- the active
TraceConfig
.
-
updateActiveTraceConfig
@Deprecated void updateActiveTraceConfig(TraceConfig traceConfig)
Deprecated.UseSdkTracerProviderBuilder.setTraceConfig(Supplier)
to register a supplier ofTraceConfig
if you need to make dynamic updates.Updates the activeTraceConfig
.Note: To update the
TraceConfig
associated with this instance you should use theTraceConfig.toBuilder()
method on theTraceConfig
returned fromgetActiveTraceConfig()
, make the changes desired to theTraceConfigBuilder
instance, then use this method with the resultingTraceConfig
instance.- Parameters:
traceConfig
- the new activeTraceConfig
.- See Also:
TraceConfig
-
addSpanProcessor
@Deprecated void addSpanProcessor(SpanProcessor spanProcessor)
Deprecated.UseSdkTracerProvider.addSpanProcessor(SpanProcessor)
when initializing the SDKAdds a newSpanProcessor
to thisTracer
.Any registered processor cause overhead, consider to use an async/batch processor especially for span exporting, and export to multiple backends using the
SpanExporter.composite(SpanExporter...)
.- Parameters:
spanProcessor
- the newSpanProcessor
to be added.
-
shutdown
io.opentelemetry.sdk.common.CompletableResultCode shutdown()
Attempts to stop all the activity for thisTracer
. CallsSpanProcessor.shutdown()
for all registeredSpanProcessor
s.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
Span
s 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
CompletableResultCode
which is completed when all the span processors have been shut down.
-
forceFlush
io.opentelemetry.sdk.common.CompletableResultCode forceFlush()
Requests the active span processor to process all span events that have not yet been processed and returns aCompletableResultCode
which is completed when the flush is finished.- See Also:
SpanProcessor.forceFlush()
-
close
default void close()
Attempts to stop all the activity for thisTracer
. CallsSpanProcessor.shutdown()
for all registeredSpanProcessor
s.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
Span
s 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-