pub trait OpsLog: Send + Sync {
// Required methods
fn record_counter(&self, name: &str, labels: &[(&str, &str)], value: f64);
fn record_gauge(&self, name: &str, labels: &[(&str, &str)], value: f64);
fn log_event(&self, name: &str, payload: &Value);
}Expand description
Structured ops metrics and events for enqueue, runs, leases, and runtime health.
The runtime emits the following by default (labels vary by call site):
Counters
| Name | When |
|---|---|
boson_tasks_enqueued | Job enqueued (task_name, runtime labels) |
boson_tasks_completed | Handler succeeded (task_name label) |
boson_task_duration_ms | Handler succeeded — duration as counter value |
boson_tasks_failed | Handler failed (task_name label) |
Events (log_event name → payload highlights)
| Name | When |
|---|---|
boson_task_log | Run started or completed (event, task_name, job_id, run_id, …) |
boson_handler_error | Handler error (task_name, job_id, message, optional will_retry) |
boson_runtime_log | Runtime ready or lease reclaim (event, runtime, …) |
Install a custom adapter with install_ops_log to forward these to your metrics stack.
Use ConsoleOpsLog, NoOpsLog, or a custom OpsLog implementation.
Required Methods§
Sourcefn record_counter(&self, name: &str, labels: &[(&str, &str)], value: f64)
fn record_counter(&self, name: &str, labels: &[(&str, &str)], value: f64)
Increment a counter with optional labels.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".