How to Use AI for Root Cause Analysis from Traces in 2026

AI Root Cause Analysis From Traces: A Step-by-Step Guide

Written by: Nimesh Chakravarthi, Co-founder & CTO, Struct | Last updated: October 28, 2026

Key Takeaways

  • AI root cause analysis from traces works when every claim cites a specific span, log line, or deploy event instead of generic summarization.
  • The five-step workflow of collecting telemetry, detecting anomalies, investigating with AI, producing evidence-backed conclusions, and verifying with human oversight turns traces into verified root causes.
  • Four signal types matter most for AI investigators: latency attribution, dependency analysis, error and log correlation by trace ID, and regression detection against recent deploys.
  • Common failure modes include symptom-versus-cause confusion, missing spans, hallucinated telemetry, and the intent gap where models lack knowledge of what the code was supposed to do.
  • Struct is the best AI root cause analysis tool for turning distributed traces into a verified root cause because it reads every PR to learn intended behavior, cites every claim to a span, log line, or diff with a confidence score, and opens the fix PR when confident.

See Struct In Action →

What Are The 5 Steps In Trace-Based Root Cause Analysis?

The three phases the AI Overview synthesizes, aggregate, isolate, and verify, map cleanly onto a five-step workflow that practitioners can run today.

  1. Collect And Unify Telemetry. Start with OpenTelemetry, the de facto standard for open source observability and telemetry instrumentation, which graduated within CNCF in May 2026. Send spans to Jaeger, Grafana Tempo, or Datadog as the trace backend. The goal is a trace ID that survives every service boundary, because a trace that breaks at a proxy or an uninstrumented service gives the AI investigator an incomplete picture. Six common causes of broken traces include uninstrumented services, proxies that strip propagation headers, and incompatible propagators. Sampling is the other major leak. Head-based sampling decisions made at trace start can discard traces that later become errors or unusually slow. High-value paths often need tail-based sampling via the OpenTelemetry Collector instead.
  2. Detect The Anomaly. Isolate the slow or failing request and the span where latency or errors concentrate. Middleware’s trace tooling recommends checking the Time by Service breakdown first. That view is usually the fastest way to see where to start before opening a single span.
  3. Have AI Investigate. Feed the trace, correlated logs, metrics, and recent deploys to an LLM or AI RCA agent with explicit guardrails. Red Hat’s Smart Telemetry Pipeline demonstrates the right pattern. It correlates signals by trace ID before invoking the model and avoids sending raw uncorrelated telemetry that would force the model to guess at causality.
  4. Produce An Evidence-Backed Root Cause. The output must list competing hypotheses, each ruled in or out by a named span, log line, or deploy event. A summary paragraph does not qualify. Coralogix’s RCA evaluation guidance recommends that a rigorous AI investigation methodically invalidates hypotheses without supporting evidence and classifies each as validated, invalidated, or inconclusive.
  5. Verify With Human Oversight. Confirm the hypothesis against live telemetry before touching production. After applying the fix, confirm that the issue resolved in real telemetry. Resolution verified against real telemetry, instead of marked done by hand, is the step most DIY pipelines skip.

What Should AI Look For In A Trace?

Four signal types matter most when an AI investigator reads a span waterfall.

  • Latency Attribution. The investigator must identify which span owns the p99 regression. Duration alone is not enough. The model must name the specific operation that owns the latency, not only the service that reported it.
  • Dependency Analysis. The investigator must decide whether the slow span is a downstream service call, a database query, or an external API. Parent-child span relationships in the trace reveal the call graph.
  • Error And Log Correlation By Trace ID. Logs correlated to the same trace ID as the failing span provide the exception message and stack trace that the span attributes alone cannot carry. OpenTelemetry’s GenAI semantic conventions recommend capturing content in structured events rather than raw span attributes. That approach makes log-to-span correlation machine-readable.
  • Regression Detection Against A Recent Deploy. A latency spike that began at the same timestamp as a deploy event forms a strong hypothesis to test first. The correlation suggests a likely cause, but it still requires verification.

