Why this is hard
In a classic web system, observability means logs + metrics + traces. In an AI system, you need all of that plus one more layer: answer quality. The LLM returned a response, latency was fine, the status code was 200, but the answer was a hallucination. What does your monitoring say about that?
Here are the four layers you need to cover, in order.
Layer 1: Performance (latency, throughput)
Measure:
- TTFT (Time To First Token) per tenant, per LLM provider. p50/p95/p99.
- TTLT (Time To Last Token) - the end of the answer for streaming.
- Retrieval latency separately - pgvector / Pinecone query time.
- Reranker latency separately, if you have one.
- Function call latency, if the system is agentic.
Goal: a bandwidth failure at a single LLM provider must not bring everything down. You need to see who is causing the failure and switch.
Layer 2: Quality (correct answers)
The hard layer. There is no perfect automatic metric.
Measure:
- Refusal rate: the percentage of answers in which the system refused to respond, a sign of weak RAG or recurring hallucinations.
- Citation rate: what percentage of answers include a source citation (in regulated domains it has to be 100%).
- Average number of sources per response.
- User thumbs up/down rate. Yes, it is noisy, but the trend tells you something.
- LLM-as-judge: sample 5% of answers and pass them to a different LLM with an evaluation prompt. It is not perfect, but it catches patterns of degradation.
- Hallucination detection: pattern matching on expressions that indicate "invented information" (specific to each domain).
Layer 3: Cost
Without it, one day you will get a $50K invoice from OpenAI and have no idea what happened.
Measure:
- Cost per request, per tenant, per LLM provider. As a histogram.
- Tokens in / tokens out separately.
- Embedding API cost (yes, that too).
- Alerts on anomalies - one tenant that suddenly burns 10 times as much.
- Daily/weekly cost trend per tenant.
Layer 4: Drift
The model does not change (if you pinned a version). But your users' input changes, and the knowledge base changes. The output can drift slowly without anyone noticing.
Measure:
- Topic distribution: what topics people are asking about this week compared with a month ago.
- Average query length, vocabulary diversity - changes point to a shift in who your users are.
- Top retrieved chunks histogram - which documents are being retrieved. If it changed dramatically without anyone updating the KB, there is a problem.
The tools on the market
- LangSmith - the standard for tracking LLM calls. Growing fast.
- Helicone - a proxy that sits between your code and OpenAI/Anthropic. Zero code changes.
- OpenTelemetry + custom spans - for environments that have to meet enterprise observability standards.
- Arize / WhyLabs - for drift and quality, but overkill for most deployments.
Our setup at SLAtech: OpenTelemetry with custom spans for every LLM call, exported to Grafana and LangSmith in parallel. Two destinations in parallel: if one goes down, the other keeps running.
What not to measure
- GPU utilization, if you use an LLM API. That is the provider's problem.
- Memory of the LLM - it is stateless. Not relevant.
- Generic uptime ratio - 99.99% from an LLM provider says little. Quality regressions are not counted in it.
- Total requests without a breakdown by tenant and provider - a huge number you can do nothing with.
Alerting that wakes you up at night
Hard thresholds only on:
- p95 TTFT > 5 sec - the provider is failing.
- Citation rate < 80% in a regulated domain - RAG is not working.
- Cost-per-request × 3 within an hour - a runaway tenant or a successful prompt injection.
- Refusal rate > 20% - RAG is coming back empty most of the time, there is a problem in the knowledge base.
Everything else goes on a dashboard, not to paging.
Takeaways
- 4 layers: performance, quality, cost, drift. Without quality, your monitoring is half blind.
- Citation rate in regulated domains = mandatory. Without it, the statistics say nothing.
- OpenTelemetry + custom spans + LangSmith in parallel. If one of them goes down, the other keeps working.
- Alerting on only 4 things. The rest goes to dashboards. PagerDuty waking you up over generic uptime leads to burnout.
Further reading
What to read next