pub struct NoOpObservabilityPlugin;Expand description
No-op observability plugin that does nothing
This implementation provides zero runtime cost when observability is disabled. All methods are inlined and compile to nothing in release builds.
Implementations§
Trait Implementations§
Source§impl Default for NoOpObservabilityPlugin
impl Default for NoOpObservabilityPlugin
Source§impl ObservabilityPlugin for NoOpObservabilityPlugin
impl ObservabilityPlugin for NoOpObservabilityPlugin
Source§fn start_span(&self, _name: &str, _attributes: &[(&str, &str)]) -> SpanGuard
fn start_span(&self, _name: &str, _attributes: &[(&str, &str)]) -> SpanGuard
Start a new span and return a guard
Source§fn add_span_attribute(&self, _span_id: &str, _key: &str, _value: &str)
fn add_span_attribute(&self, _span_id: &str, _key: &str, _value: &str)
Add an attribute to an existing span
Source§fn set_span_status(&self, _span_id: &str, _status: SpanStatus)
fn set_span_status(&self, _span_id: &str, _status: SpanStatus)
Set the status of a span
Source§fn record_metric(&self, _name: &str, _value: f64, _labels: &[(&str, &str)])
fn record_metric(&self, _name: &str, _value: f64, _labels: &[(&str, &str)])
Record a metric with labels
Source§fn log_structured(&self, _level: LogLevel, _message: &str, _fields: &JsonValue)
fn log_structured(&self, _level: LogLevel, _message: &str, _fields: &JsonValue)
Log a structured message with fields
Source§fn flush(&self) -> ObservabilityResult<()>
fn flush(&self) -> ObservabilityResult<()>
Flush any pending telemetry data
Source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Check if the plugin is enabled
Source§fn plugin_type(&self) -> &'static str
fn plugin_type(&self) -> &'static str
Get the plugin name/type
Auto Trait Implementations§
impl Freeze for NoOpObservabilityPlugin
impl RefUnwindSafe for NoOpObservabilityPlugin
impl Send for NoOpObservabilityPlugin
impl Sync for NoOpObservabilityPlugin
impl Unpin for NoOpObservabilityPlugin
impl UnsafeUnpin for NoOpObservabilityPlugin
impl UnwindSafe for NoOpObservabilityPlugin
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