AI in Observability

How monitoring tools went from "the graph turned red" to "here's what broke and why."

The job before AI

Meet the on-call SRE (site reliability engineer, an engineer whose job is keeping a system running, not just building it). It's 2:14 a.m. Their phone buzzes: checkout-api p99 latency > 2000ms. That's one alert. Behind it, over the next two hours, they will look at:

  • The alert itself. Which threshold fired, on which metric, for which service.
  • Dashboards. Maybe 5 to 10 of the company's ~30 standard ones, clicked through by hand, looking for anything else that moved at the same time.
  • Logs. Grepping or querying for errors in the 10-minute window around the spike, out of possibly billions of log lines a day company-wide.
  • Traces. Following one slow request through 6 to 12 microservices to see which hop got slow.
  • Deploy history. "Did anyone ship something in the last hour?" Checked by scrolling a CI/CD feed or asking in Slack.
  • Slack. Pinging the team that owns the suspect service, waiting for someone to wake up and reply.

This loop is the job: alert → dashboards → logs → traces → deploy history → Slack. Two numbers describe how well a team does it:

  • MTTD (mean time to detect). The average time from when a problem actually starts to when a human or system notices it (usually via an alert).
  • MTTR (mean time to resolve). The average time from detection to the problem being fixed. The "R" is used loosely across the industry. "Resolve," "repair," "restore," and "remediate" all show up, and different teams start and stop the clock differently. Always ask what a vendor's MTTR number actually measures before comparing it to yours. (Atlassian's incident metrics glossary is a reasonable reference.)

For a mid-size company, one bad incident can easily run 1–2 hours end to end. Much of that time is pure searching: which of the 30 dashboards, which of the 12 services, which of the 4 deploys in the last hour.

