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/events for publish, drain, DLQ, checkpoints.
Install before or during PhotonBuilder::build
via PhotonBuilder::ops_log
(or install_ops_log). Photon calls this trait from backend instrumentation — it is not the
application event bus.
§Example
ⓘ
use photon_runtime::Photon;
use photon_telemetry::ConsoleOpsLog;
let _photon = Photon::builder()
.ops_log(ConsoleOpsLog)
.auto_registry()
.build()?;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".