Expand description
Metrics hooks for observing handler activity.
Implement Metrics to receive callbacks on requests, responses, errors,
latency, and queue depth changes. The default no-op implementation can be
overridden selectively.
§Example
use a2a_protocol_server::metrics::Metrics;
use std::time::Duration;
struct MyMetrics;
impl Metrics for MyMetrics {
fn on_request(&self, method: &str) {
println!("request: {method}");
}
fn on_latency(&self, method: &str, duration: Duration) {
println!("{method} took {duration:?}");
}
}Modules§
- control
- The control plane’s label values (audit H11; ADR 0038 section 4).
- event_
append_ error - Error kinds passed to
Metrics::on_persistence_errorforpersistence_operation::EVENT_APPEND. - event_
log_ catchup_ error - Error kinds passed to
Metrics::on_persistence_errorforpersistence_operation::EVENT_LOG_CATCHUP. - executor_
outcome - How an executor’s run ended, as
Metrics::on_executor_runreports it. - persistence_
operation - Operation labels passed to
Metrics::on_persistence_error. - push_
outcome - Outcome labels passed to
Metrics::on_push_delivery. - queue_
handoff_ error - Error kinds passed to
Metrics::on_persistence_errorforpersistence_operation::QUEUE_HANDOFF. - subscribe_
wake - Why a
SubscribeToTaskstream stopped waiting on a task’s event log, asMetrics::on_subscribe_wakereports it (audit E-F25 (b), ADR 0057).
Structs§
- Connection
Pool Stats - Statistics about the HTTP connection pool.
- Metrics
Handle - A shareable
Metricsa store can hold, and discard into by default. - Noop
Metrics - A no-op
Metricsimplementation that discards all events. - RpcCall
- One finished inbound call, as
Metrics::on_rpc_callreports it.
Traits§
- Metrics
- Trait for receiving metrics callbacks from the handler.