pub struct ComponentMetrics { /* private fields */ }Expand description
Facade over a MetricsCollector for uniform component-operation
emission. Construct via RuntimeObservability::component_metrics()
or directly in tests.
Implementations§
Source§impl ComponentMetrics
impl ComponentMetrics
Sourcepub fn new(
collector: Arc<dyn MetricsCollector>,
components_enabled: bool,
) -> Self
pub fn new( collector: Arc<dyn MetricsCollector>, components_enabled: bool, ) -> Self
Builds a facade over collector; components_enabled is the
snapshot of the [observability.metrics].components lever taken
at construction time.
Sourcepub fn observe(&self, component: &str, operation: &str, failed: bool)
pub fn observe(&self, component: &str, operation: &str, failed: bool)
Observes one component operation. failed selects the closed-set
outcome label (“failure”/“success”) and, when true, unconditionally
forwards to the error family with the e:{component}:{operation}
label — error-family emission is never lever-gated.
Auto Trait Implementations§
impl !RefUnwindSafe for ComponentMetrics
impl !UnwindSafe for ComponentMetrics
impl Freeze for ComponentMetrics
impl Send for ComponentMetrics
impl Sync for ComponentMetrics
impl Unpin for ComponentMetrics
impl UnsafeUnpin for ComponentMetrics
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