Skip to main content

Crate varta_watch

Crate varta_watch 

Source
Expand description

Varta observer library — receive loop over configurable transport listeners, per-pid tracker, stall surface.

This crate is the in-process kernel of varta-watch. The binary drives Observer::poll in a single thread and routes Event values to exporters and the recovery command. The protocol root is varta_vlp; nothing else is on the dependency surface.

Re-exports§

pub use clock::Clock;
pub use clock::ClockError;
pub use clock::ClockSource;
pub use config::Config;
pub use config::ConfigError;
pub use exporter::Exporter;
pub use exporter::FileExporter;
pub use listener::BeatListener;
pub use listener::PreThreadAttestation;
pub use listener::TransportTrust;
pub use listener::UdsListener;
pub use observer::Event;
pub use observer::Observer;
pub use peer_cred::BeatOrigin;
pub use recovery::Recovery;
pub use recovery::RecoveryOutcome;
pub use tracker::EvictionPolicy;
pub use tracker::Slot;
pub use tracker::Tracker;
pub use tracker::Update;

Modules§

audit
Recovery audit log — TSV record of every recovery spawn/complete/refused.
clock
Configurable monotonic clock for stall-threshold accounting.
config
Hand-rolled GNU-style argv parser for the varta-watch binary.
exporter
Exporters for crate::observer::Event streams.
hw_watchdog
Hardware watchdog driver for varta-watch.
listener
Transport abstraction for receiving VLP frames.
log
Structured logging for varta-watch.
log_ratelimit
Per-kind cooldown rate limiter for varta-watch diagnostic logging.
notify
systemd sd_notify integration for varta-watch.
observer
Single-threaded observer: bind one or more transport listeners, decode incoming VLP frames, surface beats / stalls / decode errors via Event.
peer_cred
Kernel-level peer credential verification for Unix domain datagrams.
pid_max
Linux /proc/sys/kernel/pid_max reader for observer-side PID range gating.
recovery
Per-pid debounced recovery command runner (non-blocking).
signal_install
Signal-handler installation for varta-watch.
tracker
Per-pid liveness tracker backed by a pre-allocated Vec<Slot> plus a fixed-size, open-addressed [PidIndex] for O(1) pid lookup.

Macros§

varta_error
Emit an error-level message. No heap allocation.
varta_error_err
Emit an error-level message with an associated error Display value. No heap allocation.
varta_error_pid
Emit an error-level message with an associated PID and error Display. No heap allocation.
varta_error_rl
Emit an error-level message with a 1-second per-kind cooldown.
varta_info
Emit an info-level message. Produces a JSON line (json-log) or a eprintln!("varta-watch: ...") call (default). No heap allocation.
varta_info_pid
Emit an info-level message with an associated PID in the structured output. No heap allocation.
varta_info_pid_child
Emit an info-level message with an associated PID and child PID. No heap allocation.
varta_warn
Emit a warn-level message. No heap allocation.
varta_warn_child
Emit a warn-level message with an associated child PID. No heap allocation.
varta_warn_rl
Emit a warn-level message with a 1-second per-kind cooldown.