MetricsBackend

Trait MetricsBackend 

Source
pub trait MetricsBackend:
    Send
    + Sync
    + 'static {
    // Required methods
    fn on_request_completed(&self, signal: &Signal);
    fn on_route_request_completed(&self, signal: &Signal);
    fn on_connection_opened(&self, signal: &Signal);
    fn on_connection_closed(&self, signal: &Signal);
}
Available on crate features plugins and signals only.
Expand description

Common interface for metrics backends used by the metrics plugin.

Backend implementations translate Tako signals into metrics updates or tracing events in external systems.

Required Methods§

Source

fn on_request_completed(&self, signal: &Signal)

Called when a request is completed at the app level.

Source

fn on_route_request_completed(&self, signal: &Signal)

Called when a route-level request is completed.

Source

fn on_connection_opened(&self, signal: &Signal)

Called when a connection is opened.

Source

fn on_connection_closed(&self, signal: &Signal)

Called when a connection is closed.

Implementations on Foreign Types§

Source§

impl MetricsBackend for Arc<PrometheusMetricsBackend>

Source§

fn on_request_completed(&self, signal: &Signal)

Available on crate feature signals only.
Source§

fn on_route_request_completed(&self, signal: &Signal)

Available on crate feature signals only.
Source§

fn on_connection_opened(&self, signal: &Signal)

Available on crate feature signals only.
Source§

fn on_connection_closed(&self, signal: &Signal)

Available on crate feature signals only.

Implementors§