RAG Observability: How To Observe RAG Systems in Production

Observability Pratik Bhavsar

Key takeaways

  • Observability is distinct from monitoring: While monitoring alerts teams that latency or error rates have crossed a threshold, observability provides the granular trace data, including specific retrieved chunks and model logic, needed to understand why a failure occurred.
  • Failure detection must target the full RAG pipeline: Effective observability surfaces failures across three distinct layers: retrieval (whether context is relevant), generation (whether the model is grounded), and systems (latency and API health), rather than relying on a single aggregate success rate.
  • Proactive resolution requires a "mitigation-first" incident playbook: The most reliable production agents utilize hot-reloadable policies and versioned configuration management to resolve production incidents in seconds, rather than requiring full code redeployments or lengthy root-cause investigations.

A RAG system that performs well in evaluation can still fail in production, and it usually fails in ways your test set never covered. Queries arrive that nobody anticipated. The corpus drifts as documents are added and removed. A model version changes underneath you. None of this shows up as an outage; instead, the system keeps returning fluent, confident answers, and the quality degrades quietly.

Observability is what makes that degradation visible. This guide covers what to trace, which evaluators to alert on, how to tell a retrieval problem from a generation problem in production, and — the part most observability writing skips — what to do once monitoring tells you something broke.

Monitoring vs. observability

Observability and monitoring are often mentioned together, but they answer different questions:

In retrieval augmented generation (RAG), that distinction is concrete. Monitoring tells you latency rose. Observability lets you open a specific request, look at exactly which chunks the retriever returned and what scores they carried, see how the model used them, and confirm whether any guardrail fired. It is the difference between knowing something went wrong and knowing where.

Four must-have capabilities for reliable observability

Four capabilities make up a working observability setup.

Traceability

Traceability records the full path of a request. When a response looks wrong, you need to examine which chunks were retrieved, their scores, how the model used them, and whether guardrails were triggered. Frameworks like LangChain and CrewAI offer built-in tracing, and the structure that matters is the hierarchy: a workflow span as the parent, with retriever and LLM spans nested inside it.

Retrieval evaluation

Retrieval evaluation measures whether the correct information is reaching the generation layer. Chunk relevance and context relevance both run in production, not just during development, and changes in them are usually the first sign of a retrieval or context problem — well before anyone reports a bad answer.

Alerting

Alerting notifies you when performance deviates from normal. Typical alerts cover latency increases, error spikes, drops in retrieval scores and rising hallucination rates. Thresholds should come from baseline performance during a stable period rather than from a number that sounded reasonable at setup time.

Integrated tooling

RAG-focused observability platforms track hallucinations, retrieval scores, and safety evaluators using the same framework from development through deployment. That continuity matters more than it sounds: if your production evaluators differ from the ones you tuned against, you cannot compare a regression to the baseline that preceded it.

What to observe? Four areas for RAG observability

Trace and span structure

Observing the shape of execution is what makes everything else debuggable. A well-instrumented RAG request produces a workflow span containing a retriever span and one or more LLM spans, each with its own inputs, outputs, timing and token counts. Without that hierarchy you have a log line; with it you have a story you can follow.

Retrieved context

Observing what came back from the vector database is essential for assessing whether the information reaching the model was adequate. This means capturing the chunks themselves, not just their count: which chunks were selected, in what order, and whether any of them actually helped.

Model quality evaluators

These tell you how the model behaved with what it was given: whether it stayed grounded in the context, whether it covered the relevant information, and whether it stayed inside your safety and compliance boundaries.

System metrics

Resource utilization, latency and error rates tell you about the operational health of the deployment. They are the easiest to collect and the least informative on their own, which is why they are worth pairing with the three above rather than treating as the monitoring story.

Challenges with RAG: What actually goes wrong in production

What to measure in production

Evaluators fall into seven categories. For a RAG system in production, three of them carry most of the weight: RAG evaluations, safety and compliance evaluators, and response quality evaluators.

RAG evaluators

RAG evaluators, split between retrieval quality and generation quality.

Evaluator
What it tells you
Chunk Relevance
Whether each retrieved chunk contained information that could help answer the query. Binary per chunk.
Context Relevance
Whether the retrieved context as a whole was relevant to the query. Start here before drilling down.
Context Precision
The percentage of relevant chunks in the retrieved context, weighted by position.
Precision @ K
The percentage of relevant chunks among the top K at a specific rank position.
Context Adherence
Whether the response stayed grounded in the provided context. This is your hallucination measure.
Completeness
How thoroughly the response covered the relevant information available in the context.

