pub struct Builder { /* private fields */ }
Expand description
Builder for provider attributes.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn with_simple_exporter<T: SpanExporter + 'static>(
self,
exporter: T,
) -> Self
pub fn with_simple_exporter<T: SpanExporter + 'static>( self, exporter: T, ) -> Self
The SpanExporter
that this provider should use.
Sourcepub fn with_batch_exporter<T: SpanExporter + 'static, R: RuntimeChannel>(
self,
exporter: T,
runtime: R,
) -> Self
pub fn with_batch_exporter<T: SpanExporter + 'static, R: RuntimeChannel>( self, exporter: T, runtime: R, ) -> Self
The SpanExporter
setup using a default BatchSpanProcessor
that this provider should use.
Sourcepub fn with_span_processor<T: SpanProcessor + 'static>(
self,
processor: T,
) -> Self
pub fn with_span_processor<T: SpanProcessor + 'static>( self, processor: T, ) -> Self
The SpanProcessor
that this provider should use.
Sourcepub fn with_config(self, config: Config) -> Self
👎Deprecated since 0.27.1: Config is becoming a private type. Use Builder::with_{config_name}(resource) instead. ex: Builder::with_resource(resource)
pub fn with_config(self, config: Config) -> Self
The sdk crate::trace::Config
that this provider will use.
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 TracerProvider.
This Resource represents the entity producing telemetry and is associated with all Tracers the TracerProvider will create.
By default, if this option is not used, the default Resource will be used.
Sourcepub fn build(self) -> TracerProvider
pub fn build(self) -> TracerProvider
Create a new provider from this configuration.