Build garageTry it → read → next · ~10 min

Tutorials · Chapter D (4/4) · ~10 min

LLM tracing lab

Try it → see it → read → next

Log **spans** per request — embed, retrieve, generate — so you debug production RAG without guessing.

On paths: Builder · Student

Optional on: Professional

Try tools: Code & developers

Try yourself

Playground

Trace a failed RAG answer

Open spans in order — find where quality broke before blaming the model.

    Recap

    What you just did

    You opened spans in order and found 0 retrieval chunks before blaming the generator.

    Read

    What to trace

    | Span | Log | |------|-----| | embed_query | latency, model version | | retrieve | chunk IDs, scores, count | | generate | tokens, finish reason | | tool_call | name, args (redacted) |

    Read

    Redaction rules

    • Never log raw API keys or full PII
    • Hash user IDs if needed for correlation

    Read

    Try it

    Add a request ID header and pass it through every LLM + vector call in one route.