Skip to main content

OpsLog

Trait OpsLog 

Source
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

NameWhen
boson_tasks_enqueuedJob enqueued (task_name, runtime labels)
boson_tasks_completedHandler succeeded (task_name label)
boson_task_duration_msHandler succeeded — duration as counter value
boson_tasks_failedHandler failed (task_name label)

Events (log_event name → payload highlights)

NameWhen
boson_task_logRun started or completed (event, task_name, job_id, run_id, …)
boson_handler_errorHandler error (task_name, job_id, message, optional will_retry)
boson_runtime_logRuntime 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§

Source

fn record_counter(&self, name: &str, labels: &[(&str, &str)], value: f64)

Increment a counter with optional labels.

Source

fn record_gauge(&self, name: &str, labels: &[(&str, &str)], value: f64)

Set a gauge with optional labels.

Source

fn log_event(&self, name: &str, payload: &Value)

Emit a structured diagnostic event (see trait-level table for runtime event names).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§