OBS-ACT-01Tier IObservability & Traceability

Span-Level Tracing of Agent Execution

Capture every reasoning step, tool call, and decision as a span in a distributed trace, not just the final output.

Runtime: ActAgentOps: Operate & MonitorSee on the matrix →
SPAN-LEVEL TRACE Agent Run · root spangoal · principal · outcome Plan Span · reasoning stepinput hash · output hash Tool Span · invocationtool · args · cost · latency Guard Span · policy checkdecision · rule idParent-child spans — same discipline as microservice tracing.
In Plain English

This page is the complete instruction page for one pattern called "Span-Level Tracing of Agent Execution." It explains the problem this pattern solves, the idea behind the solution, when you should (and should not) use it, and what happens afterward, both the good effects and the costs.

This matters because building AI agents is not just about making them clever. It is also about making them safe and predictable. Following a well-tested pattern like this one helps avoid common mistakes, and shows you exactly which safety rules and regulations it connects to, listed under "Standards Mesh" on this page.

Context

Agent execution is non-linear and stateful. Logs-as-strings cannot reconstruct what happened. Production debugging requires the same tracing discipline as microservices.

Problem

Without span-level tracing, production incidents in agent systems are unresolvable.

Forces

  • Trace volume vs retention cost
  • Privacy of traced content vs observability

Solution

Instrument the agent runtime to emit spans for each reasoning step, tool call, memory read/write, guardrail evaluation, and LLM call. Include input/output hashes, cost, latency, parent span. Route to an LLM-observability platform (Langfuse, Arize, custom). Redact or tokenise sensitive fields at span creation.

Placement

Where this pattern acts in the two lifecycles

Runtime Cognitive
01Perceive
02Reason / Plan
03Decide
04Act
05Observe
06Reflect / Learn
07Terminate

04 Act. Tool call, API invocation, environment mutation. 15 of 61 catalogue patterns act at this stage.

AgentOps Lifecycle
01Design & Scope
02Build & Integrate
03Evaluate & Red-Team
04Deploy
05Operate & Monitor
06Iterate & Adapt
07Decommission

05 Operate & Monitor. Runtime telemetry, drift detection. 18 of 61 catalogue patterns act at this stage.

Stages and counts from the catalogue data. The Runtime lens is the loop the agent runs each turn; the AgentOps lens is the lifecycle the team runs the agent through. See the Matrix for every pattern at each stage.

Applicability

  • All production agent systems
  • Debug, audit, cost-analysis use cases

Anti-Patterns

  • Only logging LLM calls, not tool calls or decisions
  • Verbose plain-text logs that cannot be joined

Consequences

  • +Real debugging capability
  • +Cost and performance analysis
  • +Audit evidence
  • −Storage and processing cost
  • −Privacy engineering required