pub struct Observability { /* private fields */ }Expand description
Main observability manager.
Implementations§
Source§impl Observability
impl Observability
Sourcepub fn new(config: ObservabilityConfig) -> ShResult<Self>
pub fn new(config: ObservabilityConfig) -> ShResult<Self>
Create a new observability instance with the given configuration.
Sourcepub fn with_defaults() -> ShResult<Self>
pub fn with_defaults() -> ShResult<Self>
Create a new observability instance with default configuration.
Sourcepub fn log(&self, level: LogLevel, message: &str, attributes: &[(&str, &str)])
pub fn log(&self, level: LogLevel, message: &str, attributes: &[(&str, &str)])
Log a structured message.
Sourcepub fn get_metric(&self, name: &str) -> Option<MetricValue>
pub fn get_metric(&self, name: &str) -> Option<MetricValue>
Get a metric value by name.
Sourcepub fn list_metrics(&self) -> Vec<String>
pub fn list_metrics(&self) -> Vec<String>
List all metric names.
Sourcepub fn config(&self) -> &ObservabilityConfig
pub fn config(&self) -> &ObservabilityConfig
Get the configuration.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Observability
impl !UnwindSafe for Observability
impl Freeze for Observability
impl Send for Observability
impl Sync for Observability
impl Unpin for Observability
impl UnsafeUnpin for Observability
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