Skip to main content

EngineObserver

Trait EngineObserver 

Source
pub trait EngineObserver: Send + Sync {
    // Required method
    fn on_engine_done(
        &self,
        engine: &str,
        status: &str,
        scope: Option<&str>,
        kind: Option<&str>,
        elapsed: Duration,
    );
}
Expand description

Observes completed engine requests. Implemented by higher layers (e.g. the REST API’s Prometheus metrics); the default is a no-op so libraries and CLI tools never pay for telemetry they don’t serve.

status is one of ok, empty or error. scope/kind describe the failure reason and are None on success.

Required Methods§

Source

fn on_engine_done( &self, engine: &str, status: &str, scope: Option<&str>, kind: Option<&str>, elapsed: Duration, )

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§