pub struct LogThrottlingConfig {
pub summary_emission_interval: Option<Duration>,
pub metrics_emission_interval: Option<Duration>,
pub excluded_fields: Option<Vec<String>>,
pub exemptions: Option<Vec<String>>,
}Fields§
§summary_emission_interval: Option<Duration>How often to emit throttling summaries as WARN events, set to None to disable entirely
metrics_emission_interval: Option<Duration>How often to throttling metrics as INFO events, set to None to disable entirely
excluded_fields: Option<Vec<String>>Fields to exclude from uniqueness checks, set to None to disable entirely.
Example:
ⓘ
tracing::info!(user_id=1, "User joined");
tracing::info!(user_id=2, "User joined"); If the user_id field is excluded, these will be treated as exactly the same log, so multiple users join messages could be throttled
exemptions: Option<Vec<String>>Targets to exempt from any throttling. This allows the caller to ensure that any high priority logs are always displayed.
Example:
ⓘ
let exemptions = Some(vec!["nothrottle"]); // Assuming this is passed during config stage
tracing::error!(target: "nothrottle", user_id=1, "User joined"); // Will never be throttled
tracing::error!(user_id=2, "User joined"); // Can possibly be throttledTrait Implementations§
Source§impl Clone for LogThrottlingConfig
impl Clone for LogThrottlingConfig
Source§fn clone(&self) -> LogThrottlingConfig
fn clone(&self) -> LogThrottlingConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LogThrottlingConfig
impl Debug for LogThrottlingConfig
Source§impl Default for LogThrottlingConfig
impl Default for LogThrottlingConfig
Source§fn default() -> LogThrottlingConfig
fn default() -> LogThrottlingConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LogThrottlingConfig
impl RefUnwindSafe for LogThrottlingConfig
impl Send for LogThrottlingConfig
impl Sync for LogThrottlingConfig
impl Unpin for LogThrottlingConfig
impl UnsafeUnpin for LogThrottlingConfig
impl UnwindSafe for LogThrottlingConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more