You've added latency monitoring. You have error rate alerts. You're using Application Insights.
And your AI system is still silently degrading.
The problem: standard APM tooling was designed for deterministic software. AI systems fail in non-deterministic ways that those tools can't detect. Here are the four signals that will show you what's actually happening.
Signal 1: Token Drift
Token usage is not just a cost metric. It's a quality signal.
When your average prompt token count increases over time without a corresponding increase in queries, something changed in your context assembly. Common causes:
Longer documents being indexed
Conversation history accumulating more turns than expected
A bug in context trimming logic
System prompt expanded by another developer
When token counts drop unexpectedly:
Context trimming is cutting too aggressively
A bug is dropping chunks before they reach the prompt
Retrieval is returning fewer results than expected
Alert on P95 > 5s, not on average > 2s. Averages always look good until they don't.
Signal 3: Cache Hit Ratio
Azure OpenAI supports prompt caching — if you send the exact same prefix in multiple requests, the model charges reduced rates for the cached portion. More importantly, cached prompts respond faster (by up to 50%).
Most teams don't know their cache hit ratio — so they can't tell whether prompt design is cache-friendly.
Signs of poor caching:
System prompt changes frequently (kills cache hits)
Retrieved chunks are injected at the beginning of the prompt (different chunks = different cache)
User name or timestamp injected early in the prompt
Design for caching:
# BAD: User context early kills cachingmessages =[{"role":"system","content":f"You are a helpful assistant for {user_name} at {datetime.now()}."},{"role":"user","content":f"Context:\n{retrieved_chunks}\n\nQuestion: {query}"}]# GOOD: Stable content first, dynamic content lastmessages =[{"role":"system","content":"You are a helpful assistant for AzureFixes users. Answer based on the provided context."},# Stable retrieved context (from common documents — more cacheable){"role":"user","content":f"Context:\n{retrieved_chunks}\n\nUser: {user_name}\nQuestion: {query}"}]
Azure OpenAI marks cached prompt tokens in the usage response:
Track this weekly. If your cache hit ratio is under 30%, your prompt design is costing you money and latency.
Signal 4: Retrieval Quality Drift
This is the most dangerous signal to miss because the failure mode is invisible.
Retrieval quality drift happens when:
Your document corpus changes (new documents indexed differently)
Azure AI Search is re-indexed with different chunk sizes
Your embedding model is updated
Query patterns change (users ask different types of questions)
The AI app continues to return responses. The responses look reasonable. But the retrieved chunks are gradually less relevant, and the model is silently filling the gap with hallucinations.
How to detect it:
Set up a golden dataset — 50–100 representative questions where you know which documents should be retrieved. Run this as a scheduled evaluation:
defevaluate_retrieval(golden_set:list[dict], search_fn)->dict: results =[]for item in golden_set: query = item["query"] expected_doc_id = item["expected_doc_id"] retrieved = search_fn(query, top_k=5) top_ids =[r["id"]for r in retrieved] hit_at_1 = expected_doc_id == top_ids[0]if top_ids elseFalse hit_at_5 = expected_doc_id in top_ids
results.append({"hit_at_1": hit_at_1,"hit_at_5": hit_at_5})return{"recall_at_1":sum(r["hit_at_1"]for r in results)/len(results),"recall_at_5":sum(r["hit_at_5"]for r in results)/len(results),"n":len(results),"evaluated_at": datetime.utcnow().isoformat()}
Run this evaluation daily in CI/CD. Alert if Recall@5 drops by more than 5 percentage points week-over-week.
The Dashboard You Actually Need
Signal
Metric
Alert threshold
Token drift
7-day avg prompt tokens
>20% week-over-week increase
Tail latency
P95 response time
>5 seconds
Cache efficiency
Cache hit ratio
<30% for repeated user sessions
Retrieval quality
Recall@5 on golden set
<75% or >5pp drop week-over-week
These four metrics catch 80% of production AI quality issues before users escalate them.
Standard APM catches service health. These signals catch AI health. You need both.