The other problem sits upstream of any single incident: alert fatigue. A modern monitoring stack watches thousands of things and pages on a lot of them. Industry surveys report enterprise alert volumes in the thousands per week. Only a small single-digit percentage need real human action. Separate surveys report that more than half of on-call engineers say fewer than 30% of the alerts they get are actually worth acting on (incident.io's SRE alerting guide; IBM on alert fatigue and AI agents). The numbers vary by source and by how "actionable" is defined. But they agree on the shape: most alerts are noise. Humans who see 10+ pages a day start dismissing them out of habit, which is exactly how the real ones get missed. That habit has a name, alert fatigue: the state where you've been paged so often for nothing that you stop reacting quickly to any alert, real or not.

This is the job AI is being layered onto. There is too much data and too many false alarms. A human has to manually connect five different systems under time pressure at 2 a.m.

Where AI fits: the three layers

Every AI feature in an observability product is one of three things. Keep this split in your head for the rest of the chapter — and the rest of the guide.

Task Layer Why that layer Example product feature
Flag a metric that's behaving oddly (a) Classical ML Cheap, fast, runs on every metric continuously; an LLM call per metric per minute would be too slow and too expensive Datadog Watchdog, Elastic ML anomaly jobs
Group 2 million similar error log lines into 12 patterns (a) Classical ML This is clustering (grouping similar things), a solved statistics problem, not a language-understanding problem Elastic log categorization
Forecast disk usage 30 days out for capacity planning (a) Classical ML Time-series forecasting; see ML basics Datadog Toto/forecasting, Dynatrace predictive AI
Turn "show me error rate by region last hour" into a real query (b) LLM Needs to understand free-form English and map it onto a specific query language's syntax Dynatrace Davis CoPilot (NL → DQL), New Relic AI (NL → NRQL)
Explain what a cryptic log line or stack trace means (b) LLM Needs language understanding and general software knowledge, not statistics Elastic AI Assistant, most vendors' "explain this" buttons
Draft a postmortem from an incident's timeline (b) LLM Summarization and writing — an LLM's core strength Most incident-management tools now offer this
Investigate a whole incident: form a theory, check it against logs/traces/deploys, revise, conclude (c) Agent Requires many sequential tool calls, each depending on the last one's result — a single LLM call can't do this Datadog Bits AI SRE, Traversal, Cleric, Resolve AI

(a) Classical ML answers "is this weird?" cheaply, on every data point, all the time. (b) LLM features answer "what does this mean, in English?" for one thing a human points at. (c) Agents answer "why did this happen?" They chain many (a)- and (b)-style steps together, autonomously, the way a human SRE chains dashboard clicks. If you haven't yet, read the agent loop and tool-use basics in the builder track. This chapter assumes you know what "an agent with tools" means, and focuses on what's specific to observability.

Reference architecture

Data sources (metrics, logs, traces, deploy events, topology) are ingested into a time-series DB, log index and trace store. A detection layer of classical ML runs continuously: metric anomaly detection, log pattern clustering, forecasting, outlier detection. When an anomaly score crosses a threshold an alert fires, or a human or agent asks a question. A context and retrieval layer adds service topology, recent deploys, runbooks via RAG and past similar incidents. The LLM and agent layer turns English into queries, explains and summarizes, and runs an investigation loop: hypothesis, pick a tool, read evidence, revise, conclude. It calls tools such as query_metrics, search_logs, get_recent_deploys and get_topology, and presents a hypothesis with evidence and confidence to a human. The human approves or rejects actions such as restart, rollback or scale, and their thumbs up or down feeds back into how hypotheses are ranked next time.
Reference architecture: AI for observability. Read it as: classical ML watches everything, all the time. The LLM and agent only wake up when an alert fires or someone asks, and they stop at a hypothesis with evidence. A human still makes the call.

RAG = retrieval-augmented generation, covered in the builder track — not re-explained here.

Walking it box by box:

  • Data sources. The three observability "pillars" are metrics, logs, and traces. Vendors also increasingly treat two more things as first-class: deploy events (what code changed and when) and topology (which services call which, sometimes called a service map or dependency graph).
  • Detection. Statistics and classical ML run on every metric and log stream continuously. Doing this with an LLM call per data point would be far too slow and far too expensive. This is where 90% of "did something break" decisions are actually made. See ML basics for anomaly detection for the actual math (z-scores, STL decomposition, isolation forests).
  • Context/retrieval. Before an LLM or agent touches an incident, it needs to know the shape of the system. It needs to know which services are related, what changed recently, and (via RAG) what your team's own runbooks say about this kind of alert.
  • LLM/agent layer. This is either a single LLM call (translate this English question into a query, or explain this log line) or a multi-step agent loop (investigate this incident).
  • Tools the agent calls. In production these are typically thin wrappers over the vendor's own query APIs. They run a metric query, search logs matching a filter, list deploys in a window, or fetch the topology around a service.
  • Human in the loop. Every product covered below stops at "here is my hypothesis and the evidence." As of this writing, none of them auto-restart a production service without a human clicking approve. See human approval for destructive actions for the general pattern.
  • Feedback loop. Thumbs-up/down on an agent's conclusion, or which suggested root cause a human actually accepted, feeds back into how future investigations are ranked or prioritized.

Product teardowns

Four teardowns with published detail, then a landscape table of everyone else so you can see how crowded this space got in 2025–2026.

Datadog: Watchdog (Layer a) + Bits AI SRE (Layer c)

What the user sees. A Watchdog Insight appears on a dashboard on its own. Datadog flagged a metric as unusual without anyone setting up an alert for it. Separately, when a real alert fires, Bits AI SRE starts an automatic investigation in the background. It posts a summary (hypothesis, the queries it ran, and links to the evidence), usually within a few minutes, before a human has finished opening their laptop.

How it works (published).

  • Watchdog is Datadog's always-on anomaly/outlier/forecast engine. Datadog describes it as learning what "normal" looks like across billions of events. It flags deviations without a human configuring per-metric thresholds (Watchdog blog).
  • Watchdog RCA (root cause analysis) sits on top of that. It looks for causal relationships between anomalies across services in Datadog APM. It tries to point at the one service where a problem actually originated, rather than every service downstream of it that also looks unhealthy (Watchdog RCA blog). This is Layer (a): statistical/causal correlation, no LLM involved.
  • Bits AI SRE is the agent layer, launched in late 2025 and updated through 2026 (launch coverage; Datadog's own "how we built it" post). Datadog's own description: it mimics how a human SRE thinks. It forms hypotheses, tests them against live telemetry, and follows the evidence to a root cause. A 2026 update added a new "agent harness" with MCP-based tool access, pulling from metrics, logs, traces, dashboards, deploy/change events, source code, Real User Monitoring, Database Monitoring, Network Path data, and the Continuous Profiler. This finishes typical investigations in 3–4 minutes (Bits Investigation update). It can take seven kinds of triage actions, including posting to Slack, opening a Datadog incident, and filing a Jira ticket. It stops short of restarting or rolling back anything.
  • Datadog publishes an official MCP server (docs.datadoghq.com/mcp_server) exposing metrics, logs, monitors, dashboards, and security signals to any MCP-compatible agent. Notably, this lets other companies' agents (built with Claude, Cursor, etc.) query Datadog data directly, not just Datadog's own agent.

Likely architecture. Inferred: Bits AI SRE is very likely a standard orchestrator-style agent loop. An LLM gets a system prompt describing SRE investigation method, plus a fixed toolbelt (the same APIs the MCP server exposes). A loop keeps calling tools until it has enough evidence to state a hypothesis with a confidence level. Datadog hasn't published the exact prompt or loop control logic. But the "Agent Trace view" it ships (showing every tool call and which hypotheses were eliminated) is consistent with a plain ReAct-style loop, not anything exotic.

The clever part. Datadog layers the agent on top of Watchdog RCA, not instead of it. The statistical layer narrows "something is wrong somewhere" down to a specific service before the LLM-driven investigation even starts. So the agent's search space is small.

Limits the vendor admits. Datadog frames Bits AI SRE's output as an investigation ("hypothesis + evidence"), not a verdict. It gives the agent read/comment/ticket actions rather than restart/rollback actions. That's an implicit admission that its conclusions aren't yet trusted enough to act on unsupervised.

Dynatrace: Davis AI (Layer a) + Davis CoPilot (Layer b)

What the user sees. Dynatrace draws a live map of every service, host, and dependency (Smartscape). When something breaks, it points at one box on that map as the cause, with no alert storm across ten downstream services. Separately, a chat panel (Davis CoPilot) lets you type "show me error rate by service last hour" and get a chart.

How it works (published). Dynatrace is explicit about running three different kinds of AI, not one, and names them itself:

  • Causal AI is deterministic, not correlation-based. Dynatrace's own description: it uses fault-tree analysis across the real-time dependency graph to trace a system-level failure down to the component-level failure that caused it (Dynatrace: "What is causal AI?"). This is the key contrast with Datadog Watchdog RCA above. Dynatrace's pitch is that because it already has the full topology graph, root cause is a graph-traversal problem, not a statistical-correlation problem. Same goal, different published mechanism.
  • Predictive AI is classical forecasting/trend models (Layer a) used for capacity and business-impact prediction.
  • Generative AI (Davis CoPilot) is the LLM layer: natural language to DQL (Dynatrace Query Language), explaining existing queries, and generating dashboards/workflows from a prompt. Dynatrace's own material says CoPilot "uses its custom-trained large LLM" for this. It does not name the base model, its size, or disclose fine-tuning details publicly (Dynatrace blog). Inferred: a smaller, task-specific model trained heavily on DQL syntax would make sense for a fixed-grammar translation job like this. But treat that as reasoning, not a published fact. An earlier draft of this section stated a specific model name and size that this source does not actually support. That claim has been removed. You can choose to auto-run the generated query, or have it shown to you first (the validate-before-run pattern covered in Patterns you'll reuse below).

Likely architecture. Inferred: the causal engine is almost certainly not an LLM at all. It's a graph algorithm over Smartscape's dependency data, which is why Dynatrace calls it "deterministic" (same input, same output, unlike an LLM). Davis CoPilot is a separate LLM bolted on for the language-facing parts. Dynatrace hasn't published which model(s) it uses, how large they are, or exactly how the causal engine and CoPilot are wired together in a single investigation flow. Treat all of that as unverified.

The clever part. Dynatrace keeps the deterministic causal engine and the generative language layer as two separate systems, each with its own job. It doesn't ask one LLM to both find the root cause and explain it. So the "finding" step stays reproducible, even though the "explaining" step doesn't have to be.

Limits the vendor admits. Dynatrace's causal approach depends on Smartscape actually having accurate topology data. If instrumentation is incomplete, the dependency graph has gaps, and the "deterministic" root cause can point at the wrong node. This isn't stated outright in marketing copy, but it follows directly from how the mechanism is described.

Naming note: Dynatrace's current product docs (checked September 2026) refer to this conversational feature as "Dynatrace Assist" rather than "Davis CoPilot." The two names appear to refer to the same feature. "Davis CoPilot" was the original 2025 launch name, and "Assist" is the current one. Both names still appear across Dynatrace's own site as of this writing. Verify current naming before publishing anything time-sensitive.

Grafana: Assistant Investigations (Layer c) + Sift (Layer a)

What the user sees. Two separate things, on purpose. Sift runs constantly and quietly in the background on Kubernetes clusters, using a fixed set of built-in detectors. No prompt is needed. Grafana Assistant Investigations (reached general availability in 2026) is prompt-driven: you describe an incident, and it "swarms" over your metrics, logs, and traces, forming and testing hypotheses.

How it works (published).

  • Sift is ML-powered but not LLM-powered. It's a set of curated detectors that scan Kubernetes signals for known bad patterns and flag them, free in Grafana Cloud. This is Layer (a).
  • Assistant Investigations is Layer (c). Grafana's own phrase is that it forms hypotheses and "chases down the leads in the data, proving or disproving each one" (Grafana docs; launch coverage).
  • Grafana publishes an open-source MCP server (Grafana MCP docs) that exposes Grafana Incident (create/list/update incidents) and Sift (list investigations, fetch analyses, find error patterns in logs, find slow requests) as tools. Grafana's own docs give a concrete example: composing this with the GitHub MCP server so an investigation can correlate a telemetry anomaly with the code or deploy that likely caused it. It's a nice, published example of the "tools from multiple vendors, one agent" pattern MCP is designed for.

Likely architecture. Inferred: given the "swarms" language and the MCP-based tool integration, this looks like a standard multi-tool agent loop. It possibly runs several hypothesis branches in parallel and merges results (an orchestrator/worker pattern; see the builder track). Grafana hasn't published the orchestration internals.

The clever part. Grafana keeps Sift (cheap, deterministic, no-prompt-needed, Layer a) completely separate from Assistant Investigations (Layer c, more expensive, prompt-driven) instead of merging them into one product. It's a clean illustration of why the three-layer split in this guide matters commercially, not just pedagogically.

Limits the vendor admits. Sift explicitly ships as free and narrow (Kubernetes-only, curated detectors) rather than general-purpose. Grafana isn't claiming it replaces broader investigation.

New Relic: New Relic AI / NRAI (Layer b) + MCP-based agents (Layer c)

What the user sees. A chat panel across the New Relic UI where you type a question in English ("what's my error rate for checkout in the last 2 hours") and get back a chart plus the underlying NRQL (New Relic Query Language) query it ran, alongside AI-written summaries on alert pages.

How it works (published).

  • New Relic AI (NRAI) translates natural language into NRQL and explains observability concepts. New Relic reached general availability on an "agentic" version of this in 2026 (New Relic blog). New Relic has published that earlier versions used models including OpenAI's GPT-4 for this translation (New Relic blog). Treat the specific model as a snapshot in time; vendors change underlying models often and rarely commit to one publicly for long.
  • Response Intelligence (an alerting feature) automatically reads up to 100,000 log entries in the time window around a firing alert. It surfaces patterns and likely causes, and suggests mitigation steps per cause (New Relic docs). This is a good concrete number for the "telemetry volume vs. context window" problem in What goes wrong. New Relic doesn't feed 100,000 raw log lines to an LLM. It necessarily pre-aggregates or samples before any model sees them, though the exact pre-processing isn't detailed publicly.
  • New Relic published an MCP server in mid-2026, specifically framed around building agentic "incident triage assistants." These investigate an incident, assemble a root-cause brief with evidence links, and hand off a tracked task to a human (AWS/New Relic joint blog).

Likely architecture. Inferred: NRAI's NL-to-NRQL path is a single LLM call with schema and grammar context, similar in spirit to Dynatrace's. New Relic hasn't published whether it fine-tunes its own model the way Dynatrace does. The MCP-based "agentic incident triage" pattern is explicitly a build-your-own-agent-on-our-data story, not a single New Relic product. This is worth noting: it shows a vendor choosing to expose tools over MCP and let customers build the Layer (c) agent, instead of shipping the whole agent itself.

The clever part. New Relic publishes the MCP server as infrastructure for other people's agents, not just its own chat feature. It's a bet that the value is in owning the data and the query layer, not in owning the agent loop on top of it.

Limits the vendor admits. New Relic frames Response Intelligence's output as suggestions tied to identified "potential causes" (plural), not a single answer. That's an implicit hedge that log summarization surfaces candidates, not certainty.

The wider landscape (verified names, lighter detail)

Vendor and startup names in this space change fast. Table below reflects names verified via official sources as of September 2026.

Company Product name (verified) Layer What's published
Elastic AI Assistant for Observability; ML anomaly detection jobs; log categorization a + b 100+ prebuilt anomaly jobs; log categorization groups similar log lines by clustering (Elastic Observability Labs); AI Assistant uses RAG over your own runbooks/knowledge base to explain issues (Elastic docs)
PagerDuty PagerDuty Advance, incl. an "SRE Agent" b + c Correlates alerts and accelerates root-cause analysis using ingested telemetry from an ecosystem of 30+ AI partners (announced March 2026); partners named include Anthropic, Cursor, and LangChain (PagerDuty newsroom)
Traversal Traversal (traversal.com) c Startup built by causal-inference researchers; builds a real-time dependency graph ("Production World Model") and runs causal search across it rather than an LLM reading raw logs; claims 82% root-cause accuracy and a 32% MTTR reduction at a named enterprise customer, American Express (Traversal blog) — customer-reported numbers, not independently audited
Cleric Cleric (cleric.ai) c Read-only investigation agent that posts findings with a confidence score to Slack; explicitly does not auto-remediate; publishes that it uses continuous learning from engineer feedback to improve which investigation paths it tries next (Cleric blog via ZenML LLMOps case study)
Resolve AI Resolve.ai — "AI SRE" c Pitches itself as "machines on-call for humans": triages on-call alerts, investigates incidents alongside engineers, monitors deployments for anomalies, and generates postmortems/runbooks (Resolve AI product page). Note: claims about its founders' background and a specific funding valuation circulate in tech press, but this guide couldn't independently confirm them from Resolve AI's own site, so they're left out here — verify directly before repeating them.

A note on this table: several of these (Traversal, Cleric, Resolve AI) are venture-funded startups. Their main public evidence is their own blog posts and press coverage, not independent benchmarks. Treat their accuracy and MTTR-reduction numbers as vendor-reported, the same way you would treat a claim from an established vendor's marketing page. They're useful as a directional signal, not a verified fact.

Patterns you'll reuse

Grounding on your own telemetry. An observability agent is only useful if every claim it makes is backed by a query it actually ran against your data, not the model's training data about "typical" systems. Every product above shows its work (a trace, a link, a query) rather than just an answer, for exactly this reason.

BAD:  "The checkout service is probably overloaded."   <- sounds plausible, unverified
GOOD: "checkout-api p99 latency: 210ms -> 2400ms at 02:11 UTC
       (query: avg:latency.p99{service:checkout-api} last 30m)
       Deploy at 02:09 UTC: PR #4821 'add retry logic'   <- evidence, with timestamps
       Hypothesis: the new retry logic is causing request pile-up. Confidence: medium."

Topology/service-map as context. Before investigating a single service, an agent (or the statistical layer under it) needs to know what that service depends on and what depends on it. Dynatrace's Smartscape and Datadog's Service Catalog exist specifically to give this graph to both humans and the AI layer — this is retrieval, just of structural data instead of documents.

Hypothesis → evidence → conclusion loop. The core agent pattern across every Layer (c) product in this chapter:

1. Form a hypothesis from the alert + topology  ("service X is the likely cause")
2. Pick a tool and a specific query to test it   (search_logs, query_metrics, ...)
3. Read the result: does it support or rule out the hypothesis?
4. Rule out -> go to 1 with a new hypothesis.  Supports -> gather more evidence or conclude.
5. Present: hypothesis + evidence trail + confidence, NOT just a verdict.

This is the same ReAct-style loop from the builder track's Phase 1 agent loop — the only domain-specific part is the tool set and the system prompt describing how an SRE investigates.

NL-to-query with validation. Never trust a generated query blind. Every serious vendor uses the same pattern: generate the query, actually run it (or at least parse it) before showing a result. If it errors, feed the error back to the model to retry. It's the same "does it parse, does it run" check you'd want for any generated code.

def nl_to_query_and_run(question: str, query_client) -> dict:
    query = generate_query(question)          # LLM call: English -> query language
    try:
        result = query_client.validate(query)  # ask the backend "is this well-formed?"
    except QuerySyntaxError as e:
        query = generate_query(question, prior_error=str(e))  # one retry, with the error
        result = query_client.validate(query)
    return {"query": query, "result": query_client.run(query)}

Confidence + evidence, not verdicts. Every product covered in Product teardowns reports a confidence level, explicit (like Cleric's confidence score) or implicit (like Datadog's "hypothesis"), rather than a flat verdict. This is a deliberate hedge against the failure mode in What goes wrong.

MCP servers as the shared plumbing. Datadog, Grafana, and New Relic all publish an MCP server (Phase 2: Chat Agents, for Real (Weeks 4–9) covers MCP itself). This enables one agent (Claude Code, a customer's own agent, or the vendor's own AI SRE product) to call tools across multiple vendors' data in one investigation. For example, Grafana's docs show composing their MCP server with GitHub's to connect a telemetry anomaly to the code change that caused it.

What goes wrong

Plausible-but-wrong root cause. An LLM is good at writing a convincing explanation whether or not it's correct. It will confidently name a service as the cause because the story hangs together, not because the evidence proves it. This is the single biggest reason every vendor in Product teardowns ships a confidence score and an evidence trail instead of a bare answer. It lets a human sanity-check the story before acting on it.

Telemetry volume vs. context window. A busy service can produce millions of log lines an hour. An LLM's context window (the amount of text it can read at once, covered in how LLMs work) can't hold that. New Relic's own "up to 100,000 log entries" figure for its alert-summarization feature is a concrete example of the ceiling vendors hit. Above it, they must pre-filter, sample, or cluster (Layer a) before an LLM ever sees the data.

Cost of querying huge data. Every tool call an agent makes against a metrics or log backend can be an expensive query in its own right. Scanning terabytes of logs isn't free. An agent that tries 20 hypotheses, each requiring 3–4 queries, can rack up real infrastructure cost on top of the LLM token cost. This is part of why Datadog and Cleric both publish typical investigation times (3–4 minutes). It's implicitly also a cost/scope bound.

Prompt injection via log lines. Logs routinely contain attacker-controlled text: a malicious URL, header, or username that got logged as part of normal request handling. If an agent reads that log line as part of its investigation, the attacker's text becomes part of the agent's prompt. Recent security research names this specifically. LogJack describes indirect prompt injection through cloud logs against LLM debugging agents (arXiv:2604.15368). A related paper, "Poisoning the Watchtower," studies the same class of attack against LLM-augmented security operations via adversarial log content (arXiv:2605.24421). The core problem is structural: the evidence stream an agent is supposed to read for clues is the same channel an attacker can write to. This is the observability-specific case of the general prompt-injection problem covered in the builder track. Treat any log content read by an agent as untrusted input, never as instructions.

Acting on a wrong conclusion. This is the riskiest version of the above. An agent might also act (restart a pod, roll back a deploy, scale a service) based on a hypothesis that turns out to be wrong. Every product in this chapter's teardowns currently stops short of this for production-impacting actions (see human approval for destructive actions). That's itself evidence that even vendors who trust their own agents' investigations don't yet trust their agents' actions without a human in between.

Alert fatigue, reborn as investigation fatigue. Say an agent runs an automatic investigation on every alert and posts a summary to Slack. If most of those alerts were noise to begin with (The job before AI), you've just automated the noise instead of reducing it. A wall of confident-sounding AI summaries is not obviously better than a wall of raw alerts if most of them are still wrong or irrelevant.

How you'd measure it

Metric What it means Why it matters here
MTTD (mean time to detect) Time from problem start to it being noticed Layer (a) detection speed is what moves this
MTTR (mean time to resolve) Time from detection to fix The number every vendor markets against; watch what exactly is being measured (see The job before AI)
Time to first hypothesis Time from alert to the agent proposing any theory A narrower, easier-to-compare number than end-to-end MTTR; several vendors cite "minutes" here
Root-cause accuracy % of investigations where the agent's stated cause was the real one, confirmed after the fact by a human The number vendors are least willing to publish rigorously — treat vendor-reported figures (like Traversal's 82%) as directional
Alert noise reduction % drop in pages sent to a human after correlation/dedup Directly targets the alert-fatigue problem in The job before AI
Acceptance rate % of an agent's conclusions a human accepts as-is vs. overrides A practical proxy for trust, and a good feedback signal for the loop in Reference architecture

