Skip to main content

MetricsProvider

Struct MetricsProvider 

Source
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

Source

pub fn new(_config: &ObservabilityConfig) -> Result<Self, String>

Create a new metrics provider.

§Errors

Currently infallible, but returns Result for API compatibility.

Source

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.

Source

pub fn record_orchestration_start( &self, orchestration_name: &str, version: &str, initiated_by: &str, )

Source

pub fn record_orchestration_completion( &self, orchestration_name: &str, version: &str, status: &str, duration_seconds: f64, turn_count: u64, history_events: u64, )

Source

pub fn record_orchestration_failure( &self, orchestration_name: &str, version: &str, error_type: &str, error_category: &str, )

Source

pub fn record_orchestration_application_error(&self)

Source

pub fn record_orchestration_infrastructure_error(&self)

Source

pub fn record_orchestration_configuration_error(&self)

Source

pub fn record_continue_as_new( &self, orchestration_name: &str, execution_id: u64, )

Source

pub fn record_activity_execution( &self, activity_name: &str, outcome: &str, duration_seconds: f64, retry_attempt: u32, tag: Option<&str>, )

Source

pub fn record_activity_success(&self)

Source

pub fn record_activity_app_error(&self)

Source

pub fn record_activity_infra_error(&self)

Source

pub fn record_activity_config_error(&self)

Source

pub fn record_orchestration_poison(&self)

Source

pub fn record_activity_poison(&self)

Source

pub fn record_suborchestration_call( &self, parent_orchestration: &str, child_orchestration: &str, outcome: &str, )

Source

pub fn record_suborchestration_duration( &self, parent_orchestration: &str, child_orchestration: &str, duration_seconds: f64, outcome: &str, )

Source

pub fn record_provider_operation( &self, operation: &str, duration_seconds: f64, status: &str, )

Source

pub fn record_provider_error(&self, operation: &str, error_type: &str)

Source

pub fn record_orch_dispatcher_items_fetched(&self, count: u64)

Source

pub fn record_orch_dispatcher_processing_duration(&self, duration_ms: u64)

Source

pub fn record_worker_dispatcher_items_fetched(&self, count: u64)

Source

pub fn record_worker_dispatcher_execution_duration(&self, duration_ms: u64)

Source

pub fn update_queue_depths(&self, orch_depth: u64, worker_depth: u64)

Source

pub fn get_queue_depths(&self) -> (u64, u64)

Source

pub fn increment_active_orchestrations(&self)

Source

pub fn decrement_active_orchestrations(&self)

Source

pub fn set_active_orchestrations(&self, count: i64)

Source

pub fn get_active_orchestrations(&self) -> i64

Source

pub fn snapshot(&self) -> MetricsSnapshot

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more