Enum ObserverEvent
#[non_exhaustive]pub enum ObserverEvent {
Show 21 variants
AgentStart {
model_provider: String,
model: String,
channel: Option<String>,
agent_alias: Option<String>,
turn_id: Option<String>,
},
LlmRequest {
model_provider: String,
model: String,
messages_count: usize,
channel: Option<String>,
agent_alias: Option<String>,
parent_agent_alias: Option<String>,
turn_id: Option<String>,
},
LlmResponse {
model_provider: String,
model: String,
duration: Duration,
success: bool,
error_message: Option<String>,
input_tokens: Option<u64>,
output_tokens: Option<u64>,
messages: Option<LlmMessageSnapshot>,
channel: Option<String>,
agent_alias: Option<String>,
parent_agent_alias: Option<String>,
turn_id: Option<String>,
},
AgentEnd {
model_provider: String,
model: String,
duration: Duration,
tokens_used: Option<TurnTokenUsage>,
cost_usd: Option<f64>,
channel: Option<String>,
agent_alias: Option<String>,
turn_id: Option<String>,
},
ToolCallStart {
tool: String,
tool_call_id: Option<String>,
arguments: Option<String>,
channel: Option<String>,
agent_alias: Option<String>,
parent_agent_alias: Option<String>,
turn_id: Option<String>,
},
ToolCall {
tool: String,
tool_call_id: Option<String>,
duration: Duration,
success: bool,
arguments: Option<String>,
result: Option<String>,
channel: Option<String>,
agent_alias: Option<String>,
parent_agent_alias: Option<String>,
turn_id: Option<String>,
},
MemoryRecall {
query_summary: Option<String>,
duration: Duration,
num_entries: usize,
backend: String,
success: bool,
channel: Option<String>,
agent_alias: Option<String>,
turn_id: Option<String>,
},
MemoryStore {
category: String,
backend: String,
duration: Duration,
success: bool,
channel: Option<String>,
agent_alias: Option<String>,
turn_id: Option<String>,
},
MemoryAudit {
action: String,
backend: String,
duration: Duration,
success: bool,
},
RagRetrieve {
query_summary: Option<String>,
duration: Duration,
num_chunks: usize,
num_boards: usize,
channel: Option<String>,
agent_alias: Option<String>,
turn_id: Option<String>,
},
TurnComplete,
ChannelMessage {
channel: String,
direction: String,
},
HeartbeatTick,
CacheHit {
cache_type: String,
tokens_saved: u64,
},
CacheMiss {
cache_type: String,
},
Error {
component: String,
message: String,
},
DeploymentStarted {
deploy_id: String,
},
DeploymentCompleted {
deploy_id: String,
commit_sha: String,
},
DeploymentFailed {
deploy_id: String,
reason: String,
},
RecoveryCompleted {
deploy_id: String,
},
HistoryTrimmed {
dropped_messages: usize,
kept_turns: usize,
reason: String,
channel: Option<String>,
agent_alias: Option<String>,
turn_id: Option<String>,
},
}Expand description
Discrete events emitted by the agent runtime for observability.
Each variant represents a lifecycle event that observers can record, aggregate, or forward to external monitoring systems. Events carry just enough context for tracing and diagnostics without exposing sensitive prompt or response content.
Marked #[non_exhaustive] so out-of-tree observer implementations
degrade gracefully when new variants are added in future minor
releases — they must include a wildcard arm in their match
expressions and will simply ignore unknown event kinds.
Exception: under the observability-otel feature, ObserverEvent::LlmResponse
carries credential-scrubbed prompt/completion content in messages for GenAI
semantic-convention export. See LlmMessageSnapshot.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AgentStart
The agent orchestration loop has started a new session.
Fields
LlmRequest
A request is about to be sent to an LLM model_provider.
This is emitted immediately before a model_provider call so observers can print user-facing progress without leaking prompt contents.
Fields
parent_agent_alias: Option<String>The delegating agent’s alias when this record was produced by a
nested cross-agent execution (e.g. a live SOP step that named a
different agent): agent_alias is the EFFECTIVE agent whose
policy/tools executed; this preserves the parent correlation.
None for ordinary single-agent turns.
LlmResponse
Result of a single LLM model_provider call.
Fields
messages: Option<LlmMessageSnapshot>Credential-scrubbed prompt/completion content for OTel GenAI export.
None unless the observability-otel feature is active. When
populated, whether the content is exported (and at which privacy
level) is gated by the receiving OtelObserver’s instance content
policy, not by the capture path. See LlmMessageSnapshot.
parent_agent_alias: Option<String>The delegating agent’s alias when this record was produced by a
nested cross-agent execution (e.g. a live SOP step that named a
different agent): agent_alias is the EFFECTIVE agent whose
policy/tools executed; this preserves the parent correlation.
None for ordinary single-agent turns.
AgentEnd
The agent session has finished.
Carries aggregate usage data (tokens, cost) when the model_provider reports it.
Fields
tokens_used: Option<TurnTokenUsage>ToolCallStart
A tool call is about to be executed.
Fields
tool_call_id: Option<String>Provider-assigned tool call identifier, when the underlying tool
call originated from a native structured tool call block (e.g.
OpenAI tool_calls[].id, Anthropic tool_use.id). None for
text-parsed (XML/markdown) tool calls.
Observers can correlate ToolCallStart → ToolCall → the
emitting LLM response via this id.
arguments: Option<String>Full JSON arguments the agent passed to the tool. None when
arguments are unavailable at the call site.
parent_agent_alias: Option<String>The delegating agent’s alias when this record was produced by a
nested cross-agent execution (e.g. a live SOP step that named a
different agent): agent_alias is the EFFECTIVE agent whose
policy/tools executed; this preserves the parent correlation.
None for ordinary single-agent turns.
ToolCall
A tool call has completed with a success/failure outcome.
Fields
tool_call_id: Option<String>Provider-assigned tool call identifier, when present. See
ObserverEvent::ToolCallStart::tool_call_id.
arguments: Option<String>Full JSON arguments the agent passed to the tool.
Carried here (in addition to ToolCallStart) so observers that
build a single completed span per tool call — e.g. the OTel
exporter — can attach arguments at span-end time without holding
per-call state.
result: Option<String>Scrubbed tool output or error reason. Populated for both success and failure outcomes so backends can show the actual tool result in trace viewers. Credentials are scrubbed before this field is emitted.
parent_agent_alias: Option<String>The delegating agent’s alias when this record was produced by a
nested cross-agent execution (e.g. a live SOP step that named a
different agent): agent_alias is the EFFECTIVE agent whose
policy/tools executed; this preserves the parent correlation.
None for ordinary single-agent turns.
MemoryRecall
A memory recall (search) operation has completed.
Emitted at the runtime boundary after a hybrid-search query against
the brain DB. Carries an optional query_summary for diagnostics —
scrubbed and truncated user text, not a privacy-clean token. The
runtime applies scrub_credentials first and then truncates to ≤200
content chars (with a 3-char ... ellipsis appended when truncation
occurred); short non-credential queries pass through unchanged.
Fields
MemoryStore
A memory store (write) operation has completed.
Emitted after persisting a memory entry. Carries only bounded
fields — the raw memory key is intentionally omitted because
keys can encode high-cardinality identifiers (UUIDs, phone
numbers, message timestamps) that would blow up Prometheus label
series.
Fields
MemoryAudit
A memory audit/operator action was recorded on the audit trail.
Carries only bounded labels. The action is an audit verb such as
"store", "recall", or "purge"; raw memory keys and content
are intentionally excluded from this event.
Fields
RagRetrieve
A RAG retrieval pass has completed.
Emitted after vector + keyword retrieval against the hardware
datasheet index. Reports cardinalities only; carries an optional
scrubbed-and-truncated query summary on the same terms as
Self::MemoryRecall. Has no success field because the underlying
rag.retrieve call is synchronous and infallible.
Fields
TurnComplete
The agent produced a final answer for the current user message.
ChannelMessage
A message was sent or received through a channel.
Fields
HeartbeatTick
Periodic heartbeat tick from the runtime keep-alive loop.
CacheHit
Response cache hit — an LLM call was avoided.
Fields
CacheMiss
Response cache miss — the prompt was not found in cache.
Error
An error occurred in a named component.
Fields
DeploymentStarted
A deployment has started.
DeploymentCompleted
A deployment has completed successfully.
DeploymentFailed
A deployment has failed.
RecoveryCompleted
Recovery from a failed deployment has completed.
HistoryTrimmed
The agent trimmed oldest whole turns from history to fit either the context token budget or the configured message limit. Carries the cut accounting so dashboards and clients can surface a visible “context was trimmed” signal instead of the agent silently losing earlier turns.
Trait Implementations§
Source§impl Clone for ObserverEvent
impl Clone for ObserverEvent
Source§fn clone(&self) -> ObserverEvent
fn clone(&self) -> ObserverEvent
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ObserverEvent
impl RefUnwindSafe for ObserverEvent
impl Send for ObserverEvent
impl Sync for ObserverEvent
impl Unpin for ObserverEvent
impl UnsafeUnpin for ObserverEvent
impl UnwindSafe for ObserverEvent
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more