Safety and compliance evaluators

Safety and compliance evaluators. Each runs on inputs, outputs, or both.

Evaluator
What it tells you
PII
Detects personally identifiable information — credit card numbers, social security numbers, addresses, email addresses — in inputs and outputs.
Prompt Injection
Identifies malicious inputs attempting to override system instructions.
Toxicity
Flags whether content contains hateful or toxic information.
Sexism
Quantifies perceived sexism in inputs and outputs.

Response quality evaluators

Response quality and expression evaluators.

Evaluator
What it tells you
Correctness
Identifies when responses reproduce errors present in the source documents.
Instruction Adherence
Measures how well the model followed prompt instructions on format and specificity.
Ground Truth Adherence
Compares the response against a known correct answer, where you have one.
Tone
Categorises the emotional register of a response, which matters for brand-sensitive applications.

Note on cost

Running LLM-as-a-judge evaluators across 100% of production traffic gets expensive fast, which is why most teams sample and then miss things. Luna evaluation models exists to remove that trade-off: purpose-built small language models, fine-tuned for evaluation, running at roughly $0.02 per million tokens against $2.50 for a frontier model, with average latency near 152 milliseconds rather than several seconds. Most evaluators have both a standard version and a Luna variant, so you can run the cheap one continuously and reserve the expensive one for spot checks.

System metrics

Three operational measures round out the picture, and one of them is usually done wrong.

Product signals

User feedback mechanisms, such as thumbs up/down or star ratings, remain worth collecting. They are noisy and sparse, and they capture something no evaluator does: whether the answer was useful to the person who asked.

Guardrails: Catching problems before the user does

Observability tells you what happened. Guardrails stop some of it from happening at all: Input guardrails filter queries before processing; output guardrails validate responses before delivery.

On the output side, three checks cover most of the risk:

These can run synchronously or asynchronously depending on your latency budget.

High-risk systems in finance or healthcare enforce strict blocking; internal productivity tools often run in logging-only mode to keep responses fast. Runtime guardrails takes this a step further by evaluating LLM and tool inputs and outputs during workflow execution and blocks harmful content, prompt injection, and PII leakage.

Finding the failures you didn’t know to look for

Every evaluator above answers a question you already knew to ask. The failures that hurt most in production are usually the ones nobody wrote a check for.

The traditional approach is to inspect traces manually until a pattern emerges, guess whether the issue lives in retrieval or generation, try to reproduce it locally where it behaves differently, and often wait for several user complaints before knowing there is a problem.

Signals inverts this, sweeping 100% of production traces to surface failure patterns that predefined evaluators and manual searches miss — security leaks, policy drift, cascading failures. Related failures are grouped, and each pattern gets a category and a priority from 1 to 10:

Category
Priority
What it covers
Error
8-10
Failures in application output. Privacy or compliance risks rank highest, then monetary or reputational risk, then user frustration.
Warning
4-7
Recoverable issues and inefficiencies — tool errors with recovery, unnecessary tool usage, inconsistent outputs.
Info
1-3
Notable patterns and correct edge-case handling.

The prioritization question it asks is the right one: how harmful would it be if the user never discovered this issue? Once a pattern is worth tracking, it converts into an evaluator directly, which is how an unknown failure becomes a monitored one.

Setting meaningful alerts

The mistake most teams make is alerting on absolute thresholds picked at setup time. Establish a baseline during a stable period first, then alert on deviation from it. Four alerts cover most of what matters:

  1. Latency increases, measured at p95 and p99 rather than the mean.
  2. Error spikes, by frequency and by type.
  3. Drops in retrieval scores, which usually precede quality complaints by days.
  4. Rising hallucination rates, measured through context adherence.

The third one is the highest-value alert on the list and the one most often missing. Retrieval quality degrades gradually as your corpus grows and drifts, and it degrades silently — no error, no latency change, just answers that get a little worse each week.

Remediation: What to do when something breaks

Detection is only useful if you can act on it safely. Production RAG systems need mechanisms for rapid recovery and controlled change, and these are worth building before you need them.

Versioned components

