public static class OpenTelemetrySpanFactory.Builder extends Object
OpenTelemetrySpanFactory.
The SpanAttributeProvieders are defaulted to an empty list, the Tracer is
defaulted to the tracer defined by GlobalOpenTelemetry, the TextMapSetter is defaulted to the
MetadataContextSetter and the TextMapGetter is defaulted to the MetadataContextGetter.
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
OpenTelemetrySpanFactory.Builder |
addSpanAttributeProviders(List<SpanAttributesProvider> attributesProviders)
Adds all provided
SpanAttributesProviders to the SpanFactory. |
OpenTelemetrySpanFactory |
build()
Initializes the
OpenTelemetrySpanFactory. |
OpenTelemetrySpanFactory.Builder |
contextPropagators(io.opentelemetry.context.propagation.TextMapPropagator propagator)
Sets the propagator to be used.
|
OpenTelemetrySpanFactory.Builder |
textMapGetter(io.opentelemetry.context.propagation.TextMapGetter<Message<?>> textMapGetter)
Defines the
TextMapGetter to use, which is used for extracting the propagated context from another
thread or service. |
OpenTelemetrySpanFactory.Builder |
textMapSetter(io.opentelemetry.context.propagation.TextMapSetter<Map<String,String>> textMapSetter)
Defines the
TextMapSetter to use, which is used for propagating the context to another thread or
service. |
OpenTelemetrySpanFactory.Builder |
tracer(io.opentelemetry.api.trace.Tracer tracer)
Defines the
Tracer from OpenTelemetry to use. |
public OpenTelemetrySpanFactory.Builder addSpanAttributeProviders(@Nonnull List<SpanAttributesProvider> attributesProviders)
SpanAttributesProviders to the SpanFactory.attributesProviders - The SpanAttributesProviders to add.public OpenTelemetrySpanFactory.Builder contextPropagators(io.opentelemetry.context.propagation.TextMapPropagator propagator)
propagator - The propagator to be used.public OpenTelemetrySpanFactory.Builder tracer(@Nonnull io.opentelemetry.api.trace.Tracer tracer)
Tracer from OpenTelemetry to use.tracer - The Tracer to configure for use.public OpenTelemetrySpanFactory.Builder textMapSetter(io.opentelemetry.context.propagation.TextMapSetter<Map<String,String>> textMapSetter)
TextMapSetter to use, which is used for propagating the context to another thread or
service.textMapSetter - The TextMapSetter to configure for use.public OpenTelemetrySpanFactory.Builder textMapGetter(io.opentelemetry.context.propagation.TextMapGetter<Message<?>> textMapGetter)
TextMapGetter to use, which is used for extracting the propagated context from another
thread or service.textMapGetter - The TextMapGetter to configure for use.public OpenTelemetrySpanFactory build()
OpenTelemetrySpanFactory.OpenTelemetrySpanFactory with the provided configuration.Copyright © 2010–2023. All rights reserved.