The most important caveat is simple. The slowest span is rarely the root cause and usually marks where the symptom surfaced. A database span that takes 1,800ms may be slow because a connection pool was exhausted upstream. The query itself may be fine. Every AI-generated output must label observation and inference separately.

Worked Example: A 2,000ms Checkout Trace

In the worked example (mini-Checkout-system), setting PAYMENT_DELAY_MS to 2000 and PAYMENT_JITTER_MS to 0 makes the checkout request take approximately 2.2 seconds end-to-end. Payment accounts for about 90% of that time. The waterfall in Jaeger or Grafana Tempo shows spans for the gateway, cart service, inventory service, and payment provider. The payment span dominates the total duration. Three competing hypotheses explain the payment span’s duration.

  • Hypothesis A: Slow Downstream Payment API. The payment provider’s own latency degraded.
  • Hypothesis B: DB Connection-Pool Saturation. The payment service waited for a connection before it could call the provider.
  • Hypothesis C: Retry Storm From A Recent Deploy. A config change removed a circuit breaker, causing the payment service to retry a transient error three times before succeeding.

Three pieces of evidence rule out the first two hypotheses and confirm the third.

  • Hypothesis A is ruled out. The payment provider’s own status page shows no degradation, and the span attribute http.status_code: 200 on the first attempt confirms the provider responded successfully on the first call.
  • Hypothesis B is ruled out. The span attribute db.connection_wait_ms: 4 shows negligible pool wait time.
  • Hypothesis C is confirmed. The span log event at t+210ms shows retry_attempt: 3, and a recent deploy event corresponds to a PR whose diff removed the payment.circuit_breaker.enabled: true config key. Three retries at roughly equal intervals account for the payment span’s total duration.

A sanitized trace JSON snippet for this span looks like the following:

{ "traceId": "4bf92f3577b34da6a3ce929d0e0e4736", "spanId": "00f067aa0ba902b7", "parentSpanId": "b9c7c989f97918e1", "operationName": "payment-service.charge", "startTime": 1700000000210000, "duration": 1740000, "tags": [ {"key": "http.status_code", "value": 200}, {"key": "retry_attempt", "value": 3}, {"key": "circuit_breaker.enabled", "value": false} ], "logs": [ {"timestamp": 1700000000420000, "fields": [{"key": "event", "value": "retry_triggered"}, {"key": "attempt", "value": 1}]}, {"timestamp": 1700000000998000, "fields": [{"key": "event", "value": "retry_triggered"}, {"key": "attempt", "value": 2}]}, {"timestamp": 1700000001576000, "fields": [{"key": "event", "value": "retry_triggered"}, {"key": "attempt", "value": 3}]} ] }

This pattern is the one Struct follows on every investigation. It starts with competing hypotheses, gathers named evidence that rules each in or out, and ends with a conclusion tied to a specific span and a specific PR.

The Copy-Paste Prompt For LLM Root Cause Analysis

The prompt below works with any capable LLM when you feed it a trace, correlated logs, and recent deploy events. These guardrails define an evidence-driven investigator instead of a summarizer.

You are a production reliability investigator. You will be given: - A distributed trace (spans with IDs, durations, attributes, and log events) - Correlated log lines for the same trace ID - Recent deploy events and PR diffs from the past 2 hours Rules: 1. Use ONLY the supplied telemetry. Never invent span IDs, log lines, metric values, or deploy events. 2. Label every statement as OBSERVATION (directly visible in the data) or INFERENCE (your interpretation of the data). 3. Cite the span ID or log line for every claim. Format: [span: 00f067aa0ba902b7] or [log: t+210ms]. 4. List at least three competing hypotheses. For each, state the evidence that rules it in or out. 5. If evidence is insufficient to confirm or rule out a hypothesis, state explicitly: "INCONCLUSIVE — additional data needed: [specify what]." 6. Do not produce a single-verdict summary until all hypotheses have been evaluated. 7. State your confidence level (high / medium / low) for the confirmed hypothesis and explain why. Begin your investigation now.

