LLM observability: how to see what your AI features do in production

Updated · 5 min read

Why AI features need their own logs

Ordinary software is predictable: the same input gives the same output, and an error usually points to a line of code. A language model is different. The same question can get different answers, and a wrong answer does not throw an error. Without records, you cannot tell whether a complaint is a one-off or a pattern.

Standard application logs record that a request happened and how long it took. They rarely record what the model was asked and what it said. Observability adds those details, so you can read a bad answer and trace the cause.

What to record for every model call

Record enough to rebuild the call, but not so much that you store data you should not keep. For each request, capture the time, the feature name, the model and version, the input size, the output size, the time taken and the cost. Store the full prompt and output for a limited period, and only where your privacy policy allows it.

Use a stable identifier for each user session, not a name or an email address. This lets you follow one user's journey without exposing who they are to everyone who reads the logs.

  • Feature name, such as the reply drafter or the order search.
  • Model name and the version your provider reports.
  • Prompt template name and version, so you know which instructions were in use.
  • Input and output length, latency and cost of the call.
  • Outcome: success, refusal, timeout or error.

Traces: following one task across several steps

A single user request often triggers several steps: a search, a model call, a database read and a second model call. A trace links all of them under one identifier, with the time each step took. When an answer is slow or wrong, the trace shows which step caused it.

Traces matter most for AI agents, which choose their own steps. A trace shows the tool calls the agent made, the results it received and the decision it took next. Without it, a loop or a wrong tool call is very hard to find.

Cost and latency tracking

Cost grows with each model call, and a small change to a prompt can double the length of every answer. Track cost per feature and per user, and set an alert when the daily figure rises faster than active users. Compare the cost against the value the feature gives, not only against the budget.

Latency is part of the product experience. Track the median and the slowest responses for each feature, not only the average, because a few very slow answers are what users remember. Check each provider's current pricing and latency documentation when you plan your budget.

Sampling outputs and collecting user feedback

Reading every answer is impossible at scale, so review a random sample each week. Read the sample with the prompt in front of you, and mark each answer as good, partly right or wrong. Patterns in the wrong answers point to the prompt, the data or the model choice that needs work.

Add a simple feedback control, such as a thumbs up or down, next to each answer. Ask for a short reason when a user marks an answer as wrong. Link that feedback to the trace, so you can see what the model was given when the answer failed.

Keeping personal data out of logs

Prompts often contain names, phone numbers, account details and private messages. Logs are copied to dashboards, backups and staff laptops, so anything you store there spreads. Remove or mask personal data before it is written to a log, and restrict who can read the full prompts.

Set a retention period for the full text and delete it when the period ends. Keep the summary metrics longer, since they contain no personal content. Check your provider's data terms for what they store on their side, and describe your logging in your privacy policy.

  • Mask email addresses, phone numbers and identity numbers before writing a log line.
  • Limit access to full prompts to a small group who need them for review.
  • Delete full text after the retention period, and keep only aggregate metrics afterwards.

How Hundred Seas helps

Hundred Seas is a product studio in Taipei that builds AI agents, AI CRM systems and custom software on Claude and OpenAI models. We add tracing, cost and latency tracking and feedback to the AI features we build, and we build the logging so that personal data is masked before it is stored.

Our work begins with a scope step, about one week at a fixed price, that ends in a written plan and a firm quote. We then deliver the build in weekly releases of working software, and a monthly run plan reviews the logs, costs and sampled answers with the client.

Questions

What is LLM observability in simple terms?
It is the practice of recording what your AI features do in production, including prompts, outputs, steps, cost, speed and user feedback. It lets you see why an answer was wrong, what it cost and where the delay came from, so you can fix the cause rather than guess.
Should we store every prompt and answer?
Not forever, and not without thought. Store full text only where you have a clear reason, for a limited period, and with personal data masked. Keep summary metrics longer. Your privacy policy should describe what is kept and why, and your staff should know who can read it.
How is a trace different from a log?
A log records one event, such as a model call. A trace links all the events that belong to one task, such as a search, a model call and a database write, under one identifier. Traces show the order of steps and where the time went, which logs alone rarely show.
Which tools can provide observability?
Several observability platforms support AI calls, and many cloud providers offer logging and tracing. Choose one that lets you mask personal data and set retention periods, then check its current data terms and pricing page before you connect it to production.
How often should we review AI outputs?
Review a random sample every week during the first months after launch, then monthly once the feature is stable. Increase the sample after a prompt or model change. Mark each answer as good, partly right or wrong, and track those results over time.

Have a project in mind?

Tell us what you want to build. We reply with a plan, not a sales call.

AboutLLM observability: how to see what your AI features do in production