pub struct Metrics { /* private fields */ }Expand description
Cloneable server metrics handle backed by a prometheus registry.
Implementations§
Source§impl Metrics
impl Metrics
Sourcepub fn new() -> Result<Self, MetricsError>
pub fn new() -> Result<Self, MetricsError>
Construct the server metrics registry and register all exported metrics.
§Errors
Returns MetricsError::Register if prometheus rejects a metric descriptor.
Sourcepub fn encode(&self) -> Result<Vec<u8>, MetricsError>
pub fn encode(&self) -> Result<Vec<u8>, MetricsError>
Encode all currently gathered metrics in prometheus text exposition format.
§Errors
Returns MetricsError::Encode if prometheus cannot encode gathered metrics.
Sourcepub fn workflow_started(&self, namespace: &str, workflow_type: &str)
pub fn workflow_started(&self, namespace: &str, workflow_type: &str)
Increment the workflow-start counter.
Sourcepub fn workflow_completed(&self, namespace: &str, status: &str)
pub fn workflow_completed(&self, namespace: &str, status: &str)
Increment the workflow-terminal counter.
Sourcepub fn workflow_reopened(&self, namespace: &str)
pub fn workflow_reopened(&self, namespace: &str)
Increment the workflow-reopen counter when a failed run is reopened.
Sourcepub fn activity_dispatched(&self, namespace: &str, activity_type: &str)
pub fn activity_dispatched(&self, namespace: &str, activity_type: &str)
Increment the activity-dispatch counter and in-flight gauge.
Sourcepub fn activity_completed(
&self,
namespace: &str,
activity_type: &str,
outcome: &str,
duration: Duration,
)
pub fn activity_completed( &self, namespace: &str, activity_type: &str, outcome: &str, duration: Duration, )
Increment the activity-completion counter, observe duration, and decrement in-flight gauge.
Sourcepub fn activity_abandoned(&self, namespace: &str)
pub fn activity_abandoned(&self, namespace: &str)
Decrement in-flight activity gauge when dispatch fails before a result can arrive.
Sourcepub fn store_operation(&self, operation: &str, duration: Duration)
pub fn store_operation(&self, operation: &str, duration: Duration)
Observe a store operation duration.
Sourcepub fn activity_lease_record_failed(&self)
pub fn activity_lease_record_failed(&self)
An activity lease this install knew and failed to record.
Sourcepub fn worker_connected(&self, namespace: &str)
pub fn worker_connected(&self, namespace: &str)
Increment connected worker gauge for a namespace.
Sourcepub fn worker_disconnected(&self, namespace: &str)
pub fn worker_disconnected(&self, namespace: &str)
Decrement connected worker gauge for a namespace.
Sourcepub fn signal_delivered(&self, namespace: &str, residency: &str)
pub fn signal_delivered(&self, namespace: &str, residency: &str)
Increment signal delivery counter.
Sourcepub fn schedule_fired(&self, namespace: &str)
pub fn schedule_fired(&self, namespace: &str)
Increment schedule-fired counter.
Sourcepub fn deploy_operation(&self, operation: &str, outcome: &str)
pub fn deploy_operation(&self, operation: &str, outcome: &str)
Increment the deploy-operation counter for one mutation outcome.
Sourcepub fn deploy_denied(&self, transport: &str)
pub fn deploy_denied(&self, transport: &str)
Increment the deploy-denied counter for a transport.
Sourcepub fn set_loaded_workflow_versions(&self, workflow_type: &str, count: i64)
pub fn set_loaded_workflow_versions(&self, workflow_type: &str, count: i64)
Set the loaded-version gauge for one workflow type from the post-operation listing.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Metrics
impl !UnwindSafe for Metrics
impl Freeze for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnsafeUnpin for Metrics
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request