- Define useful traces for agents with tools and RAG.
- Separate technical logs, decisions, and evidence.
- Detect loops, latency, repeated errors, and lack of grounding.
trace:
request_id: "support-1042"
user_id: "u_123"
model: "local-qwen"
route: "local"
steps:
- tool: "search_qdrant"
latency_ms: 182
chunks: 5
- tool: "draft_reply"
latency_ms: 4210
guardrails:
repeated_tool_calls: 0
human_approval_required: true
outcome: "draft_created"What to always log
- Model, runtime, and chosen route.
- Tools called, arguments, and summarized result.
- RAG chunks used and source.
- Repeated errors and strategy changes.
- Whether there was human approval or automatic cutoff.
Official sources
- Langfuse observability overview
- Langfuse tracing
- OpenTelemetry traces