A personal learning write-up, drawn from an incident review I studied and retold as a generalised case. The company, the products, the tools, the people and the dates are removed, and components are named by the job they do. Every code snippet, query, alert, metric name and number below is written for this post and is not taken from any real system. The numbers are illustrative and chosen so you can check the arithmetic. The telemetry is what I would build. It is not a description of anything that was running.
The alert fired on time. I'll start there, because it's the uncomfortable part.
A WHAT STOPPED WORKING
in every region
- Chat
- Agents
- Bots inside chat apps
- Search answers
- AI features in the issue tracker
- Live chat on the service desk
People got “access denied” or no answer at all.
B DID ANYONE NOTICE?
- 1The alert firedThe service’s own alert caught it
- 2An incident openedBy itself. Nobody had to raise it
- ✓Detection workedNo time was lost here
C THE QUESTION
So what was the problem?
The alarm did its job. Three other things went wrong.
D PROBLEM ONE: TIME
The warning sign was there the whole time, on a network graph. No alert was watching that graph.
E PROBLEM TWO: THE BACKUP ALARM
The second alarm never spoke up
A central monitor is meant to notice a big outage on its own and raise the urgency. It stayed silent. Its alarm line was set too tight, tighter than a normal day.
- 1A normal day crossed the line
- 2So it was already ringing about nothing
- 3The real outage landed inside that false alarm
- 4It read as more of the same. The urgency was never raised
F PROBLEM THREE: HOW MANY PEOPLE?
The damage count missed most of the damage
One dashboard was built to answer “how many people are hit?”. It only counted requests that reached an AI agent.
That was the blind spot. The outage looked much smaller than it was.
Same user, same permissions as yesterday.
No model misbehaved in this story. I can't find a prompt, a token count or an answer-quality score anywhere in the causal chain. That's why I think it's worth an AI team's time: the failure sat in the plumbing around the model, where most AI monitoring doesn't look.
The system, one block at a time
Ten blocks matter. Click through them before reading on, because the failure only makes sense once you know which blocks share what.
Three design choices let one bad deploy reach everyone.
The first was the shared cache. An experimental long-running agent mode, the long-run path in the diagram, became the default for all chat traffic. It stored its working state in the same cache cluster that held permission answers, and every AI surface needs a permission answer before it does anything. When the agent’s data filled the cache’s network link, permission lookups slowed down with it.
The second was running in a single region. The orchestration service sat next to the model gateway to keep latency low, which meant there was nowhere else to send traffic when that region got into trouble.
The third was the release process. The change passed a short soak in staging and tests at lower scale, then went to all users at once. No small group of real users got it first, so the first real test at full traffic was the whole customer base.
What broke, frame by frame
Here's the whole incident on that diagram. Press Play, or step through with the arrow keys. Watch the strip of four monitors under it as much as the boxes.
Deleting the feature flag switched on the wrong feature. The flag had never been rolled out, and the cleanup kept the code behind it, so the long-running mode began handling nearly every chat request. Each of those requests moved about 75 times more data through the shared cache, and that choked the cache’s network link without one extra request arriving. This is precisely why the usual monitoring showed nothing odd. Request counts were normal. Cache CPU and memory were normal. The resource that ran out was network bandwidth, and it sat on a graph of its own that no alert watched.
× SAME REQUESTS, MORE BYTES
The deploy went out in quiet hours, so the link had room for about two and a half hours. The daily peak did not fit. Through all of it the request count was unchanged, cache CPU read 22% and cache memory read 41%.
From a slow cache to “access denied”
Permission answers lived in the same cache as the agent’s data. Once the network link was full, permission lookups timed out, and each failed lookup became a direct call to the permission service. In the worked example the cache normally answers nine checks in ten. When it answered only three in four, direct calls rose two and a half times and went past the rate limit set for this caller. The permission service rejected the extra calls, the check failed closed as it should, and users saw “access denied” on features that never use the long-running mode.
The permission rate limit had been sized for a cache that always worked. Bronson and colleagues give this gap a name in their paper on metastable failures [1]. Advertised capacity is what a system handles while its cache is helping, and hidden capacity is what it handles without it. Their example is a database behind a cache with a 90% hit rate, which can serve ten times the traffic it could serve alone. This incident was not a metastable failure in their sense, because service recovered once the trigger was removed, and that is why the sustaining loop sits outside the dotted outline. The capacity gap is the same one.
The shape of the incident
The incident has two parts of very different length. In the short one nothing failed and nobody knew. In the long one everybody knew, and each way back to the previous build was blocked.
- The cleanup is deployed in quiet hoursThe unused flag is deleted and the code behind it is kept
- The long-running mode takes nearly all chat requestsEvery request succeeds and moves 75 times more cache data
- The working day starts and traffic climbsCache network use climbs with it, and no alert watches it
- The cache’s network link fills upReads and writes time out, then permission checks fail
- Add more serversThe limit is the cache’s network link, not the serversNo change
- Raise the permission rate limit until it is doubledRate-limit errors fall and cache timeouts riseErrors moved
- Run the rollback commandIt fails with an error that explains nothingBlocked
- Roll back through the deploy pipelineOne step fails intermittentlyBlocked
- Start servers for the previous buildStacks kept from earlier deploys have used up the load balancer’s capacityBlocked
- Pass the health check on the previous buildThat build depends on the same overloaded cacheBlocked
- Delete the old stacks, and the previous build goes liveThe long-running mode drops to zero and cache traffic returns to normal
- Recovery is confirmedPermission answers come from the cache again and direct calls fall under the rate limit
Steps are grouped by kind. Some overlapped on the clock, and the rate limit was still being raised after the first rollback attempt. Durations are rounded.
Five observability blind spots that add to MTTR
Each blind spot below is set out the same way: what was measured before, the metric to add, how it is calculated, and what it reads on a regular day and in this incident. The readings come from the worked example. None of these metrics was running at the time.
1. Which execution mode handled the request
| Measured before | The feature-flag setting for the long-running mode. On a regular day it read “off, 0% of requests”. During the incident it read nothing, because the flag had been deleted. The code behind the flag still ran, and no metric recorded that. |
| Metric to add | ai_route_decisions_total, a counter. It goes up by one each time the router sends a request to a mode. Labels: ai_execution_path (standard or long_run) and the build that served the request. |
| How it is calculated | Requests per minute in one mode, divided by requests per minute in all modes. The result is that mode’s share of traffic. |
| Regular day | long_run 0%, standard 100%. |
| This incident | long_run 97%, standard 3%, from the first minutes after the deploy. |
| Alert | A mode’s share is more than 5 points above its approved share for ten minutes. The approved share for long_run was 0%. |
| Read it with | The build label. The share changes at build 4f2a, which names the deploy that caused it. |
2. How much cache data each request moves
| Measured before | Nothing per request. The cache reported totals, and nobody divided them by request or by mode. |
| Metric to add | ai_cache_io_bytes_total, a counter of bytes read from and written to the cache. Labels: ai_execution_path, the operation (read or write), the kind of key (agent state, permission, session) and the build. |
| How it is calculated | Cache bytes per minute, divided by requests per minute. The result is bytes per request, for each mode and each build. |
| Regular day | 40 KB per request in standard mode. |
| This incident | 3 MB per request in long_run mode, 75 times more, starting at build 4f2a. |
| Alert | A new build moves more than twice the cache bytes per request of the build before it. |
| Read it with | Metric 1. Both change at the same build. The key label shows the extra bytes are agent state, so the new mode is the cause. |
3. How close the cache is to its network limit
| Measured before | Cache CPU and cache memory. They read 22% and 41% on a regular day and the same during the incident. Network throughput was not on the dashboard and had no alert. |
| Metric to add | Network throughput of the cache nodes, in and out, as a share of the limit for that node size. This is an infrastructure metric from the cache itself, and its name depends on the provider. |
| How it is calculated | Live: throughput divided by the limit. Projected: bytes per request (metric 2) times yesterday’s peak traffic, divided by the limit. |
| Regular day | About 1% at the daily peak. |
| This incident | 16% in quiet hours (2,000 requests a minute at 3 MB is 800 Mbit/s of a 5 Gbit/s limit). 104% demanded at the peak (13,000 requests a minute at 3 MB is 5.2 Gbit/s). The projection reads 104% at the deploy. |
| Alert | The projection passes 80% of the limit, or live use passes 70%. |
| Read it with | Metric 2 for the cause. CPU and memory stay flat and say nothing here. |
4. How the permission service is being used
| Measured before | Rate-limit errors returned by the permission service. They read zero on a regular day and rose only once the quota was already used up, so they showed the result and not the cause. |
| Metrics to add | ai_permission_cache_lookups_total, a counter labelled by result (hit, miss, error). ai_permission_outcomes_total, a counter labelled by outcome, reason and source (cache or live). Quota used, which is live calls per minute divided by the per-minute limit the permission service gives this caller. |
| How it is calculated | Hit rate: hits divided by all lookups. Direct calls per check: outcomes with source “live” divided by all outcomes. |
| Regular day | Hit rate 90%. Direct calls per check 0.10. Quota used 60% at the daily peak. |
| This incident | Hit rate 75%. Direct calls per check 0.25, which is 2.5 times as many. Quota used 150%. |
| Alert | Quota used passes 80%, or direct calls per check double. |
| Read it with | Metric 3, and the order of events. If the hit rate fell before the quota ran out, the cache is the cause and a higher limit will not fix it. |
5. What happened to each user request
| Measured before | Agent executions that started, and how many of them failed. At the peak that view read 14,000 executions and 10,500 failures, or 75%. A request stopped at the permission check never became an execution, so it was not counted at all. |
| Metric to add | ai_journey_outcomes_total, a counter that goes up once for every request attempt. Labels: the stage reached (entry, permission, routing, execution, stream), the outcome (completed, denied, failed) and the reason. |
| How it is calculated | Completed attempts divided by all attempts. Failed attempts are then grouped by stage and reason. |
| Regular day | 99.6% of attempts completed. |
| This incident | In the peak five minutes, 50,000 attempts. 3,500 completed (7%). 10,500 failed during execution. 34,500 failed at the permission check with the reason “dependency timeout” or “quota exhausted”. 1,500 were denied by policy, which is correct behaviour and not a failure. |
| Alert | A burn-rate alert on completed attempts against the SLO. The service already had an SLO alert and it fired. The stage and reason labels are the addition. |
| Read it with | Metric 4. The reason on the failed attempts points at the permission service, and metric 4 shows why it was overloaded. |
How the five readings line up
Read in time order, the five metrics give the cause before they give the damage.
| When | What changes |
|---|---|
| At the deploy | Metric 1: long_run share goes from 0% to 97%. Metric 2: cache data per request goes from 40 KB to 3 MB. Both carry build 4f2a. Requests still succeed. |
| Deploy to peak | Metric 3: cache network use climbs from 16% towards its limit as traffic rises. |
| At the peak | Metric 4: hit rate falls from 90% to 75%, direct calls per check rise from 0.10 to 0.25, quota used goes from 60% to 150%. |
| Moments later | Metric 5: completed attempts fall from 99.6% to 7%, and 69% of attempts stop at the permission check. |
Representative dashboard with 5 updated signals
Put the five on one time axis and the order of events is plain. The yellow ring on each panel marks where its alert line is crossed, and the column beside it names the rule and the signals to correlate it with.
1Long-running mode, share of chat requests
ALERT WHENa mode handles 5 points more than its approved share for ten minutes.
CORRELATE WITHthe build id and the deploy marker.
2Cache bytes per request, by build
ALERT WHENa new build moves more than twice the cache bytes per request of the build before it.
CORRELATE WITHpanel 1. If the bytes carry the long-running mode’s label, the mode is the cause.
3Cache network use, share of ceiling
ALERT WHENeither of two things happens.
aForecast. Today’s bytes per request, at yesterday’s busiest traffic, would use more than 80% of the ceiling. The dotted yellow line is that forecast. Here it fires at the deploy.
bLive. Use right now passes 70% of the ceiling. Here it fires as traffic climbs.
CORRELATE WITHpanel 2 for the cause. CPU and memory stay flat and are no guide.
4Permission service, rate-limit quota used
ALERT WHENquota use passes 80%, or direct calls per check double (0.10 to 0.25 here).
CORRELATE WITHthe cache hit rate (90% to 75%) and panel 3. If the hit rate fell first, fix the cache, not the limit.
5User attempts completed
ALERT WHENcompleted attempts burn through the SLO. This alert existed and it fired.
CORRELATE WITHthe stage and reason of each failed attempt. Here 69% ended at the permission check.
Panels 1 and 2 move at the deploy. Panels 4 and 5 move two and a half hours later, and panel 5 is the only one that had an alert.
This dashboard is a proposal drawn from the worked example. The review is clear that nothing showed the cache approaching its limit before the incident opened, so how early a real alert would fire is something to prove by replaying history. Panel 5 cannot warn early at all. Its job is to say how big the problem is, which is what a severity decision needs.
The code behind each signal is below, as sketches written for this post. Tenant, user and conversation ids stay off the metrics and go on spans.
Example: recording the path that ran (Python, OpenTelemetry)
from opentelemetry import baggage, context, metrics, trace
meter = metrics.get_meter("ai.orchestrator")
route_decisions = meter.create_counter(
"ai.route.decisions", unit="{request}",
description="Requests by the execution path that actually ran")
def route(request):
# Decide first. Then record what was chosen, whatever chose it.
if deep_reasoning_enabled(request): # a flag today, a constant after cleanup
path, gate = "long_run", "flag:deep_reasoning"
else:
path, gate = "standard", "default"
route_decisions.add(1, {
"ai.execution.path": path,
"ai.path.gate": gate,
"ai.experience": request.experience, # chat, agents, search_answers ...
})
trace.get_current_span().set_attribute("ai.execution.path", path)
# Baggage: every call below this point can read the path without being handed it.
token = context.attach(baggage.set_baggage("ai.execution.path", path))
try:
return HANDLERS[path](request)
finally:
context.detach(token)
Example: the alert query (PromQL)
sum by (ai_execution_path) (rate(ai_route_decisions_total{ai_execution_path!="standard"}[10m]))
/ on () group_left ()
sum (rate(ai_route_decisions_total[10m]))
> on (ai_execution_path)
(ai_path_approved_exposure_ratio + 0.05)
Example: a metered cache client (Python, OpenTelemetry)
cache_io = meter.create_counter("ai.cache.io", unit="By")
cache_payload = meter.create_histogram("ai.cache.payload.size", unit="By")
oversize = meter.create_counter("ai.cache.oversize_rejections", unit="{write}")
class MeteredCache:
def __init__(self, client):
self._c = client
def _record(self, op, key, nbytes):
attrs = {
"ai.execution.path": baggage.get_baggage("ai.execution.path") or "none",
"cache.operation": op, # read | write
"cache.key_family": key.split(":", 1)[0], # agent_state, permission, session
}
cache_io.add(nbytes, attrs)
cache_payload.record(nbytes, attrs)
def get(self, key):
value = self._c.get(key)
self._record("read", key, len(value) if value else 0)
return value
def set(self, key, value, ttl):
if len(value) > MAX_VALUE_BYTES: # a bound, and a refusal you can count
oversize.add(1, {"cache.key_family": key.split(":", 1)[0]})
raise ValueTooLarge(key, len(value))
self._record("write", key, len(value))
return self._c.set(key, value, ex=ttl)
Example: cache bytes per attempt, by build (PromQL)
sum by (service_version, ai_execution_path) (rate(ai_cache_io_bytes_total[10m]))
/ on (service_version) group_left ()
sum by (service_version) (rate(ai_journey_outcomes_total[10m]))
Example: a permission check that names its failures (Python, OpenTelemetry)
perm_cache_lookups = meter.create_counter("ai.permission.cache_lookups")
perm_outcomes = meter.create_counter("ai.permission.outcomes")
def cached_verdict(user, resource):
if cache_breaker.is_open(): # stop asking a cache that is drowning
perm_cache_lookups.add(1, {"result": "breaker_open"})
return None
try:
verdict = perm_cache.get(key(user, resource), timeout=0.05)
perm_cache_lookups.add(1, {"result": "hit" if verdict else "miss"})
return verdict
except (CacheTimeout, CacheError) as err:
cache_breaker.record_failure()
perm_cache_lookups.add(1, {"result": "error", "error.type": type(err).__name__})
return None # a broken cache is a miss, not a denial
def may_use_ai(user, resource):
outcome, reason, source = "allowed", "none", "cache"
try:
verdict = cached_verdict(user, resource)
if verdict is None:
source = "live"
if not fallback_budget.try_acquire(): # token bucket, sized under the quota
raise FallbackShed()
verdict = permission_service.check(user, resource, timeout=0.3)
if not verdict.allowed:
outcome, reason = "denied", "policy"
except FallbackShed:
outcome, reason = "eval_failed", "fallback_shed"
except QuotaExhausted:
outcome, reason = "eval_failed", "quota_exhausted"
except Timeout:
outcome, reason = "eval_failed", "dependency_timeout"
perm_outcomes.add(1, {"outcome": outcome, "reason": reason, "source": source})
# Still fails closed. Only "allowed" lets the request through.
return PermissionResult(allowed=(outcome == "allowed"), outcome=outcome, reason=reason)
Example: one outcome per attempt (Python, OpenTelemetry)
from contextlib import contextmanager
journeys = meter.create_counter("ai.journey.outcomes", unit="{attempt}")
tracer = trace.get_tracer("ai.orchestrator")
@contextmanager
def journey(experience, tenant_id):
j = Journey(stage="entry", outcome="failed", reason="unknown")
with tracer.start_as_current_span("ai.journey") as span:
try:
yield j
except Exception as err:
if j.reason == "unknown":
j.reason = type(err).__name__
raise
finally:
# Low-cardinality labels on the metric.
journeys.add(1, {
"ai.experience": experience,
"ai.journey.stage": j.stage, # entry | permission | routing | execution | stream
"ai.journey.outcome": j.outcome, # completed | denied | failed
"ai.journey.reason": j.reason,
})
# Who it happened to goes on the span, never on the metric.
span.set_attributes({
"ai.journey.stage": j.stage, "ai.journey.outcome": j.outcome,
"ai.journey.reason": j.reason, "tenant.id": tenant_id,
})
def handle_message(request):
with journey(request.experience, request.tenant_id) as j:
j.stage = "permission"
perm = may_use_ai(request.user, request.resource)
if not perm.allowed:
# "denied" is a working system saying no. "failed" is a broken one.
j.outcome = "denied" if perm.outcome == "denied" else "failed"
j.reason = perm.reason
return forbidden(perm.reason)
j.stage = "routing"
stream = route(request)
j.stage = "stream"
result = stream.run_to_completion()
j.outcome, j.reason = "completed", "none"
return result
What the team changed
The telemetry above is my wish list. The review also records what the team did, and most of it is about containment. I'm passing it on as reported. I haven't checked the current state of any of it.
A production canary boundary now exists, with a soak measured in hours, so a change meets real traffic on a small slice first. Alerts on cache network use were added. Rollback was standardised on the pipeline's default mechanism with a dedicated incident pipeline, and a later production rollback finished well inside its target without help from other teams. Safeguards for abandoned flags were being rolled out, so that removing an abandoned feature is no longer checked like removing a launched one.
Longer-running work was opened as well: moving critical permission caching off the cluster that experiments use, adding timeouts and exception handling to the permission cache path, attributing dependency traffic to each AI experience, regular capacity planning for the permission quota, counting entry-endpoint errors in the impact dashboards, revisiting the single region, and reviewing the long-run agent's resource use before it goes anywhere near wide exposure.
The stack I’d build this on
None of this needs a new product. Large SaaS engineering organisations have mostly converged on the same open pieces, and every signal in this post fits into them.
OpenTelemetry for instrumentation and transport. The SDKs give you the metrics, spans and baggage used above. The Collector gives you tail-based sampling and a place to drop or hash attributes before they leave your network. Three corners of its semantic conventions are relevant here, and it helps to know how settled each one is:
- The GenAI conventions cover inference, agent invocation and tool execution. They moved to their own repository this year and are still marked as in development, so pin the version you emit. Use them at the model call. They don't describe path selection or the user's journey, which is why the
ai.*names in this post are my own. - The feature-flag conventions define a
feature_flag.evaluationevent with the flag key, the variant and a reason. They're at release-candidate stage. Emit them, and remember what they can't do: a deleted flag evaluates nothing. - The database client conventions give you a stable
db.client.operation.duration. As far as I can find, they define nothing for payload bytes. You have to add that yourself.
Prometheus, or a horizontally scaled store that speaks its query language, for metrics. Recording rules turn the ratios in this post into cheap series. Native histograms make payload-size distributions affordable. Exemplars link a spike on a chart to one trace that caused it.
Grafana or an equivalent for the views, with deploy markers on every panel. A trace store such as Tempo or Jaeger behind it. A columnar or log store for wide events, where tenant and user ids can live without multiplying your time series.
OpenFeature for flags, with its OpenTelemetry hook, so evaluations land on the trace that made them. LLM-specific tracing layers built on OpenTelemetry, such as OpenInference or OpenLLMetry, cover the model call in detail. A progressive delivery controller with automated canary analysis, such as Argo Rollouts or Flagger, is where “bytes per attempt, new build against old” turns from a chart into a gate.
Practices matter more than the tools, and these are the ones I'd adopt this week:
- Instrument the branch your code takes. Flags, configs and agent registries describe intent. The branch counter describes what ran.
- Alert on ratios that should stay flat between builds: dependency bytes per attempt, dependency calls per attempt, live calls per cached check. Raw totals rise and fall with traffic and hide a multiplier.
- Put a saturation alert on every finite resource, and write the list down. The USE method (utilisation, saturation, errors) is decades old and it would have put network bandwidth on that list.
- Define the SLO at the user's attempt, with failure stages and reasons. Use multi-window burn-rate alerts on it.
- Treat rate limits as load shedding and say so in the runbook. Before raising one mid-incident, name the number that should improve and watch that number.
- Give every cache call a deadline, a breaker and a budgeted fallback. Size the thing behind the cache for the day the cache is cold.
- Rehearse rollback with a shared dependency degraded. If the rollback gate needs that dependency healthy, you've found your next incident early.
- Check your detectors against their own baselines. One that opens on a healthy day will be busy when you need it.
Where I’d start
I wouldn't build all five signals at once. Three of them cover most of what went wrong in this incident, and the order matters. Once they exist, test each alert before you rely on it.
A BUILD THESE FIRST
- 1The branch counterCount requests by the mode that handled them. It is a small code change and needs no new infrastructure. Of the five signals, it is the one that changes while requests are still succeeding
- 2The metered cache clientRecord how much data each request reads from and writes to the cache, split by mode and by build
- 3The attempt counterRecord one outcome for every request a user makes, including the ones that fail before the agent starts. This changes how the SLO is defined, so expect the agreement to take longer than the code
B THEN TEST THE ALERTS
Trigger each alert once, on purpose
- ✓Route one test tenant to a mode that is not approvedThe alert should fire and name the mode and the build
- ✓Slow the cache down for a few minutesFailed permission checks should be recorded as a dependency timeout, not as a denial
C IN SHORT
Three questions the dashboard should answer
Which mode handled the request, how much it used from each shared dependency, and whether the user got an answer.
References
- Nathan Bronson, Abutalib Aghayev, Aleksey Charapko and Timothy Zhu. Metastable Failures in Distributed Systems. HotOS ’21.
- Benjamin H. Sigelman and others. Dapper, a Large-Scale Distributed Systems Tracing Infrastructure. Google technical report, 2010.
Deepak Biswas is a senior engineering reliability leader working on automated incident detection, impact measurement, resiliency testing and disaster-recovery orchestration. More at https://biswas-ai.com. This article reflects personal learning and opinion, not the position of any employer.

