pub trait MetricsCollector: Send + Sync {
// Required methods
fn record_exchange_duration(&self, route_id: &str, duration: Duration);
fn increment_errors(&self, route_id: &str, error_type: &str);
fn increment_exchanges(&self, route_id: &str);
fn set_queue_depth(&self, route_id: &str, depth: usize);
fn record_circuit_breaker_change(
&self,
route_id: &str,
from: &str,
to: &str,
);
}Expand description
Trait for collecting metrics from the Camel runtime. Implementations can integrate with Prometheus, OpenTelemetry, etc.
Required Methods§
Sourcefn record_exchange_duration(&self, route_id: &str, duration: Duration)
fn record_exchange_duration(&self, route_id: &str, duration: Duration)
Record exchange processing time
Sourcefn increment_errors(&self, route_id: &str, error_type: &str)
fn increment_errors(&self, route_id: &str, error_type: &str)
Increment error counter
Sourcefn increment_exchanges(&self, route_id: &str)
fn increment_exchanges(&self, route_id: &str)
Increment exchange counter
Sourcefn set_queue_depth(&self, route_id: &str, depth: usize)
fn set_queue_depth(&self, route_id: &str, depth: usize)
Update queue depth
Sourcefn record_circuit_breaker_change(&self, route_id: &str, from: &str, to: &str)
fn record_circuit_breaker_change(&self, route_id: &str, from: &str, to: &str)
Record circuit breaker state change