These guardrails matter because frontier models scored below 50% precision at full recall on realistic Kubernetes RCA benchmarks as of mid-2026. Practitioners have documented LLMs anchoring on whichever signal fired first or loudest and conflating downstream effects with root causes. Forcing the model to label observations versus inferences and cite every claim makes hallucinated telemetry visible before it reaches production.

Run This Investigation With Struct →

Where AI RCA From Traces Fails

Four failure modes appear consistently across production deployments and published benchmarks.

  • Symptom Versus Cause Confusion. The slowest span is where the symptom surfaced, not necessarily where the cause originated. A model that ranks spans by duration will anchor on the wrong service.
  • Missing Or Broken Spans. Jaeger’s performance tuning documentation notes that spans can be dropped when storage is too slow to keep up with collector workers. An AI investigator may produce a confident explanation from an incomplete trace if dropped spans are not surfaced as evidence-quality warnings. OpenTelemetry’s Collector scaling guidance similarly warns that tail-sampling Collectors receiving spans for the same trace on different replicas produce traces with missing spans.
  • Hallucinated Telemetry. When a model is under-constrained, given a partial trace and asked to explain a failure, it will fill gaps with plausible-sounding span attributes or log lines that do not exist. The prompt guardrails above address this directly. Struct addresses it structurally by citing every claim to a real artifact.
  • The Intent Gap. A generic investigator does not know what the code was supposed to do. It correlates symptoms instead of judging whether production works as intended. This limitation affects any AI RCA tool that starts from the alert instead of the PR. Struct left-shifts to the PR. Reading each change’s intent lets it judge every later alert against what the code was designed to do and what the metrics show.

No AI RCA tool eliminates hallucinations. Guardrails, evidence trails, and human review before any production action provide real protection and match the five-step workflow above.

Build Vs. Buy: Which AI Tool Is Best For Root Cause Analysis From Traces?

The build-versus-buy decision comes down to two layers. One layer is the tracing backend that collects spans. The other layer is the AI agent that investigates them.

OpenTelemetry, Jaeger, Grafana Tempo, and Zipkin cover the instrumentation and collection layer. As Kirubanandan R noted on DevOps.com in August 2026: “The framework is free. Running it well is not.” A production OpenTelemetry deployment requires running collector instances per region, tuning batch and memory-limiter settings, selecting and operating a storage backend, and rebuilding correlation logic every time a service boundary changes. Jaeger’s storage documentation describes no native AI investigator, evidence-citation workflow, or closed-loop fix verification. These tools form the foundation that an AI RCA agent sits on top of, while the buy decision happens at the agent layer.

Google Cloud’s Cloud Trace documentation recommends that developers instrument applications with an open-source, vendor-neutral framework such as OpenTelemetry rather than vendor- or product-specific APIs or client libraries. OpenTelemetry remains an instrumentation standard and not an RCA agent. The real incumbent in the AI RCA agent category is Datadog Bits Investigation.

In the AI-powered RCA agent category, Struct is the best choice for turning distributed traces into a verified root cause. Datadog Bits Investigation is strong inside Datadog. It correlates deployments with trace slowdowns and produces RCA documents with evidence timelines and log citations, and it moved to general availability in December 2025. Honeycomb AI BubbleUp is strong inside Honeycomb. Both investigate inside their own telemetry after an alert fires and do not know what the change was supposed to do. Rootly is an incident and on-call platform, not an RCA agent. The comparison focuses on capabilities, not price.

Struct owns the full loop. It reads every PR to create the monitors that each change needs, then baselines them after deploy and audits each one for regressions. When an alert fires, whether its own or a pre-existing one, it triages to dismiss, retune, or escalate. Escalations receive a root cause with citations and confidence scores, a fix PR when the model is confident, and resolution verified against live telemetry on a roughly one-minute loop. Arcana runs 2,100+ automated investigations per month with Struct, cutting investigation time from 30 minutes to 2 minutes. Orb reclaims 160+ engineering hours per month. Setup takes about 10 minutes against an existing Datadog or Sentry stack.