Build it yourself

Goal: a small agent that investigates a synthetic incident. Given an alert, it should form a hypothesis, gather evidence with tools, and output a hypothesis, evidence, and confidence: the same shape every product in Product teardowns uses. This is deliberately small. The guide's capstone builds a fuller version of this same idea (more tools, a real metrics/log backend, multi-agent investigation), so don't over-build here.

Setup: a fake dataset, no infrastructure needed.

# fake_data.py — a tiny synthetic incident, all in memory
METRICS = {
    # service -> list of (minute, p99_latency_ms)
    "checkout-api": [(m, 180) for m in range(0, 30)] + [(m, 2400) for m in range(30, 60)],
    "payments-api": [(m, 90) for m in range(0, 60)],   # unaffected, for contrast
}

LOGS = [
    {"ts": 31, "service": "checkout-api", "level": "ERROR",
     "msg": "connection pool exhausted: waited 5000ms for connection"},
    {"ts": 32, "service": "checkout-api", "level": "ERROR",
     "msg": "connection pool exhausted: waited 5000ms for connection"},
    {"ts": 45, "service": "payments-api", "level": "INFO", "msg": "request completed 200 OK"},
]

DEPLOYS = [
    {"ts": 29, "service": "checkout-api", "pr": "#4821",
     "summary": "add retry logic on payment gateway timeout"},
]

