pub struct BatchConfigBuilder { /* private fields */ }Expand description
A builder for creating BatchConfig instances.
Implementations§
Source§impl BatchConfigBuilder
impl BatchConfigBuilder
Sourcepub fn with_max_queue_size(self, max_queue_size: usize) -> Self
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 is 2048.
Corresponding environment variable: OTEL_BSP_MAX_QUEUE_SIZE.
Note: Programmatically setting this will override any value set via the environment variable.
Sourcepub fn with_max_export_batch_size(self, max_export_batch_size: usize) -> Self
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.
Corresponding environment variable: OTEL_BSP_MAX_EXPORT_BATCH_SIZE.
Note: Programmatically setting this will override any value set via the environment variable.
Sourcepub fn with_max_concurrent_exports(self, max_concurrent_exports: usize) -> Self
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.
The default value is 1.
Corresponding environment variable: OTEL_BSP_MAX_CONCURRENT_EXPORTS.
Note: Programmatically setting this will override any value set via the environment variable.
Sourcepub fn with_scheduled_delay(self, scheduled_delay: Duration) -> Self
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.
Corresponding environment variable: OTEL_BSP_SCHEDULE_DELAY.
Note: Programmatically setting this will override any value set via the environment variable.
Sourcepub fn with_max_export_timeout(self, max_export_timeout: Duration) -> Self
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.
Corresponding environment variable: OTEL_BSP_EXPORT_TIMEOUT.
Note: Programmatically setting this will override any value set via the environment variable.
Sourcepub fn build(self) -> BatchConfig
pub fn build(self) -> BatchConfig
Builds a BatchConfig enforcing the following invariants:
max_export_batch_sizemust be less than or equal tomax_queue_size.
Trait Implementations§
Source§impl Debug for BatchConfigBuilder
impl Debug for BatchConfigBuilder
Source§impl Default for BatchConfigBuilder
impl Default for BatchConfigBuilder
Source§fn default() -> Self
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_SIZEOTEL_BSP_SCHEDULE_DELAYOTEL_BSP_MAX_EXPORT_BATCH_SIZEOTEL_BSP_EXPORT_TIMEOUTOTEL_BSP_MAX_CONCURRENT_EXPORTS
Note: Programmatic configuration overrides any value set via the environment variable.