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

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.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§