Tools the agent gets. Three functions, matching the assignment: query_metrics, search_logs, get_recent_deploys. Each is a thin wrapper over the fake data above — in a real system these would call Prometheus, Loki, or a vendor API instead.

def query_metrics(service: str, minutes_back: int = 60) -> list[tuple[int, float]]:
    """Return (minute, p99_latency_ms) points for a service."""
    return [p for p in METRICS.get(service, []) if p[0] >= 60 - minutes_back]

def search_logs(service: str, level: str = "ERROR") -> list[dict]:
    """Return log lines for a service, optionally filtered by level."""
    return [l for l in LOGS if l["service"] == service and l["level"] == level]

def get_recent_deploys(service: str, minutes_back: int = 60) -> list[dict]:
    """Return deploys for a service within the window."""
    return [d for d in DEPLOYS if d["service"] == service and d["ts"] >= 60 - minutes_back]

The agent loop, using the Anthropic Messages API's tool use. This is the same tool-use loop from the builder track's Phase 1 — only the tool set and system prompt are domain-specific.

import json
from anthropic import Anthropic

client = Anthropic()

TOOLS = [
    {"name": "query_metrics", "description": "Get p99 latency for a service.",
     "input_schema": {"type": "object",
                       "properties": {"service": {"type": "string"}},
                       "required": ["service"]}},
    {"name": "search_logs", "description": "Search error logs for a service.",
     "input_schema": {"type": "object",
                       "properties": {"service": {"type": "string"}},
                       "required": ["service"]}},
    {"name": "get_recent_deploys", "description": "List recent deploys for a service.",
     "input_schema": {"type": "object",
                       "properties": {"service": {"type": "string"}},
                       "required": ["service"]}},
]

