pub struct ObservabilityConfig {
pub service_name: String,
pub tracing_enabled: bool,
pub metrics_enabled: bool,
pub log_format: LogFormat,
}Expand description
Observability configuration.
Fields§
§service_name: StringService name for traces and metrics.
tracing_enabled: boolEnable tracing collection.
metrics_enabled: boolEnable metrics collection.
log_format: LogFormatLog output format.
Implementations§
Source§impl ObservabilityConfig
impl ObservabilityConfig
Sourcepub fn new(service_name: impl Into<String>) -> Self
pub fn new(service_name: impl Into<String>) -> Self
Create a new config with the given service name.
Sourcepub fn with_log_format(self, format: LogFormat) -> Self
pub fn with_log_format(self, format: LogFormat) -> Self
Set the log format.
Sourcepub fn without_tracing(self) -> Self
pub fn without_tracing(self) -> Self
Disable tracing.
Sourcepub fn without_metrics(self) -> Self
pub fn without_metrics(self) -> Self
Disable metrics.
Trait Implementations§
Source§impl Clone for ObservabilityConfig
impl Clone for ObservabilityConfig
Source§fn clone(&self) -> ObservabilityConfig
fn clone(&self) -> ObservabilityConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ObservabilityConfig
impl Debug for ObservabilityConfig
Source§impl Default for ObservabilityConfig
impl Default for ObservabilityConfig
Source§impl<'de> Deserialize<'de> for ObservabilityConfig
impl<'de> Deserialize<'de> for ObservabilityConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ObservabilityConfig
impl RefUnwindSafe for ObservabilityConfig
impl Send for ObservabilityConfig
impl Sync for ObservabilityConfig
impl Unpin for ObservabilityConfig
impl UnsafeUnpin for ObservabilityConfig
impl UnwindSafe for ObservabilityConfig
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