pub struct BetterStackDrainBuilder<F = AcceptAll> { /* private fields */ }better-stack only.Expand description
Builder for the Better Stack log drain.
Implementations§
Source§impl<F> BetterStackDrainBuilder<F>
impl<F> BetterStackDrainBuilder<F>
Sourcepub fn queue_capacity(self, queue_capacity: Option<usize>) -> Self
pub fn queue_capacity(self, queue_capacity: Option<usize>) -> Self
Set the log message queue capacity or None for unlimited (the default
is None).
Sourcepub fn max_concurrency(self, max_concurrency: usize) -> Self
pub fn max_concurrency(self, max_concurrency: usize) -> Self
Set the maximum number of concurrent message sends (the default is 16).
Sourcepub fn request_timeout(self, timeout: Duration) -> Self
pub fn request_timeout(self, timeout: Duration) -> Self
Set the request timeout (the default is 60 seconds).
Sourcepub fn initial_retry_delay(self, initial_retry_delay: Duration) -> Self
pub fn initial_retry_delay(self, initial_retry_delay: Duration) -> Self
Set the initial retry delay (the default is 1 second).
Sourcepub fn max_retry_delay(self, max_retry_delay: Duration) -> Self
pub fn max_retry_delay(self, max_retry_delay: Duration) -> Self
Set the maximum retry delay (the default is 60 seconds).
Sourcepub fn max_retries(self, max_retries: Option<u32>) -> Self
pub fn max_retries(self, max_retries: Option<u32>) -> Self
Set the maximum number of retries or None for unlimited (the default
is unlimited).
Sourcepub fn kv_filter<K, T>(
self,
fallback_field: K,
filter: T,
) -> BetterStackDrainBuilder<T>
pub fn kv_filter<K, T>( self, fallback_field: K, filter: T, ) -> BetterStackDrainBuilder<T>
Use a given key-value pair filter.
All key-value pairs rejected by the filter will be serialized under a given fallback field.
This feature can be used if you want Better Stack to index only a given subset of fields.
Sourcepub fn debug_mode(self, enable: bool) -> Self
pub fn debug_mode(self, enable: bool) -> Self
Enable or disable debug mode (the default is disabled).
In the debug mode you’ll be able to see some runtime info on stderr that will help you with setting up the drain (e.g. failed requests). With debug mode disabled, all errors will be silently ignored.
Sourcepub fn build(
self,
ingesting_host: &str,
source_token: &str,
) -> Result<(BetterStackDrain<F>, CloudDrainTask, BetterStackDrainHandle), Error>
pub fn build( self, ingesting_host: &str, source_token: &str, ) -> Result<(BetterStackDrain<F>, CloudDrainTask, BetterStackDrainHandle), Error>
Build the drain.
Sourcepub fn spawn_task(
self,
ingesting_host: &str,
source_token: &str,
) -> Result<(BetterStackDrain<F>, BetterStackDrainHandle), Error>
pub fn spawn_task( self, ingesting_host: &str, source_token: &str, ) -> Result<(BetterStackDrain<F>, BetterStackDrainHandle), Error>
Build the drain and spawn a tokio task responsible for sending log messages.
Sourcepub fn spawn_thread(
self,
ingesting_host: &str,
source_token: &str,
) -> Result<(BetterStackDrain<F>, BetterStackDrainHandle), Error>
pub fn spawn_thread( self, ingesting_host: &str, source_token: &str, ) -> Result<(BetterStackDrain<F>, BetterStackDrainHandle), Error>
Build the drain and spawn a thread responsible for sending log messages.