# AI Root Cause Analysis: Architecture, Testing, and Evaluation

DevFeed: [AI Root Cause Analysis: Architecture, Testing, and Evaluation](<https://devfeed.tech/articles/ai-root-cause-analysis-architecture-testing-and-evaluation-109738.md>)

Original publisher: [Read original article](<https://quarkus.io/blog/ai-root-cause-analysis-deep-dive/>)

Author: Ales Justin

Published: 2026-10-23T00:00:00Z

Content type: article

Language: en

Sources: [Quarkus - Supersonic Subatomic Java](<https://devfeed.tech/sources/quarkus-supersonic-subatomic-java.md>)

Topics: [ai observability](<https://devfeed.tech/topics/ai-observability.md>), [telemetry](<https://devfeed.tech/topics/telemetry.md>), [OpenTelemetry](<https://devfeed.tech/topics/opentelemetry.md>), [AI Architecture](<https://devfeed.tech/topics/ai-architecture.md>), [Prometheus](<https://devfeed.tech/topics/prometheus.md>), [Grafana](<https://devfeed.tech/topics/grafana.md>), [langchain4j](<https://devfeed.tech/topics/langchain4j.md>), [AI Integration Strategies](<https://devfeed.tech/topics/ai-integration-strategies.md>), [Tool](<https://devfeed.tech/topics/tool.md>), [Data visualization](<https://devfeed.tech/topics/data-visualization.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [chaos](<https://devfeed.tech/tags/chaos.md>), [chaos-engineering](<https://devfeed.tech/tags/chaos-engineering.md>), [evaluation](<https://devfeed.tech/tags/evaluation.md>), [langchain4j](<https://devfeed.tech/tags/langchain4j.md>), [lgtm](<https://devfeed.tech/tags/lgtm.md>), [llm](<https://devfeed.tech/tags/llm.md>), [llm-as-judge](<https://devfeed.tech/tags/llm-as-judge.md>), [logs](<https://devfeed.tech/tags/logs.md>), [mcp](<https://devfeed.tech/tags/mcp.md>), [metrics](<https://devfeed.tech/tags/metrics.md>), [no-code](<https://devfeed.tech/tags/no-code.md>), [observability](<https://devfeed.tech/tags/observability.md>), [opentelemetry](<https://devfeed.tech/tags/opentelemetry.md>), [pipeline](<https://devfeed.tech/tags/pipeline.md>), [prometheus](<https://devfeed.tech/tags/prometheus.md>), [quarkus](<https://devfeed.tech/tags/quarkus.md>), [root-cause-analysis](<https://devfeed.tech/tags/root-cause-analysis.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

AI Root Cause Analysis correlates traces, logs, and point-in-time Prometheus metrics through an LLM that autonomously selects telemetry tools and builds a structured report. OpenTelemetry-instrumented applications connect through an LGTM stack via MCP; optional Quarkus Dev MCP supports source examination and dashboard generation. A filtering layer strips SDK noise, redundant fields, and low-signal metrics (586 entries to about 35) to limit context use. Chaos tests inject application and network failures, including database and weather API faults via Toxiproxy, then score reports with a separate judge LLM on four dimensions (25 points each); the default passing threshold is 70/100 and can be overridden. Analyzer and scorer can use different providers to reduce self-evaluation bias. The excerpt reports 19 scenarios passing across provider combinations.

## Source excerpt

In the introductory post, we showed what AI Root Cause Analysis does and how to get started. This post goes deeper -- into the architecture, the analysis pipeline, how we keep telemetry data within LLM context limits, and how we test analysis quality using chaos engineering with LLM-as-judge evaluation. Architecture The system has a layered architecture connecting monitored applications to the AI analysis engine through an observability stack: Your applications just need OpenTelemetry instrumentation -- no code changes required. The AI module connects to your existing LGTM stack via MCP and optionally to your running Quarkus applications via Quarkus Dev MCP for source examination and dashboard generation. The AI module uses LangChain4j @RegisterAiService interfaces backed by a ~290-line system prompt that instructs the LLM on three-way telemetry correlation, chaos detection patterns, severity classification, and structured output formatting. Five tools are exposed to the LLM during analysis: Tool What It Provides provideLastNTraceIds Recent trace IDs from Tempo (TraceQL) traceById Full trace data for a specific trace logsWithTraceId Correlated Loki logs for a trace getRootSpanStartTime Timestamp for metric queries getAllMetricsForDatetime Prometheus metrics at a point in time The LLM orchestrates these tools autonomously -- it decides which traces look interesting, pulls their logs, checks metrics, and builds the analysis iteratively. The Analysis Pipeline When you hit GET /analyze/{n}, the following sequence unfolds: Tool dispatch -- The AI module sends the system prompt and tool definitions to the LLM Trace retrieval -- The LLM calls provideLastNTraceIds to get the N most recent traces Per-trace investigation -- For each trace, the LLM pulls full trace data and correlated logs through StripMcpClient, which strips SDK noise, localhost attributes, and redundant fields Metrics context -- The LLM queries Prometheus metrics at the root span's start time; the filtering layer r