pub enum TelemetryEvent {
RunStarted {
run_id: String,
agent_name: String,
model: Option<String>,
parent_run_id: Option<String>,
recovered: bool,
at_ms: i64,
},
StageEntered {
run_id: String,
stage_index: usize,
stage_name: String,
at_ms: i64,
},
StageExited {
run_id: String,
stage_index: usize,
stage_name: String,
prompt_tokens: usize,
completion_tokens: usize,
at_ms: i64,
},
InferenceCompleted {
run_id: String,
stage_name: String,
provider: String,
model: String,
latency_ms: u64,
prompt_tokens: usize,
completion_tokens: usize,
cached_tokens: usize,
success: bool,
},
ToolCallCompleted {
run_id: String,
stage_name: String,
tool_name: String,
batch_latency_ms: u64,
success: bool,
},
CompactionCompleted {
run_id: String,
stage_name: String,
success: bool,
},
RunCompleted {
run_id: String,
status: String,
prompt_tokens: usize,
completion_tokens: usize,
tool_calls: usize,
at_ms: i64,
},
Log {
run_id: String,
stage_index: usize,
kind: LogKind,
line: String,
},
}Expand description
One observable moment in an agent run’s life.
Timestamps are milliseconds since the Unix epoch (at_ms) so a sink can
reconstruct span boundaries without sub-second drift; durations are
measured wall-clock milliseconds at the point the work actually ran.
Variants§
RunStarted
An agent run became visible to the observer.
Fields
StageEntered
The run entered a stage (including the first).
StageExited
The run left a stage; token counts are the stage’s own totals.
Fields
InferenceCompleted
One inference call finished (successfully or not).
Fields
ToolCallCompleted
One tool call finished.
Fields
CompactionCompleted
A context compaction finished.
RunCompleted
The run reached a terminal status; totals are run-wide.
Fields
Log
One per-run log line, as also written to the stage’s log files.
Implementations§
Source§impl TelemetryEvent
impl TelemetryEvent
Sourcepub fn kind(&self) -> &'static str
pub fn kind(&self) -> &'static str
A stable short name for this event’s variant.
Exists so a test can assert_eq!(event.kind(), "run_started") rather
than assert!(matches!(event, ...)) - the matches! non-matching arm
is a region only a failing assertion ever reaches, which reads as
uncovered under the workspace’s 100% gate. Useful in its own right for
structured logging, where the kind is the field worth indexing on.
Trait Implementations§
Source§impl Clone for TelemetryEvent
impl Clone for TelemetryEvent
Source§fn clone(&self) -> TelemetryEvent
fn clone(&self) -> TelemetryEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more