Skip to main content

Module observability

Module observability 

Modules§

dora
log
multi
noop
prometheus
runtime_trace
Compatibility shim for the doctor command’s log-reading utilities.
traits
verbose

Structs§

AgentTurnGuard
Drop-safe lifecycle bracket for one logical agent turn.
BroadcastHookGuard
FlushGuard
Guard that flushes its observer on drop — the telemetry analogue of AgentTurnGuard. Held for the lifetime of a short-lived agent invocation (today: the CLI one-shot, zeroclaw agent -m ...), whose process exits before the OTLP batch exporter / metric PeriodicReader’s background interval fires. Without this flush all buffered telemetry — including the never-ended gen_ai.agent.invoke span, which is only .end()’d inside Observer::flush — is lost when the runtime is torn down.
LogObserver
Log-based observer — uses tracing, zero external deps
MultiObserver
Combine multiple observers — fan-out events to all backends
NoopObserver
Zero-overhead observer — all methods compile to nothing
PrometheusObserver
Prometheus-backed observer — exposes metrics for scraping via /metrics.
VerboseObserver
Human-readable progress observer for interactive CLI sessions. This observer prints compact > / < progress lines without exposing prompt contents. It is intended to be opt-in (e.g. --verbose).

Enums§

ObserverEvent
Discrete events emitted by the agent runtime for observability.

Traits§

Observer
Core observability trait for recording agent runtime telemetry.

Functions§

clear_broadcast_hook
Remove the broadcast hook, if any. Intended for tests and orderly shutdown.
create_observer
Factory: create the right observer from config
set_broadcast_hook
Install a process-wide observer that will receive every event recorded through observers built by create_observer. Calling this again replaces the previous hook.
set_scoped_broadcast_hook
Install a process-wide observer and return a guard that clears it on drop.