TOOL_FUNCS = {"query_metrics": query_metrics, "search_logs": search_logs,
              "get_recent_deploys": get_recent_deploys}

SYSTEM = """You are an SRE investigating a production alert. Form a hypothesis, then use tools
to gather evidence that supports or rules it out. Keep going until you have enough evidence to
state a root cause, or you've tried the obvious leads and found nothing — whichever comes first.
When you conclude, respond with a hypothesis, the evidence for it (with timestamps), and a
confidence level (low/medium/high). Never state a cause you have no evidence for."""

def investigate(alert: str) -> str:
    messages = [{"role": "user", "content": alert}]
    for _ in range(6):  # hard cap: never let an investigation loop forever
        resp = client.messages.create(
            model="claude-sonnet-5", max_tokens=1024,
            system=SYSTEM, tools=TOOLS, messages=messages,
        )
        messages.append({"role": "assistant", "content": resp.content})
        if resp.stop_reason != "tool_use":
            return resp.content[-1].text  # final hypothesis + evidence + confidence
        tool_results = []
        for block in resp.content:
            if block.type == "tool_use":
                result = TOOL_FUNCS[block.name](**block.input)
                tool_results.append({"type": "tool_result", "tool_use_id": block.id,
                                      "content": json.dumps(result)})
        messages.append({"role": "user", "content": tool_results})
    return "Investigation inconclusive after 6 steps."

