Agent Tracing and Evaluation Setup
Capture structured traces of every LLM and tool call and run a small regression eval suite on each change.
Setup time1-2 hours (estimate)
Estimated costFree tier of a tracing tool or self-hosted OpenTelemetry; storage grows with trace volume.
ToolsPython
VerificationNot yet independently verified
What to log per span
span:
trace_id: uuid
kind: llm | tool | retrieval
name: model or tool name
input: redacted prompt/args
output: redacted response/result
tokens: {in: int, out: int}
latency_ms: int
error: string|null
prompt_version: git sha or tagSteps
- Wrap your LLM client and tool dispatcher to emit spans (OpenTelemetry GenAI semantic conventions, or a tool such as Langfuse or Arize Phoenix, both of which can be self-hosted).
- Redact secrets and personal data before export.
- Build a golden set of 20-100 real tasks with expected outcomes.
- On every prompt/model change, run the set and compare pass rate, cost, and latency against the previous version.
- Promote failing production traces into the golden set.
Failure modes
- Logging full prompts can store PII or secrets; redact before export.
- Eval sets that never change stop catching regressions; add real failures to them.
- High-volume tracing adds latency and cost if exported synchronously.
Markdown version: /blueprints/agent-observability.md
Want a deeper build of this?
Vote for an extended, fully tested version (more tools, a full workflow file). Votes decide what we build next.
Get one fully built blueprint a week
A weekly email: one blueprint with config, cost, setup time and failure modes, plus a vote on what we build next.
Related blueprints
AI Agent Workflows
Evaluator-Optimizer Refinement Loop
One model generates, another grades against a rubric, and the loop repeats until the rubric passes or a limit is hit.
AI Agent Workflows
Human-in-the-Loop Approval Gate
Let agents draft freely but require explicit human approval before any irreversible or external action.
AI Agent Workflows
Planner-Executor Agent
Split a task into an explicit plan, execute steps one at a time, and re-plan only when a step fails.