Multi-Agent Observability: What to Log and Why
import { Callout } from "../../src/components/ui/Callout"; import { CodeBlock } from "../../src/components/ui/CodeBlock"; import { Figure } from "../../src/components/ui/Figure";
Autonomous agent fleets generate an enormous volume of data. Without a deliberate observability strategy, that data becomes noise. With one, it becomes your most powerful debugging, tuning, and compliance asset.
This post covers the signals worth capturing, the ones you should ignore, and the patterns we use inside AEGIS to keep audit trails production-grade.
The Core Signals
1. Agent State Transitions
Every time an agent moves from idle → working → review → complete, log the transition, the timestamp, and the trigger (human command, scheduler event, or peer message).
<CodeBlock lang="ts" filename="state-transition.ts">{
interface StateTransition { agentId: string; from: AgentState; to: AgentState; triggeredBy: 'human' | 'scheduler' | 'peer' | 'system'; timestamp: ISO8601String; context: Record<string, unknown>; }
}</CodeBlock>
State transitions are the backbone of audit trails. If something goes wrong, you can replay the exact lifecycle of every agent involved.
2. Intent-to-Action Mapping
Agents decide, then act. Log both the decision (intent) and the resulting action. The delta between intent and action is where most bugs hide.
<Callout type="info"> We store intent logs at <code>DEBUG</code> level and action logs at <code>INFO</code>. In production, we tail <code>INFO</code> and replay <code>DEBUG</code> only when needed. </Callout>3. Cross-Agent Messages
Message payloads are often large. Don’t log the full payload by default. Log:
- ·Sender and receiver agent IDs
- ·Message type / topic
- ·Payload hash (SHA-256)
- ·Timestamp
- ·Delivery acknowledgment status
Store full payloads in a retention-limited object store (S3, R2, etc.) and reference them by hash if you need deep forensics.
Signals to Ignore (or Sample Heavily)
1. Heartbeats
Health checks and heartbeat pings create a lot of volume with almost no signal. Aggregate them into a single metric or sample at 1%.
2. Raw LLM Token Streams
Token-level streaming data is massive. Log the final output, the model version, and the latency. Skip the per-token stream unless you are debugging a specific generation issue.
3. Static Configuration Reads
Reading the same config value 10,000 times a day is not interesting. Log config changes, not config reads.
Building Production-Grade Audit Trails
Structured Logging
Use a structured log format (JSON Lines) with a consistent schema. AEGIS uses the following top-level fields:
Immutable Storage
Write logs to an append-only store. Once written, they should not be mutable. We use a write-once-read-many (WORM) bucket policy on our log archive.
Retention Tiers
Not all logs live forever. We use three tiers:
- ·Hot (7 days): Full structured logs in the query engine
- ·Warm (90 days): Compressed JSON in object storage
- ·Cold (7 years): Glacier-style archive for compliance
What We Learned the Hard Way
- ·Don’t log secrets. Even if you mask them later, a single leak in a log stream can compromise everything downstream.
- ·Correlate early. If you wait until incident #5 to add
trace_id, you will wish you had it for incidents #1–4. - ·Log budgets are real. Unbounded logging will eat your infrastructure budget. Set a daily GB cap and alert on it.
Summary
Observability is not about logging everything. It is about logging the right things, in the right structure, with the right retention. That is what turns a noisy agent fleet into a debuggable, auditable system.
Further reading
- ·Multi-Agent Observability for Production Teams — turning traces into an on-call practice.
- ·AI Agent Memory and Observability: Demo to Deployment — state you can't inspect is state you can't trust.
- ·Autonomous Agent Observability and Audit Trails — audit trails that survive scrutiny.