AI observability shows what happened inside a request. Record quality, performance, and cost on individual spans. Store the model, separate input and output token counts, including billed thinking tokens and any applicable cached-token category, the latency, and a quality score on each step. Those fields let you judge the run after a successful status code comes back.

Philipp Krenn is Head of Developer Relations at Elastic. This conversation aired in July 2025. He described moving from keeping data and driving answers to seeing how those answers perform on quality, performance, and cost. He named OpenTelemetry as the standard for telemetry data and OTLP as its wire protocol.

What should you record on an LLM request besides the status code?

Record the path the request took, then the readings that say whether that path was any good. Name the steps: retrieve context, call the model, call a tool if there is one, return the output. Each step gets its own span. On that span, keep a model name (or a plain label when the step is not a model call), the input, output, thinking, and cached token counts, the latency, and a score.

A single log line for the whole request hides which step drifted. When the answer is off, check whether retrieval returned weak context or generation ignored decent context. Philipp set the same bar for production: the system should do what you want, inside the cost and performance you expect.

You just throw something out, you hope it's better, but you don't really know.

Philipp Krenn, Head of Developer Relations at Elastic, on Chain of Thought ep 32

The AI Agent Trust Gap: Bridgi… - Chain of Thought | AI Agents, Infrastructure & Engineering - Apple Podcasts

Podcast Episode · Chain of Thought | AI Agents, Infrastructure & Engineering · July 16, 2025 · 44m

favicon podcasts.apple.com

Atindriyo Sanyal made a related point in a 2025 episode on reliable action: with agents, evals and observability can look like a point-in-time activity, when what you need is a broader reliability story.

Put a score on the trace so the next run is comparable. Define that number yourself. Store it beside the tokens and the latency, and the next weak request lines up with the last strong one, step by step.

How do you measure quality, performance, and cost on one trace?

Write those three readings onto the span when the step finishes. Quality is the score. Performance is the latency of that span. Cost comes from the model name and input, output, thinking, and cached token counts, priced on your own list outside this sketch. A shared trace id turns a regression into a filter on one step: quality on retrieve, latency on generate, or tokens on a named step.

A minimal sketch to adapt, not a drop-in library.

def run_request(question: str) -> str: with trace_span("retrieve") as span: docs = fetch_context(question) span.record( model="none", input_tokens=0, output_tokens=0, thinking_tokens=0, cached_tokens=0, latency_ms=span.elapsed_ms(), score=score(docs, question), ) with trace_span("generate") as span: text, input_tokens, output_tokens, thinking_tokens, cached_tokens = call_model( question, docs ) span.record( model="answer-model", input_tokens=input_tokens, output_tokens=output_tokens, thinking_tokens=thinking_tokens, cached_tokens=cached_tokens, latency_ms=span.elapsed_ms(), score=score(text, question), ) return text 

trace_span opens a span and closes it when the block ends. score returns a number you define. call_model stands in for the generator. Philipp named OpenTelemetry and its OTLP wire protocol for integrating telemetry data. Any stack that can hold the fields can run the same check.

Latency needs a threshold you will say out loud.

oh, it takes two hundred milliseconds to get the response back. That's unacceptably slow. And now it's oftentimes like, oh, LLM takes five seconds to give me an answer. That's perfectly fine.

Philipp Krenn, Head of Developer Relations at Elastic, on Chain of Thought ep 32

He expects that patience to change as faster, more real-time answers matter more. LLM cost is decreasing, and he still treats cost management as ongoing work. Keep latency and token counts on the span while a five second answer still passes, so the shift shows up in the history.

Why instrument before the system is in production?

Observability is often an afterthought, and he expects the same pattern for AI. AI may even put teams in a better position, he said, because hallucinations and wrong answers create a stronger business drive to give the right answers.

Having been in the observability space for a while, it's like oftentimes it's an afterthought. It will be the same for AI, but people will figure out sooner or later that it shouldn't be an afterthought and you need to actively work on that.

Philipp Krenn, Head of Developer Relations at Elastic, on Chain of Thought ep 32

Emit spans while traffic is still small. Define one score for retrieval and one for the final answer. Read a handful of low score traces before you add users.

Score a fixed sample if you cannot score every request, and still keep tokens and latency on the rest. After a prompt or model change, replay that same sample and compare the scores. More options force a choice, and without a measurement you cannot tell whether the choice improved the answers.

FAQ

What is the minimum to store per step?

Model or step type; input, output, thinking, and cached token counts; latency; and a quality score. Keep the raw inputs and outputs when you can, because a score without the text is hard to audit later.

Does a five second answer count as fine?

Philipp Krenn said a five second LLM answer is often treated as perfectly fine today, and that people called a two hundred millisecond Elasticsearch query unacceptably slow. He expects that forgiveness to fade as faster, more real-time answers matter more. Record latency either way so the shift is visible.

Do I need a special product to do this?

The sketch is a shape: a span per step, closed with the model; input, output, thinking, and cached token counts; latency; and a score. He named OpenTelemetry for telemetry data and OTLP as its wire protocol. The store can be whatever you already query, as long as those fields sit on the same trace.

Takeaway

  • Give each step its own span: retrieve, generate, and any tool call.
  • On every span, store the model; input, output, thinking, and cached token counts; latency; and a quality score.
  • Judge a change from those readings together, including after a successful status code.
  • Start before production so the tracing work is on the schedule.
  • Replay the same sample of requests after each prompt or model change and compare the traces.

The longer explainer, with the episode clips, is on Chain of Thought. It draws on this episode.

Subscribe to the Chain of Thought newsletter for new episodes and write-ups like this one.

Drafted with AI assistance from the episode transcripts.