pub struct MetricsProvider { /* private fields */ }Expand description
Metrics provider using the metrics facade crate.
Emits metrics via counter!, gauge!, histogram! macros.
If no global recorder is installed, these are zero-cost no-ops.
Atomic counters are maintained for test snapshot assertions.
Implementations§
Source§impl MetricsProvider
impl MetricsProvider
Sourcepub fn new(_config: &ObservabilityConfig) -> Result<Self, String>
pub fn new(_config: &ObservabilityConfig) -> Result<Self, String>
Create a new metrics provider.
§Errors
Currently infallible, but returns Result for API compatibility.
Sourcepub async fn shutdown(self) -> Result<(), String>
pub async fn shutdown(self) -> Result<(), String>
Shutdown the metrics provider gracefully.
With the facade approach, there’s nothing to shutdown - the global recorder (if any) is managed by the application.
§Errors
Currently infallible, but returns Result for API compatibility.
pub fn record_orchestration_start( &self, orchestration_name: &str, version: &str, initiated_by: &str, )
pub fn record_orchestration_completion( &self, orchestration_name: &str, version: &str, status: &str, duration_seconds: f64, turn_count: u64, history_events: u64, )
pub fn record_orchestration_failure( &self, orchestration_name: &str, version: &str, error_type: &str, error_category: &str, )
pub fn record_orchestration_application_error(&self)
pub fn record_orchestration_infrastructure_error(&self)
pub fn record_orchestration_configuration_error(&self)
pub fn record_continue_as_new( &self, orchestration_name: &str, execution_id: u64, )
pub fn record_activity_execution( &self, activity_name: &str, outcome: &str, duration_seconds: f64, retry_attempt: u32, tag: Option<&str>, )
pub fn record_activity_success(&self)
pub fn record_activity_app_error(&self)
pub fn record_activity_infra_error(&self)
pub fn record_activity_config_error(&self)
pub fn record_orchestration_poison(&self)
pub fn record_activity_poison(&self)
pub fn record_suborchestration_call( &self, parent_orchestration: &str, child_orchestration: &str, outcome: &str, )
pub fn record_suborchestration_duration( &self, parent_orchestration: &str, child_orchestration: &str, duration_seconds: f64, outcome: &str, )
pub fn record_provider_operation( &self, operation: &str, duration_seconds: f64, status: &str, )
pub fn record_provider_error(&self, operation: &str, error_type: &str)
pub fn record_orch_dispatcher_items_fetched(&self, count: u64)
pub fn record_orch_dispatcher_processing_duration(&self, duration_ms: u64)
pub fn record_worker_dispatcher_items_fetched(&self, count: u64)
pub fn record_worker_dispatcher_execution_duration(&self, duration_ms: u64)
pub fn update_queue_depths(&self, orch_depth: u64, worker_depth: u64)
pub fn get_queue_depths(&self) -> (u64, u64)
pub fn increment_active_orchestrations(&self)
pub fn decrement_active_orchestrations(&self)
pub fn set_active_orchestrations(&self, count: i64)
pub fn get_active_orchestrations(&self) -> i64
pub fn snapshot(&self) -> MetricsSnapshot
Auto Trait Implementations§
impl !Freeze for MetricsProvider
impl RefUnwindSafe for MetricsProvider
impl Send for MetricsProvider
impl Sync for MetricsProvider
impl Unpin for MetricsProvider
impl UnsafeUnpin for MetricsProvider
impl UnwindSafe for MetricsProvider
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