Skip to content

AI Observability Explained: Traces, Cost and Quality

Quick answer

AI observability adds traces, token and cost tracking and live quality scoring to normal monitoring. See an example trace, a Python sketch and a privacy checklist.

AI Observability Explained: Traces, Cost and Quality

AI observability is the ability to monitor, understand and troubleshoot AI systems throughout their lifecycle. In practice it means recording a trace of every model and tool call, tracking tokens, latency and cost, and scoring answer quality on real traffic, so you can see why a response went wrong rather than only that something failed.

Key takeaways

  • AI observability adds three layers to normal monitoring: tracing, metrics and cost, and evaluation on production traffic.
  • A trace stores the prompt, response, token usage and latency for each request, per Langfuse's documentation.
  • As of late November 2026, the OpenTelemetry GenAI conventions have moved to a new repository whose schema section reads "TODO", so expect change.
  • Decide what you will not log, such as identity numbers, before traces leave your system.

On this page:

QuestionNormal app monitoringAI observability
What counts as a failure?Error, crash, slow responseAlso a fluent but wrong or unsafe answer
What do you record?Requests, errors, latencyPrompts, responses, tool calls, tokens, scores
Cost signalServers and bandwidthTokens per request and per feature
Quality checkTests before releaseScores on live traffic too
Output is the same for the same input?Usually yesNot necessarily, so you need many samples

What is AI observability, and how is it different from logging?

Logging tells you that something happened. Observability lets you ask why. For AI systems the "why" often lives inside a model call, so you need to capture what went in and what came out.

The Microsoft Learn observability page, with metadata updated on 2026-11-24, defines it as the ability to monitor, understand and troubleshoot AI systems throughout their lifecycle. It says teams can trace, evaluate, add automated quality gates to CI/CD pipelines, and collect signals such as evaluation metrics, logs, traces and model outputs. Note that this is one vendor's description of its own platform, but the three ideas of tracing, monitoring and evaluation appear across tools. If you build agents, the core elements of an AI agent explains the steps worth tracing.

What is in one trace?

A trace follows one request through every step. Langfuse's observability overview says application tracing captures structured logs of every request, with the exact prompt sent, the model's response, token usage and latency. Microsoft says its tracing captures LLM calls, tool invocations, agent decisions and inter-service dependencies, and is built on OpenTelemetry standards.

Here is an illustrative trace with made-up numbers for a support bot:

StepWhat is recordedExample (invented)
1. User requestQuestion text, user session"Where is my refund?"
2. RetrievalChunks returned3 chunks, top score 0.82
3. Model callInput and output tokens, latency1,900 in, 220 out, 1.4 s
4. Tool callWhich tool, resultorder_status, found
5. Final answerText shownRefund due in 5 working days
6. ScoreQuality check resultGrounded: pass

With this record, a wrong answer can be traced to its cause: a poor retrieval match, a bad prompt or a tool error. For the retrieval step, see vector databases for RAG.

How do I track tokens and cost?

Add up tokens per request, then group them by feature, prompt version and user type. Microsoft says production dashboards track operational metrics, token consumption, latency, error rates and quality scores.

An assumption-based example: a support bot has 5,000 conversations a week and each conversation makes about 4 model calls. That is 20,000 calls a week. Suppose a prompt change adds a long block of instructions to every call and doubles the tokens per call. Total tokens double, and so does the bill, with no change in traffic. Without per-call token records you see only a bigger invoice. With traces you see which prompt version caused it. We have not quoted prices, so apply your provider's current rate to your own numbers. Why prompt size matters is covered in context windows explained.

How do I catch a bad answer before a customer does?

Score a sample of live answers automatically, alert when scores drop, and have people review a random few.

Langfuse says its overview gives your evaluations real production traces to run on. Microsoft says AI-assisted evaluators use a judge model to score responses and can explain, while other evaluators use deterministic calculations, and that dashboards can alert when outputs fail quality thresholds or produce harmful content. An illustrative rule:

  1. Sample 5% of live answers each day.
  2. Score groundedness with a judge model.
  3. Have a person review 20 random scored answers a week to check the judge itself, because judge models can be wrong.
  4. Alert if the weekly average drops by 5 points.

