Skip to main content

MetricsCollector

Trait MetricsCollector 

Source
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§

Source

fn record_exchange_duration(&self, route_id: &str, duration: Duration)

Record exchange processing time

Source

fn increment_errors(&self, route_id: &str, error_type: &str)

Increment error counter

Source

fn increment_exchanges(&self, route_id: &str)

Increment exchange counter

Source

fn set_queue_depth(&self, route_id: &str, depth: usize)

Update queue depth

Source

fn record_circuit_breaker_change(&self, route_id: &str, from: &str, to: &str)

Record circuit breaker state change

Implementors§