Struct opentelemetry_sdk::logs::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 logs for delayed processing. If the queue gets full it will drop the logs. The default value of is 2048.

source

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

Set scheduled_delay for BatchConfigBuilder. It’s the delay interval in milliseconds between two consecutive processing of batches. The default value is 1000 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 default value is 30000 milliseconds.

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 logs to process in a single batch. If there are more than one batch worth of logs then it processes multiple batches of logs one batch after the other without any delay. The default value is 512.

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_BLRP_MAX_QUEUE_SIZE
  • OTEL_BLRP_SCHEDULE_DELAY
  • OTEL_BLRP_MAX_EXPORT_BATCH_SIZE
  • OTEL_BLRP_EXPORT_TIMEOUT

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