Struct opentelemetry::sdk::trace::Config
source · pub struct Config {
pub sampler: Box<dyn ShouldSample + 'static, Global>,
pub id_generator: Box<dyn IdGenerator + 'static, Global>,
pub span_limits: SpanLimits,
pub resource: Cow<'static, Resource>,
}
Available on crate feature
trace
only.Expand description
Tracer configuration
Fields§
§sampler: Box<dyn ShouldSample + 'static, Global>
The sampler that the sdk should use
id_generator: Box<dyn IdGenerator + 'static, Global>
The id generator that the sdk should use
span_limits: SpanLimits
span limits
resource: Cow<'static, Resource>
Contains attributes representing an entity that produces telemetry.
Implementations§
source§impl Config
impl Config
sourcepub fn with_sampler<T>(self, sampler: T) -> Configwhere
T: ShouldSample + 'static,
pub fn with_sampler<T>(self, sampler: T) -> Configwhere T: ShouldSample + 'static,
Specify the sampler to be used.
sourcepub fn with_id_generator<T>(self, id_generator: T) -> Configwhere
T: IdGenerator + 'static,
pub fn with_id_generator<T>(self, id_generator: T) -> Configwhere T: IdGenerator + 'static,
Specify the id generator to be used.
sourcepub fn with_max_events_per_span(self, max_events: u32) -> Config
pub fn with_max_events_per_span(self, max_events: u32) -> Config
Specify the number of events to be recorded per span.
sourcepub fn with_max_attributes_per_span(self, max_attributes: u32) -> Config
pub fn with_max_attributes_per_span(self, max_attributes: u32) -> Config
Specify the number of attributes to be recorded per span.
sourcepub fn with_max_links_per_span(self, max_links: u32) -> Config
pub fn with_max_links_per_span(self, max_links: u32) -> Config
Specify the number of events to be recorded per span.
sourcepub fn with_max_attributes_per_event(self, max_attributes: u32) -> Config
pub fn with_max_attributes_per_event(self, max_attributes: u32) -> Config
Specify the number of attributes one event can have.
sourcepub fn with_max_attributes_per_link(self, max_attributes: u32) -> Config
pub fn with_max_attributes_per_link(self, max_attributes: u32) -> Config
Specify the number of attributes one link can have.
sourcepub fn with_span_limits(self, span_limits: SpanLimits) -> Config
pub fn with_span_limits(self, span_limits: SpanLimits) -> Config
Specify all limit via the span_limits
sourcepub fn with_resource(self, resource: Resource) -> Config
pub fn with_resource(self, resource: Resource) -> Config
Specify the attributes representing the entity that produces telemetry