This document outlines the phased implementation plan for Aranya observability.
The roadmap includes two kinds of work:
Logging existing data (low effort)
peer_device_id, effects_count, or bytes_transferred that are already computed.Implementing new metrics (higher effort)
If a field is not already available at the logging call site, it is a new metric and requires additional code to compute, store, or pass through the call chain.
| Phase | Goal | Status |
|---|---|---|
| 1 | Foundation: structured logging, correlation IDs, error chains | Planned |
| 2 | Enhanced sync debugging: stall detection, topology, bundling | Planned |
| 3 | Policy & AFC: detailed error reporting, SHM logging | Planned |
Goal: Establish consistent structured logging with correlation IDs and device/team context.
tracing_subscriber with JSON formattercrates/aranya-daemon/src/main.rs
correlation_id: Tarpc::TraceId to all RPC requestsrpc.trace_id for cross-process correlationcrates/aranya-daemon-api/, crates/aranya-daemon/src/api.rs, crates/aranya-client/src/client.rs, crates/aranya-client/src/util.rs, crates/aranya-client/src/team.rs, crates/aranya-client/src/device.rs
crates/aranya-daemon/src/observability.rs (to contain the correlation_id handlers).context() for full causal chainGoal: Provide comprehensive sync visibility: first command tracking, stall detection, network metrics
crates/aranya-daemon/src/sync/mod.rs
last_first_cmd_hash, last_first_cmd_max_cts, stall_count
crates/aranya-daemon/src/sync/mod.rs
crates/aranya-daemon/src/sync/mod.rs, crates/aranya-util/
Note: These metrics are on a per-transport basis, some metrics aren’t applicable to particular transport types.
Goal: Enhanced policy and AFC observability with detailed error reporting.
crates/aranya-policy-vm/, crates/aranya-daemon/src/actions.rs
crates/aranya-client/src/afc.rs
crates/aranya-client/src/afc.rs