Cover of Observability for LLM Applications, edition 2026.11.2, code W9DX-M10H Observability for LLM Applications W9DX-M10H 2 editions since Nov 2026 Rolling Edition 2026.11.2

Observability for LLM Applications

Edition 2026.11.2 Examples passed Nov 23, 2026 80 of 80 examples pass What changed

Written with AI. Verified by people. How we make books

This book is open to contributions, so anyone can check it or correct it. Its repository · Report an error · How to fix one

How to find where an LLM application's time, tokens and money went, and which step failed: GenAI conventions, traces across processes, a backend, cost, latency, failures, alerts, regressions, sampling and privacy, worked on a personal assistant's back end over MASSIVE's English utterances, with its own tools, retrieval and an MCP server.

Who it's for For engineers who run an LLM feature in production and need to know why it was slow, expensive or wrong.

Start reading

Labs

Work through this book in the Lab

Run every example exactly as the book did, change the code to see what happens, and try your own ideas on the book's code and data. Nothing to install, and your work is saved. Opens in about 30 seconds.

Run every example exactly as the book did, change the code to see what happens, and try your own ideas on the book's code and data. Nothing to install, and your work is saved. Labs runs it for you: 40 hours a month.

Checking for your Lab…

On your own machine, free: download the book's notebooks, with its code and data, from GitHub.

Edition history2 editions since November 2026Every edition and what it changed
2026.11.12026.11.2
2026.11.2 · Nov 24, 2026Library update2 sections changed, 12 examples on new versions

Contents

12 chapters, about 4 hours 1 minute to read or 5 hours to listen to, with 80 examples.

  1. 1Trace a request, then ask where its time went

    By the end of this chapter you can build one message's trace by hand, print it as a tree, and say where its time and tokens went.

  2. 2Name spans the way the standard does

    By the end of this chapter you can give each span in the assistant's traces the name, the kind and the attributes that OpenTelemetry's GenAI conventions expect for its step.

  3. 3Let the client library instrument the calls

    By the end of this chapter you can read what the official OpenAI instrumentation writes for one chat call, say which of its names differ from the GenAI conventions version 0.1.0 that this book follows, and name the variable that decides whether prompts and replies are recorded, with its default.

  4. 4Follow a request across processes

    By the end of this chapter you can make a span that another team's server writes join the trace of the message that caused it, check that it has joined, and find the spans that have not.

  5. 5Send traces to a backend you can run

    By the end of this chapter you can send the spans of both processes to one receiver that you run on one machine, check that it stores the rows the exporter sent, query those rows with SQL, and say what each named backend accepts and what its page does not say.

  6. 6Attribute tokens and cost to each step

    By the end of this chapter you can split a day's model calls into input tokens, cached input tokens and output tokens, total them without counting any token twice, and say which step, route and user the money went to.

  7. 7Find where the latency comes from

    By the end of this chapter you can say which step sets a message's time, at the median and in the tail, and print each number with its count and an interval around it.

  8. 8Find the step that failed

    By the end of this chapter you can find which step of a message failed, how often, and why, and print each count with the rows it came from.

  9. 9Set alerts on the assistant's metrics

    By the end of this chapter you can set two alerts on a service's metrics, test each one on a normal day and on an incident day, and say what each one misses.

  10. 10Catch a regression in the traces

    By the end of this chapter you can say whether a release moved a number, by how much, and whether that move is bigger than the day's noise.

  11. 11Choose which traces to keep

    By the end of this chapter you can choose which traces a backend keeps, say what each choice drops, and scale a total from the traces it kept, with an interval around the result.

  12. 12Keep private data out of telemetry

    By the end of this chapter you can keep personal data out of the assistant's telemetry by default, turn content capture on for a stated purpose and count what that leaks, and say which leaks redaction can remove and which it cannot reach.

Cite this section

Format

Every format names this edition. Its link opens the current edition, where a section’s heading says when its text last changed. Accessed and retrieved dates are the day you open this.