pub struct PrometheusObserver { /* private fields */ }Expand description
Prometheus-backed observer — exposes metrics for scraping via /metrics.
Implementations§
Source§impl PrometheusObserver
impl PrometheusObserver
pub fn new() -> PrometheusObserver
Sourcepub fn encode(&self) -> String
pub fn encode(&self) -> String
Encode all registered metrics into Prometheus text exposition format.
Process-wide singleton handle. All call sites that obtain a Prometheus
observer through this function share the same Registry and the same
underlying counters, so events recorded by the channel orchestrator and
events recorded by the gateway accumulate into the same time series and
are visible on a single /metrics scrape.
PrometheusObserver::new() still returns a fresh, isolated instance —
kept for tests so parallel test cases don’t see each other’s counts.
Trait Implementations§
Source§impl Default for PrometheusObserver
impl Default for PrometheusObserver
Source§fn default() -> PrometheusObserver
fn default() -> PrometheusObserver
Returns the “default value” for a type. Read more
Source§impl Observer for PrometheusObserver
impl Observer for PrometheusObserver
Source§fn record_event(&self, event: &ObserverEvent)
fn record_event(&self, event: &ObserverEvent)
Record a discrete lifecycle event. Read more
Source§fn record_metric(&self, metric: &ObserverMetric)
fn record_metric(&self, metric: &ObserverMetric)
Record a numeric metric sample. Read more
Auto Trait Implementations§
impl !Freeze for PrometheusObserver
impl !RefUnwindSafe for PrometheusObserver
impl Send for PrometheusObserver
impl Sync for PrometheusObserver
impl Unpin for PrometheusObserver
impl UnsafeUnpin for PrometheusObserver
impl !UnwindSafe for PrometheusObserver
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more