Every major component has a version: embedding model, vector index, generation model, prompt template. Keeping at least one previous version of each means you can roll back immediately when a change reduces quality, instead of debugging under pressure.

Blue-green deployment

Maintain two environments. Route traffic to one while updating the other, validate thoroughly, then switch. If problems appear, switching back takes seconds rather than a redeploy.

A/B testing and gradual rollout

Route a portion of traffic to a candidate version and compare evaluator scores directly. This works for embedding models, retrieval strategies, reranking methods and prompts. Gradual rollout reduces risk further: start with a small percentage of traffic and expand only once the metrics hold.

The reason to instrument first is that all three of these require a number to compare. Without evaluators running on both arms, an A/B test is two opinions.

Compliance in production

RAG systems handling personal or regulated data have obligations under GDPR, CCPA, HIPAA and SOC 2, and the architecture has to support them. Four requirements come up repeatedly.

Right to erasure is the one that catches teams out. Deleting a user's data means removing it from raw documents, derived chunks, embeddings and indexes — every layer. A deletion that stops at the source system leaves the data live in the vector database, where it can surface in someone else's query months later. Automated workflows are the only reliable way to make sure all references go.

Audit trails should record the user identifier, the query, the retrieved documents and timestamps. Structured logging makes those traceable across services, and it is the same instrumentation your observability already produces.

Requirement
Implementation
Storage needed
Data minimization
Strip PII from embeddings
Separate PII storage
Right to erasure
Cascade deletion across all layers
User-to-document mapping
Audit trails
Structured logging
Query and access logs
Data portability
Export capabilities
Standardized formats

Conclusion

Deploying a RAG system is the start of the work, not the end of it. The systems that stay reliable are the ones where someone can answer, at any moment, which chunks a given response was built from and whether the model stayed inside them.

That capability comes from a short list: trace every request with a real span hierarchy, run evaluators on live traffic rather than sampling, alert on deviation from a baseline instead of a guessed threshold, and keep versioned components so you can undo a bad change in seconds. Add Signals for the failures nobody thought to check, and guardrails for the ones you cannot afford to let through.

None of it is exotic. It is the same feedback loop that makes any production system improvable, applied to a component whose failures happen to be fluent and confident.

Splunk Agent Observability

Understanding your RAG system at work is key to trusting AI systems. Learn about Splunk Agent Observability and get hands-on with the Splunk Observability Cloud Free Edition today

FAQs about observability in RAG systems

How do retrieval-based metrics like chunk relevance help prevent AI hallucinations?
These metrics identify if retrieved information is factually useful, allowing teams to isolate whether a hallucination resulted from poor model reasoning or from the system providing "noise" that misled the model.
Why should latency be tracked as a distribution rather than an average?
Latency averages can mask critical performance issues. Monitoring tail latency (p95 and p99) is essential because these figures often spike due to index fragmentation before the mean is significantly affected.
What is the purpose of tracking false positive rate in a RAG observability setup?
It ensures automated quality gates do not incorrectly block valid traffic. A false positive rate above 2% can cause support teams to lose trust in the system and begin bypassing necessary safety checks.
How does the context memory loss insight improve agentic workflows?
By flagging instances where agents forget prior conversation details, it enables developers to implement state persistence or shared memory, preventing the need for users to repeat information.
Why must guardrail configurations be treated as version-controlled code?
This ensures an immutable audit trail, enables regression testing against historical data in CI/CD pipelines, and allows for instant rollbacks if a new policy causes unexpected performance degradation.

Related Articles

Splunk Developer Spring 2021 Update
Observability
3 Minute Read

Splunk Developer Spring 2021 Update

What’s the latest from Splunk Developer? New SDK release, Setup Pages doc updates, search on dev.splunk.com, .conf21 Call For Speakers coming and more!
How to Instrument a Java App Running in Amazon EKS
Observability
4 Minute Read

How to Instrument a Java App Running in Amazon EKS

Amazon EKS and Kubernetes has become top of mind for many SREs. Learn how to instrument a basic Java application running on Amazon EKS with Splunk APM.
Easier Multi-Dimensional Metrics in Java
Observability
3 Minute Read

Easier Multi-Dimensional Metrics in Java

Discover the two key elements to unlocking the full potential of multi-dimensional metrics in Java with Splunk Infrastructure Monitoring.