If It's Important, Emit an Event

If a decision, state change, or outcome matters to understanding what happened, it should produce a structured event — not a log line, not a comment, not a hope that someone was watching.

What it is

A system that does important work but emits no record of it is a black box. Post-hoc reconstruction from outputs — trying to infer what happened from what currently exists — is archaeology, not observability. Emitting structured events at moments that matter is the practice of making a system narrate its own execution: when a tool call completes, emit a completion event with inputs and outputs; when a decision branch is taken, emit a decision event with the context that drove it; when a retry happens, emit a retry event with the failure reason. These events are not log lines — they are typed, structured records that carry enough information to reconstruct the system's reasoning after the fact. The crucial difference is intent: log lines are notes to developers; events are first-class output of the system, designed to be consumed by other systems, agents, dashboards, and analysis pipelines. An agent that emits events is observable. An agent that prints to stdout is guessable.

When to reach for it

When NOT to

Exemplars

Related