#[non_exhaustive]pub struct Config {
pub sampler: Box<dyn ShouldSample>,
pub id_generator: Box<dyn IdGenerator>,
pub span_limits: SpanLimits,
pub resource: Cow<'static, Resource>,
}
Available on crate feature
trace
only.Expand description
Tracer configuration
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.sampler: Box<dyn ShouldSample>
The sampler that the sdk should use
id_generator: Box<dyn IdGenerator>
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: 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
Specify the attributes representing the entity that produces telemetry
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl !RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl !UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more