Struct opentelemetry_sdk::trace::BatchConfigBuilder

source ·
pub struct BatchConfigBuilder { /* private fields */ }
Expand description

A builder for creating BatchConfig instances.

Implementations§

source§

impl BatchConfigBuilder

source

pub fn with_max_queue_size(self, max_queue_size: usize) -> Self

Set max_queue_size for BatchConfigBuilder. It’s the maximum queue size to buffer spans for delayed processing. If the queue gets full it will drops the spans. The default value of is 2048.

source

pub fn with_max_export_batch_size(self, max_export_batch_size: usize) -> Self

Set max_export_batch_size for BatchConfigBuilder. It’s the maximum number of spans to process in a single batch. If there are more than one batch worth of spans then it processes multiple batches of spans one batch after the other without any delay. The default value is 512.

source

pub fn with_max_concurrent_exports(self, max_concurrent_exports: usize) -> Self

Set max_concurrent_exports for BatchConfigBuilder. It’s the maximum number of concurrent exports. Limits the number of spawned tasks for exports and thus memory consumed by an exporter. The default value is 1. IF the max_concurrent_exports value is default value, it will cause exports to be performed synchronously on the BatchSpanProcessor task.

source

pub fn with_scheduled_delay(self, scheduled_delay: Duration) -> Self

Set scheduled_delay_duration for BatchConfigBuilder. It’s the delay interval in milliseconds between two consecutive processing of batches. The default value is 5000 milliseconds.

source

pub fn with_max_export_timeout(self, max_export_timeout: Duration) -> Self

Set max_export_timeout for BatchConfigBuilder. It’s the maximum duration to export a batch of data. The The default value is 30000 milliseconds.

source

pub fn build(self) -> BatchConfig

Builds a BatchConfig enforcing the following invariants:

  • max_export_batch_size must be less than or equal to max_queue_size.

Trait Implementations§

source§

impl Debug for BatchConfigBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for BatchConfigBuilder

source§

fn default() -> Self

Create a new BatchConfigBuilder initialized with default batch config values as per the specs. The values are overriden by environment variables if set. The supported environment variables are:

  • OTEL_BSP_MAX_QUEUE_SIZE
  • OTEL_BSP_SCHEDULE_DELAY
  • OTEL_BSP_MAX_EXPORT_BATCH_SIZE
  • OTEL_BSP_EXPORT_TIMEOUT
  • OTEL_BSP_MAX_CONCURRENT_EXPORTS

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FutureExt for T

source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more