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§
Sourcefn on_request_completed(&self, signal: &Signal)
fn on_request_completed(&self, signal: &Signal)
Called when a request is completed at the app level.
Sourcefn on_route_request_completed(&self, signal: &Signal)
fn on_route_request_completed(&self, signal: &Signal)
Called when a route-level request is completed.
Sourcefn on_connection_opened(&self, signal: &Signal)
fn on_connection_opened(&self, signal: &Signal)
Called when a connection is opened.
Sourcefn on_connection_closed(&self, signal: &Signal)
fn on_connection_closed(&self, signal: &Signal)
Called when a connection is closed.
Implementations on Foreign Types§
Source§impl MetricsBackend for Arc<PrometheusMetricsBackend>
impl MetricsBackend for Arc<PrometheusMetricsBackend>
Source§fn on_request_completed(&self, signal: &Signal)
fn on_request_completed(&self, signal: &Signal)
Available on crate feature
signals only.Source§fn on_route_request_completed(&self, signal: &Signal)
fn on_route_request_completed(&self, signal: &Signal)
Available on crate feature
signals only.Source§fn on_connection_opened(&self, signal: &Signal)
fn on_connection_opened(&self, signal: &Signal)
Available on crate feature
signals only.Source§fn on_connection_closed(&self, signal: &Signal)
fn on_connection_closed(&self, signal: &Signal)
Available on crate feature
signals only.