public class TracerSdkProvider extends Object implements io.opentelemetry.trace.TracerProvider
Tracer
provider implementation for TracerProvider
.
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.
Modifier and Type | Class and Description |
---|---|
static class |
TracerSdkProvider.Builder
Builder class for the TracerSdkFactory.
|
Modifier and Type | Method and Description |
---|---|
void |
addSpanProcessor(SpanProcessor spanProcessor)
Adds a new
SpanProcessor to this Tracer . |
static TracerSdkProvider.Builder |
builder()
Returns a new
TracerSdkProvider.Builder for TracerSdkProvider . |
void |
forceFlush()
Requests the active span processor to process all span events that have not yet been processed.
|
io.opentelemetry.sdk.trace.TracerSdk |
get(String instrumentationName) |
io.opentelemetry.sdk.trace.TracerSdk |
get(String instrumentationName,
String instrumentationVersion) |
TraceConfig |
getActiveTraceConfig()
Returns the active
TraceConfig . |
void |
shutdown()
Attempts to stop all the activity for this
Tracer . |
void |
updateActiveTraceConfig(TraceConfig traceConfig)
Updates the active
TraceConfig . |
public static TracerSdkProvider.Builder builder()
TracerSdkProvider.Builder
for TracerSdkProvider
.TracerSdkProvider.Builder
for TracerSdkProvider
.public io.opentelemetry.sdk.trace.TracerSdk get(String instrumentationName)
get
in interface io.opentelemetry.trace.TracerProvider
public io.opentelemetry.sdk.trace.TracerSdk get(String instrumentationName, String instrumentationVersion)
get
in interface io.opentelemetry.trace.TracerProvider
public TraceConfig getActiveTraceConfig()
TraceConfig
.TraceConfig
.public void updateActiveTraceConfig(TraceConfig traceConfig)
TraceConfig
.
Note: To update the TraceConfig
associated with this instance you should use the
TraceConfig.toBuilder()
method on the TraceConfig
returned from getActiveTraceConfig()
, make the changes desired to the TraceConfig.Builder
instance,
then use this method with the resulting TraceConfig
instance.
traceConfig
- the new active TraceConfig
.TraceConfig
public void addSpanProcessor(SpanProcessor spanProcessor)
SpanProcessor
to this Tracer
.
Any registered processor cause overhead, consider to use an async/batch processor especially
for span exporting, and export to multiple backends using the MultiSpanExporter
.
spanProcessor
- the new SpanProcessor
to be added.public void shutdown()
Tracer
. Calls SpanProcessor.shutdown()
for all registered SpanProcessor
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 all the newly created Span
s will be no-op.
public void forceFlush()
SpanProcessor.forceFlush()