All patterns
P-05 · Patterns

End-to-end LLM tracing

One identifier ties together question, retrieved context, prompt, model, tools, answer and feedback.

trace-de-ponta-a-ponta.archClick a component in the diagram
Click a component in the diagram
Problem

The wrong answer comes back with a 200 status. Logs show latency and tokens, but not what went into the model or why.

Solution

Each interaction produces a trace with a span per step, prompt and model versions and masked context. The trace feeds evaluation and cost attribution.

When to use
  • →As soon as there are real users
  • →Multi-step agents
  • →Need to explain decisions
## Trade-offs
  • +Reproducible incidents
  • +Cost per task and per customer
  • +Foundation for continuous evaluation
  • −Stores sensitive data without masking
  • −Data volume requires sampling