TracerProvider Interface
public interface TracerProvider
Resolves and provides Tracer implementation.
This class is intended to be used by Azure client libraries and provides abstraction over possible tracing implementations. Application developers should use tracing libraries such as OpenTelemetry or Spring tracing.
Method Summary
Modifier and Type | Method and Description |
---|---|
default Tracer |
createTracer(LibraryTelemetryOptions libraryOptions, TracingOptions options)
Creates tracer provider instance. |
abstract Tracer |
createTracer(String libraryName, String libraryVersion, String azNamespace, TracingOptions options)
Creates named and versioned tracer instance. |
static
Tracer |
getDefaultProvider()
Returns default implementation of |
Method Details
createTracer
public default Tracer createTracer(LibraryTelemetryOptions libraryOptions, TracingOptions options)
Creates tracer provider instance.
Code Samples
LibraryTelemetryOptions libraryOptions = new LibraryTelemetryOptions("azure-storage-blobs")
.setLibraryVersion("12.20.0")
.setResourceProviderNamespace("Microsoft.Storage")
.setSchemaUrl("https://opentelemetry.io/schemas/1.23.1");
Tracer tracer = TracerProvider.getDefaultProvider()
.createTracer(libraryOptions, clientOptions.getTracingOptions());
HttpPipeline pipeline = new HttpPipelineBuilder()
.tracer(tracer)
.clientOptions(clientOptions)
.build();
Parameters:
Returns:
createTracer
public abstract Tracer createTracer(String libraryName, String libraryVersion, String azNamespace, TracingOptions options)
Creates named and versioned tracer instance.
Parameters:
Returns:
getDefaultProvider
public static TracerProvider getDefaultProvider()
Returns default implementation of TracerProvider
that uses SPI to resolve tracing implementation.
Returns:
TracerProvider
Applies to
Azure SDK for Java