pub struct TracerProviderBuilder { /* private fields */ }Expand description
Builder for provider attributes.
Implementations§
Source§impl TracerProviderBuilder
impl TracerProviderBuilder
Sourcepub fn with_simple_exporter<T: SpanExporter + 'static>(
self,
exporter: T,
) -> Self
pub fn with_simple_exporter<T: SpanExporter + 'static>( self, exporter: T, ) -> Self
Adds a SimpleSpanProcessor with the configured exporter to the pipeline.
§Arguments
exporter- The exporter to be used by the SimpleSpanProcessor.
§Returns
A new Builder instance with the SimpleSpanProcessor added to the pipeline.
Processors are invoked in the order they are added.
Sourcepub fn with_batch_exporter<T: SpanExporter + 'static>(self, exporter: T) -> Self
pub fn with_batch_exporter<T: SpanExporter + 'static>(self, exporter: T) -> Self
Adds a BatchSpanProcessor with the configured exporter to the pipeline.
§Arguments
exporter- The exporter to be used by the BatchSpanProcessor.
§Returns
A new Builder instance with the BatchSpanProcessor added to the pipeline.
Processors are invoked in the order they are added.
Sourcepub fn with_span_processor<T: SpanProcessor + 'static>(
self,
processor: T,
) -> Self
pub fn with_span_processor<T: SpanProcessor + 'static>( self, processor: T, ) -> Self
Adds a custom SpanProcessor to the pipeline.
§Arguments
processor- TheSpanProcessorto be added.
§Returns
A new Builder instance with the custom SpanProcessor added to the pipeline.
Processors are invoked in the order they are added.
Sourcepub fn with_sampler<T: ShouldSample + 'static>(self, sampler: T) -> Self
pub fn with_sampler<T: ShouldSample + 'static>(self, sampler: T) -> Self
Specify the sampler to be used.
Sourcepub fn with_id_generator<T: IdGenerator + 'static>(
self,
id_generator: T,
) -> Self
pub fn with_id_generator<T: IdGenerator + 'static>( self, id_generator: T, ) -> Self
Specify the id generator to be used.
Sourcepub fn with_max_events_per_span(self, max_events: u32) -> Self
pub fn with_max_events_per_span(self, max_events: u32) -> Self
Specify the number of events to be recorded per span.
Sourcepub fn with_max_attributes_per_span(self, max_attributes: u32) -> Self
pub fn with_max_attributes_per_span(self, max_attributes: u32) -> Self
Specify the number of attributes to be recorded per span.
Sourcepub fn with_max_links_per_span(self, max_links: u32) -> Self
pub fn with_max_links_per_span(self, max_links: u32) -> Self
Specify the number of events to be recorded per span.
Sourcepub fn with_max_attributes_per_event(self, max_attributes: u32) -> Self
pub fn with_max_attributes_per_event(self, max_attributes: u32) -> Self
Specify the number of attributes one event can have.
Sourcepub fn with_max_attributes_per_link(self, max_attributes: u32) -> Self
pub fn with_max_attributes_per_link(self, max_attributes: u32) -> Self
Specify the number of attributes one link can have.
Sourcepub fn with_span_limits(self, span_limits: SpanLimits) -> Self
pub fn with_span_limits(self, span_limits: SpanLimits) -> Self
Specify all limit via the span_limits
Sourcepub fn with_resource(self, resource: Resource) -> Self
pub fn with_resource(self, resource: Resource) -> Self
Associates a Resource with a SdkTracerProvider.
This Resource represents the entity producing telemetry and is associated with all Tracers the SdkTracerProvider will create.
By default, if this option is not used, the default Resource will be used.
Note: Calls to this method are additive, each call merges the provided resource with the previous one.
Sourcepub fn build(self) -> SdkTracerProvider
pub fn build(self) -> SdkTracerProvider
Create a new provider from this configuration.