pub struct TelemetryRecord {Show 26 fields
pub ts: u64,
pub request_id: Option<String>,
pub msg_id: Option<String>,
pub model: String,
pub attempt: u32,
pub refusal_retries_used: Option<u32>,
pub ttft_ms: Option<u64>,
pub total_ms: u64,
pub stop_reason: Option<String>,
pub usage: UsageRecord,
pub cost_usd: Option<f64>,
pub ratelimit: Option<RateLimitRecord>,
pub cache_diag: Option<CacheDiagRecord>,
pub context: ContextRecord,
pub keepwarm: bool,
pub worker: bool,
pub session_id: Option<String>,
pub runtime_session_id: Option<String>,
pub turn_id: Option<String>,
pub trace_request_id: Option<String>,
pub worker_agent: Option<String>,
pub worker_handle: Option<String>,
pub parent_session_id: Option<String>,
pub parent_runtime_session_id: Option<String>,
pub rollover_window: Option<u64>,
pub rollover: bool,
}Expand description
One JSONL record per API call.
Fields§
§ts: u64Unix epoch milliseconds at request completion.
request_id: Option<String>§msg_id: Option<String>Anthropic message id (msg_...) from message_start.
model: String§attempt: u321-based attempt number that succeeded (1 = no retries).
refusal_retries_used: Option<u32>Number of refusal retries consumed (0 = no refusals). Present only when > 0.
ttft_ms: Option<u64>Milliseconds from request send to the first parsed model event — the
request trace’s outcome.timings.first_model_event_ms. Absent when no
event arrived, never 0.
total_ms: u64Milliseconds from request send to stream close.
stop_reason: Option<String>§usage: UsageRecord§cost_usd: Option<f64>Estimated USD cost of this call at API list prices
(UsageRecord::cost_usd), also for OAuth/subscription auth.
ratelimit: Option<RateLimitRecord>§cache_diag: Option<CacheDiagRecord>§context: ContextRecord§keepwarm: booltrue only on prompt-cache keep-warm pings (task #444) so telemetry
can separate pings from real turns. Absent on every turn record.
worker: booltrue when a subagent (worker runtime) made the request, so reports
can split delegated traffic from the foreground session. Absent on
foreground and internal records.
session_id: Option<String>Persisted conversation id (20261028-045932-eb8e): the id of
~/.synaps-cli/sessions/<id>.json and synaps daemon sessions.
Absent for unkeyed runtimes (workers, tests).
runtime_session_id: Option<String>Runtime trace session id (session-<pid>-<ms>-<seq>): the session_id of
this call’s request-trace.jsonl record. Not the persisted id.
turn_id: Option<String>Request-trace turn id (turn-<pid>-<n>). Despite the name it is
minted per logical request (same counter as trace_request_id), not
per user turn.
trace_request_id: Option<String>Request-trace request id (req-<pid>-<n>), shared by every attempt
of one logical request. Not the provider’s request_id.
worker_agent: Option<String>Worker records: the agent name (spike), or for an inline subagent
its sanitized label (model-chosen text, [A-Za-z0-9_-], bounded).
worker_handle: Option<String>Worker records: the subagent handle (sa_N).
parent_session_id: Option<String>Worker records: the spawning session’s persisted session_id.
parent_runtime_session_id: Option<String>Worker records: the spawning session’s runtime_session_id.
rollover_window: Option<u64>The context window (2, 3, …) this request belongs to after an automatic context rollover, worker or foreground. Absent before the first rollover.
rollover: booltrue only on the first request of a rolled-over window: the request
that writes the successor’s prompt cache. Absent otherwise.
Implementations§
Trait Implementations§
Source§impl Clone for TelemetryRecord
impl Clone for TelemetryRecord
Source§impl Debug for TelemetryRecord
impl Debug for TelemetryRecord
Source§impl Default for TelemetryRecord
impl Default for TelemetryRecord
Auto Trait Implementations§
impl Freeze for TelemetryRecord
impl RefUnwindSafe for TelemetryRecord
impl Send for TelemetryRecord
impl Sync for TelemetryRecord
impl Unpin for TelemetryRecord
impl UnsafeUnpin for TelemetryRecord
impl UnwindSafe for TelemetryRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.