Topic 4 of 4 · 4 min read
Monitoring index health and staleness
Goal: Define index health checks and alert thresholds and find the broken stage from a set of pipeline metrics.
A RAG pipeline usually fails silently: it keeps answering while documents stop arriving, so define a few health numbers, alert on thresholds, and read them in pipeline order to find the broken stage.
Check yourself · 1 of 3
A nightly ingestion job exits with code 0, yet users report old answers. What does this show?
Why it matters
When a crawler token expires or a parser starts returning empty text, nothing crashes. Users just get older or thinner answers, and nobody notices for weeks. The index looks healthy because it still returns results. Monitoring is the only thing that turns a silent failure into a ticket.
How to do it
Track one or two metrics per stage, from source to index.
- Source: documents listed per run. A sudden drop to zero or a 30 percent fall means a broken connector or revoked access.
- Sync age: time since the last successful run, per source. Alert when it passes twice the schedule interval. A source that syncs hourly and has not synced in three hours needs a look.
- Parse: failed parses and empty extractions per run. A scanned PDF with no OCR yields an empty string without any error.
- Chunk: chunks per document and the share of empty or very short chunks. A document that produced 0 or 1 chunk deserves a check.
- Embed: error rate and retry count. Rate limits or a changed model name can make embeddings fail while the job reports done.
- Index: document and chunk counts compared with the manifest. If the manifest says 18,204 and the index holds 17,900, chunks were lost.
- Quality: a small canary set of questions with known answers, run daily. If recall on the set drops, something upstream changed even when all counters look fine.
Set thresholds from a normal week, not from guesses. Alert on rate of change as well as absolute values, and route alerts to someone who owns the pipeline.
Before and after
Before: "Pipeline OK" (job exit code 0)
After:
source_listed=0 <- connector auth expired
last_sync_age=27h <- alert: > 2 x 6h schedule
parse_empty_rate=0.41 <- OCR step skipped
index_docs=17900 vs manifest=18204
canary_recall@5=0.62 <- was 0.90 last week
What goes wrong
- Only watching exit codes. A job can exit 0 after processing nothing.
- Alert fatigue. Too many noisy thresholds get muted. Start with five alerts that each have an owner and an action.
- Metrics without a baseline. "41 percent empty" means nothing until you know the usual rate is 2 percent.
- No canary questions. Counters show the pipeline ran, not that it still finds the right passages.
Examples
Reading metrics in pipeline order
Docs listed 4,120 (normal), last sync 40 minutes, parse empty rate 38 percent (normally 2), chunks per document 0.6 (normally 11). The break is at parsing: documents arrive but extraction returns almost nothing, likely a changed file format or a skipped OCR step. Embedding and index look fine because they only process what they receive.
Five alerts to start with
Sync age over two schedule intervals. Listed documents down more than 30 percent. Empty parse rate above 10 percent. Index count differs from manifest by more than 1 percent. Canary recall at 5 drops more than 0.1 from baseline. Each names an owner and the first thing to check.
Key points
- A RAG pipeline fails silently, so a zero exit code proves nothing about freshness.
- Track one or two metrics per stage: listed documents, sync age, parse failures, empty chunks, embed errors and index counts.
- Compare index counts with the manifest and sync age with the schedule to catch lost data and stalled jobs.
- Set thresholds from a normal week and alert on change as well as absolute values.
- A daily canary set of known questions catches quality drift that counters miss.
Common mistakes
- Treating a job's success exit code as proof that the index is fresh.
- Setting thresholds without a baseline from normal operation.
- Creating dozens of alerts that nobody owns until all get muted.
- Counting documents but never testing retrieval with known questions.
Check yourself · 2 of 3
A source syncs every 6 hours and the last success was 19 hours ago. Which alert catches this?
Check yourself · 3 of 3
Documents listed and chunks embedded are normal, but 40 percent of parsed documents yield empty text. Which stage is broken?
Practice items, not counted towards your mastery.
Start here
- Ingestion pipeline (LlamaIndex docs) (opens in a new tab)DocsFree
Shows a document store that hashes documents so unchanged ones are skipped on re-runs.
- Delete records (Pinecone docs) (opens in a new tab)DocsFree
Delete by id, by id prefix or by metadata filter, and what a delete does and does not remove.
- Art. 17 GDPR: Right to erasure (opens in a new tab)StandardFree
The legal text behind erasure requests: when data must be erased and the stated exceptions.
More for this topic
- Change and deletion detection in blob indexing (Azure AI Search) (opens in a new tab)DocsFree
A managed indexer's approach to change tracking and soft-delete markers for removed source files.