Skip to main content

Crate ryu_tracing

Crate ryu_tracing 

Source
Expand description

Per-run observability trace store (spec unit #178 / M4).

Persists ordered spans keyed by conversation_id (the run id) in a local SQLite database (~/.ryu/traces.db). Each span records:

  • kind"tool-call" or "model-call"
  • name — tool name or model id
  • args_hash — SHA-256 hex of the tool input (tool-call spans only; NOT the raw payload — privacy by default)
  • started_at — Unix milliseconds (write time)
  • ended_at — Unix milliseconds (finish time; None while running)
  • error — non-None when the span ended with an error
  • session_id — nullable link to the gateway audit row (populated when #176 threads the id; left None until then)

Placement rationale (Core vs Gateway, see CLAUDE.md §1): span ordering and tool-call sequencing are what ran (orchestration) — Core. Token counts, cost, and provider-latency are what is measured/paid — Gateway audit only. Core’s trace intentionally stores NO tokens/cost fields.

Structs§

Span
A single ordered span within a run.
TraceStore
SQLite-backed trace store. Cheap to clone — wraps an Arc<Mutex<Connection>>.

Functions§

hash_args
SHA-256 hex of a JSON value’s canonical representation.