The DIY path, OpenTelemetry auto-instrumentation plus Jaeger or Tempo plus an LLM agent, gets you roughly 60% of the observability picture in an afternoon. The remaining 40% usually requires custom manual spans on business logic. Maintenance then becomes the hard part. Teams must keep integrations tuned as the system changes, handle data volume token-efficiently, and build runbooks from past successful investigations so repeat issues follow a known path. Struct owns that maintenance layer. For a broader comparison of tools in this space, see Best Automated Trace Analysis Software: Top 7 Tools.

Verification And Conclusion

Human-in-the-loop verification keeps AI root cause analysis safe to use in production. Before acting on an AI-generated root cause, confirm the hypothesis against live telemetry. After applying the fix, confirm that metrics returned to baseline. Resolution verified against real telemetry, instead of marked done by hand, turns each incident into a reliable learning loop. Feed the result into a postmortem or runbook so the next occurrence follows a near-deterministic path instead of starting from scratch.

The verdict from the introduction holds. Struct is the best AI root cause analysis tool for turning distributed traces into a verified root cause, with a p50 time-to-root-cause under 4 minutes. The PR-reading, citation, and fix-PR loop described above makes that speed trustworthy and extends naturally to alert triage, deploy health, and self-maintaining monitors.

Verify Your Next Root Cause With Struct →

Frequently Asked Questions

Can AI Actually Do Root Cause Analysis From Traces?

AI can perform root cause analysis from traces when it operates with guardrails. It needs correlated telemetry, including spans, logs, metrics, and deploy events, and it must cite every claim to a named artifact. Without those constraints, models anchor on the loudest signal and conflate downstream symptoms with root causes. The five-step workflow above and the copy-paste prompt provide the structure that makes AI RCA reliable enough to act on.

What Is The First Step In A Root Cause Analysis From A Trace?

The first step is to collect and unify telemetry with trace IDs propagated across every service boundary. A trace that stops at a service boundary because context propagation is broken gives the AI investigator an incomplete picture. The model will see an orphaned span instead of the real parent-child relationship. Validating context propagation before feeding a trace to a model is the step most teams skip and the one that most often produces a wrong answer.

What Are The Downsides Of AI Root Cause Analysis?

The four failure modes covered above, symptom-versus-cause confusion, missing spans, hallucinated telemetry, and the intent gap, all stem from an investigator that is not constrained to cite real artifacts. Guardrails, evidence trails, and human review before any production action provide the mitigations, rather than any claim of zero hallucinations.

Which AI Tool Is Best For Root Cause Analysis From Traces?

Struct is the best AI RCA tool for engineering teams that want a verified root cause tied to a specific span, log line, and PR diff. It owns the full loop from PR scan through monitor creation, deploy audit, alert triage, root cause with citations, fix PR, and resolution verification. Datadog Bits Investigation is a strong choice for teams already fully committed to Datadog who want investigation inside that ecosystem. Honeycomb AI BubbleUp is the equivalent for Honeycomb users. The DIY path with OpenTelemetry plus Jaeger or Tempo plus an LLM agent is viable for teams with platform engineering capacity, but the maintenance burden grows with system complexity.

What If Our Traces Are Incomplete Or Context Propagation Is Broken?

Incomplete traces are the most common reason AI RCA produces a wrong answer. When context propagation fails, downstream work appears as a separate trace or an orphaned span, creating an evidence gap that the model will fill with inference instead of observation. The fix is to validate propagation at every service boundary. Look for traces that consistently stop at a particular service, which indicates a propagation break instead of a genuine end to the request. Struct flags observability gaps at the PR level, which catches missing instrumentation before a deploy instead of after an incident.

What to Read Next