AdvancedAbout 22 min

    LLM Observability (OTEL / Langfuse)

    Read the full article on Substack

    7 min read.

    Explore the standard trace hierarchy — session → trace → span → generation — read OTEL GenAI semantic conventions, and debug a real failing session by clicking through spans, tool errors, and feedback.

    Think of it this way: An observability tool for LLMs is a plane's black box. When something goes wrong you don't want to re-fly the flight — you want to open the recorder, read what the pilot said, which button they pressed, and what each instrument reported at that moment.

    0920ms1840ms
    • Parse query15ms
    • Embed query45ms
    • Vector search190ms
    • Build prompt20ms
    • LLM call1520ms

    Generation span: starts at 320ms, lasts 1520ms, 83% of the request. The model call, span g1 in the trace tree, and by far the biggest slice of time.

    gen_ai.request.model = claude-3.5-sonnet; gen_ai.usage.input_tokens = 2100; gen_ai.usage.output_tokens = 140; cost = $0.0031

    Check your understanding

    Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.

    Nest a trace correctly

    Sequence

    Order these from the outermost span to the innermost.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    1. 1Drop a step here
    2. 2Drop a step here
    3. 3Drop a step here
    4. 4Drop a step here
    4 pieces left to place

    Quiz

    23 questions
    Question 1 of 23
    Score: 0

    In the standard trace hierarchy, what nests inside what?

    Done with this lesson?

    Sign in free to keep your progress, streak and quiz scores.

    Keep going