All numbers here are examples to adjust. The design matters more: automated scores on traffic, a human check on the scorer, and an alert. Our post on LLM evaluation explained shows how to build the test sets behind those scores, and MLOps skills and roles covers who usually runs this.

Where do the standards stand?

Still moving. As of late November 2026, the OpenTelemetry page on GenAI semantic conventions says they have moved to a separate repository and are no longer maintained on that page.

The new repository describes its scope as spans, metrics and events for GenAI clients, MCP (Model Context Protocol), and provider-specific conventions. When we opened it, its schema URL section read "TODO" and its releases section was empty. We could not confirm the stability status or attribute names, so do not hard-code names you saw in a blog. Check the repository before you build on it. NIST's AI Risk Management Framework is a separate, voluntary framework for incorporating trustworthiness into the design, development, use and evaluation of AI; it was released on January 26, 2023, and NIST says version 1.0 is being revised.

What does a small tracing sketch look like?

This plain-Python decorator records latency and rough token counts for each call. The model is a stand-in function, and words are used as a crude proxy for tokens. It is not OpenTelemetry code. In production you would send the record to your tracing tool.

import json
import time
from functools import wraps

def trace(fn):
    @wraps(fn)
    def wrapper(prompt):
        start = time.perf_counter()
        answer = fn(prompt)
        record = {
            "call": fn.__name__,
            "latency_s": round(time.perf_counter() - start, 4),
            "input_words": len(prompt.split()),
            "output_words": len(answer.split()),
        }
        print(json.dumps(record))
        return answer
    return wrapper

@trace
def fake_model(prompt):
    time.sleep(0.05)
    return "Your refund is due in 5 working days."

fake_model("Where is my refund?")

Running it prints one JSON line with the call name, latency and word counts. Swap in your real model call, store the prompt and response only after masking personal data, and add a score field later.

What privacy steps should an Indian company take?

Treat traces as data you hold about customers. This is general practice, and we make no legal claim about any Indian law here.

  • Decide what not to log, such as Aadhaar numbers, bank account numbers and health details.
  • Mask those fields before traces leave your system.
  • Set a retention period and delete on schedule.
  • Limit who can read raw prompts and responses.
  • Ask your legal team what applies to your data and sector.

How do I choose tools?

Start from what you need, not from a ranking. We did not verify prices or compare vendors, and tool lists change quickly. Open-source and paid options both exist. Langfuse is an open-source tool, and Microsoft's platform is a cloud service. Try two tools on one real feature for a week. Check that each captures tokens, latency, tool calls and scores, and that you can export your data. If you are still choosing how to build the agent itself, read how to build your first AI agent.

Next step

Add the tracing sketch to one small project today, then write down three questions you could now answer that you could not before. If you are new to how assistants differ from agents, start with AI agent vs chatbot.

Frequently asked questions

What is AI observability and how is it different from normal logging?

Microsoft defines it as the ability to monitor, understand and troubleshoot AI systems through their lifecycle. It adds model-call traces, token and cost tracking, and quality scores to normal error and latency logs.

What do I need to log for an LLM call?

Langfuse lists the exact prompt, the model's response, token usage and latency. Add tool calls, retrieval results and a quality score, and mask personal data before storing.

Can I use open-source tools instead of paid platforms?

Open-source options exist, such as Langfuse. We did not compare features or prices, so test a tool on one real feature before committing.

How do I catch a bad answer in production before a customer does?

Score a sample of live answers automatically, alert on drops, and have people review a random set to check the scorer. Microsoft says dashboards can alert when outputs fail quality thresholds.

Does observability raise privacy concerns for Indian companies?

Yes, because traces store user prompts. Decide what not to log, mask identifiers, set retention and limit access. We make no legal claim; ask your legal team what applies.

Share LinkedIn X WhatsApp
×

Our Courses

Practice-Based Learning Tracks, Supercharged By A.I.