02 Tracing
Workshop source
Workshop material is maintained in the public langfuse/langfuse-workshop repository. Use the repository for the runnable app, checkpoint branches, and local setup.
Learner guide: 02 Tracing
Instructor notes
- Teach the progression in three visible layers: OpenAI generations, one agent root, then tool observations.
- Keep the code changes small and local. The point is to show that Langfuse wraps existing app boundaries instead of forcing an architecture rewrite.
- The user/session propagation section is optional live, but later checkpoints include it so the following chapters have attribution available.
Demo rhythm
- Add
LangfuseSpanProcessorandobserveOpenAI, run one turn, show separate generation traces. - Wrap
runSupportConversationInnerwithobserve(...), run again, show nested generations. - Wrap the two local tool helpers, run again, show the full tree.
Watch for
- Learners wrapping the OpenAI client in a separate factory. The workshop intentionally keeps the wrapper inline.
- Missing shutdown flush in
index.ts; traces can arrive late without it.
Was this page helpful?