print(investigate("Alert: checkout-api p99 latency > 2000ms"))

A correct run looks like this. The agent calls query_metrics("checkout-api") and sees the jump at minute 30. It calls search_logs("checkout-api") and sees the connection-pool errors starting at minute 31. It calls get_recent_deploys("checkout-api") and sees PR #4821 landed at minute 29, one minute before the errors start. It concludes with medium-to-high confidence that the retry-logic deploy caused connection pool exhaustion, citing all three pieces of evidence with timestamps.

This alert was hand-written for the example. For the underlying anomaly detector that would normally trigger it, see ML basics for anomaly detection. A z-score or STL-based detector on the checkout-api metric stream is enough to flag the minute-30 jump.

(Go note: the same loop — tool schemas, a for loop calling the Messages API, dispatching on stop_reason == "tool_use" — is what you already wrote in the builder track's Go agent; only the tool bodies change.)

Done when:

  • ☐ The agent calls at least two of the three tools before concluding (not just metrics).
  • ☐ Its final answer names a specific timestamp-backed piece of evidence for each claim.
  • ☐ It states a confidence level, not just a flat verdict.
  • ☐ If you delete the deploy event from DEPLOYS, the agent's confidence visibly drops. Test this. It's a cheap way to check the model isn't just pattern-matching to "recent deploy = cause" regardless of evidence.
  • ☐ The loop has a hard step cap (shown above: 6) so a confused agent can't loop forever.

Check yourself

Question 1

Why can't you just point an LLM at your raw metrics and ask "is this an anomaly?" every minute?

Show answer

Cost and speed. Classical statistics (z-score, STL, isolation forest) can score a metric in microseconds for free. An LLM call per metric per minute, across thousands of metrics, would be far slower and far more expensive than the statistics, and no more accurate for this narrow job. See ML basics for anomaly detection.

Question 2

What's the structural difference between Dynatrace's "causal AI" root cause approach and Datadog's Watchdog RCA?

Show answer

Dynatrace describes its approach as deterministic: fault-tree analysis over a real-time topology graph (Smartscape) that it already maintains. Datadog describes Watchdog RCA as finding causal relationships between anomalies across services via statistical/ML correlation. Both aim at the same output (a specific root-cause service). But Dynatrace's published mechanism leans on having an accurate dependency graph first, while Datadog's leans on correlating anomaly signals.

Question 3

Why does every AI SRE product in this chapter show its evidence instead of just stating a root cause?

Show answer

Because an LLM can produce a fluent, confident-sounding explanation whether or not it's actually correct. Showing the queries run and the evidence found lets a human sanity-check the conclusion before acting on it. That's also why these products avoid taking destructive actions (restart, rollback) without a human approving first.

Question 4

What makes log lines a specific prompt-injection risk for an observability agent, that (say) a metrics dashboard isn't?

Show answer

Log lines routinely contain text an attacker controls directly: a URL, header, or username sent in a request and then logged verbatim. If an agent reads that log line as evidence, the attacker's text becomes part of the agent's prompt (indirect prompt injection). A pure number in a metrics time series has no comparable free-text channel for an attacker to write through.

Question 5

In the "build it yourself" agent, what's the hard cap in the loop for, and what would happen without it?

Show answer

The for _ in range(6) cap prevents an agent that never gets a clear answer from calling tools forever, burning tokens and money. Without it, an agent stuck between two inconclusive hypotheses (or one that keeps re-checking the same tool) could loop indefinitely — the same runaway-loop risk covered generally in the builder track's guardrails phase.

Question 6

Name one place in this chapter where a vendor's own published numbers should be treated as directional rather than verified fact, and why.

Show answer

Startup claims like Traversal's "82% root-cause accuracy" and "32% MTTR reduction at American Express" are vendor-reported, from the vendor's own blog, without an independent audit or published methodology for how accuracy was measured. Treat them the way you'd treat any marketing-page statistic — useful signal, not proof.

Sources

Next

Next: AI in Security and Threat Detection — the same three-layer split, applied to a SOC analyst instead of an SRE, where the stakes of a plausible-but-wrong conclusion (and of an attacker deliberately feeding an agent bad evidence) are even higher.