public class TracerSdkProvider extends Object implements io.opentelemetry.trace.TracerProvider, TracerSdkManagement
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. |
io.opentelemetry.sdk.common.CompletableResultCode |
forceFlush()
Requests the active span processor to process all span events that have not yet been processed
and returns a
CompletableResultCode which is completed when the flush is finished. |
io.opentelemetry.trace.Tracer |
get(String instrumentationName) |
io.opentelemetry.trace.Tracer |
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.trace.Tracer get(String instrumentationName)
get in interface io.opentelemetry.trace.TracerProviderpublic io.opentelemetry.trace.Tracer get(String instrumentationName, String instrumentationVersion)
get in interface io.opentelemetry.trace.TracerProviderpublic TraceConfig getActiveTraceConfig()
TracerSdkManagementTraceConfig.getActiveTraceConfig in interface TracerSdkManagementTraceConfig.public void updateActiveTraceConfig(TraceConfig traceConfig)
TracerSdkManagementTraceConfig.
Note: To update the TraceConfig associated with this instance you should use the
TraceConfig.toBuilder() method on the TraceConfig returned from TracerSdkManagement.getActiveTraceConfig(), make the changes desired to the TraceConfig.Builder instance,
then use this method with the resulting TraceConfig instance.
updateActiveTraceConfig in interface TracerSdkManagementtraceConfig - the new active TraceConfig.TraceConfigpublic void addSpanProcessor(SpanProcessor spanProcessor)
TracerSdkManagementSpanProcessor 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.
addSpanProcessor in interface TracerSdkManagementspanProcessor - the new SpanProcessor to be added.public void shutdown()
TracerSdkManagementTracer. Calls SpanProcessor.shutdown() for all registered SpanProcessors.
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 Spans will be no-op.
shutdown in interface TracerSdkManagementpublic io.opentelemetry.sdk.common.CompletableResultCode forceFlush()
TracerSdkManagementCompletableResultCode which is completed when the flush is finished.forceFlush in interface TracerSdkManagementSpanProcessor.forceFlush()