LLM-Based Fault Diagnosis and Root Cause Analysis in Practice
As microservices, containers, and elastic scheduling become standard, a single request can span many services, middleware components, and infrastructure layers. This article explains how LLM-based diagnosis turns metrics, logs, and traces into an auditable, multi-agent workflow that shortens detection and repair—covering data alignment, agent roles, human review, evaluation, and governance.
As microservices, containers, and elastic scheduling have become the norm, a single business request often crosses multiple service tiers, several kinds of middleware, and more than one infrastructure stack. Dependencies that once fit on a single diagram have turned into a topology that changes over time, while metrics, logs, and traces have grown in volume together. When alert storms, noisy logs, and partial views appear at once, manual log diving or a single rule engine rarely converges on the true root cause quickly. Intelligent fault diagnosis has therefore moved from an optional capability to a core part of reliability engineering. The goal is not another dashboard. It is to compress “detect the problem, explain it, and produce an actionable conclusion” into a measurable time window, and to reduce mean time to detect and mean time to repair.
From an engineering standpoint, systems of this kind usually provide three layers of capability: broad ingestion of operational data, collaborative multi-agent analysis, and interaction and feedback for the people on call. The data layer needs to cover three complementary signals: metrics, logs, and traces. Metrics describe how resource saturation, throughput, latency, and error rate change over time. Logs preserve error patterns, exception stacks, and key business events. Traces make the path of a request across services explicit, including duration and the point of failure. Ingestion can be a real-time stream or a near-real-time pull. Sources can include monitoring alerts, log services, distributed tracing, and cloud monitoring capabilities. What matters is not locking the system to one collection stack, but aligning time, service identity, and topology. Within the same incident window, the three data types must be joinable by service name, instance, interface, and request identifier. Otherwise later agents can only inspect their own slice of the problem in isolation.
The value of multi-agent collaboration is role specialization that resembles an expert team, not stuffing every piece of context into one very long prompt. A task-planning agent acts as the on-call specialist: given the alert type, blast radius, and known topology, it produces executable investigation steps and assigns subtasks to downstream agents. A typical sequence is to check whether golden signals have degraded together, then drill down along the trace, and finally use logs to confirm error codes and stacks. A metrics-analysis agent focuses on time series: it looks for sudden changes, trends, periodicity, and correlation, and judges whether the issue looks like capacity, a flapping dependency, or abnormal business traffic. A log-analysis agent focuses on natural language and pattern extraction: from large volumes of text it pulls error clusters, first-seen time, key fields, and surrounding context. A topology-aware agent maintains service dependencies and failure-propagation paths so that a downstream symptom is not mistaken for an upstream root cause. An analysis-and-decision agent acts as the incident lead: it does not casually fetch new data or change system state. It reasons over the evidence already collected, marks where that evidence is sufficient, conflicting, or missing, and decides whether to dig deeper or issue an interim conclusion. A final-output agent turns the process into something an on-call engineer can use: scope of impact, suspected root cause, evidence chain, recommended actions, and confidence.
The collaboration must be auditable. Each step should record the query intent, the data slice used, intermediate judgments, and open questions, forming a reasoning log. When evidence conflicts—for example, metrics show rising latency but the trace failure point is not in the same service—when progress stalls because two consecutive rounds add no new information, or when a critical field is missing, the decision agent should escalate explicitly. It may narrow the time window, switch the correlation dimension, or ask a human to supply business context. That avoids the hallucination that comes from letting a model generate an entire conclusion in one pass, and it lets a human expert join midway instead of accepting only a black-box result.
In production, the model’s boundary also has to be constrained. Large language models are strong at summarizing and explaining, but they do not replace the accuracy of the monitoring system or the soundness of the alerting policy. Metric anomaly detection should still rest on baselines, seasonality, and the business calendar. Log parsing should control noise and sensitive data. When trace sampling is too low, the uncertainty of the conclusion must be stated. Output should be structured: a problem summary, a timeline, affected services, a ranked list of candidate root causes, the evidence for each, recommended actions at the level of investigation commands—such as scaling out, rate limiting, rollback, or isolating an instance—and assumptions that still need human confirmation. Delivery should use the collaboration channel the team already uses day to day, presented as cards, Markdown, or clickable follow-up actions. On-call engineers can then ask, in the same conversation, which release an error code corresponds to, or whether it appeared at the same time as a dependency timeout. Analysis becomes a conversational workflow rather than a static report.
Evaluation should cover both reliability outcomes and process quality. On the reliability side, track detection delay, localization delay, false-positive rate, and how well duplicate alerts are collapsed. On the process side, track evidence coverage, human acceptance rate, explainability of conclusions, and the success rate of locating the cause in one pass. Historical incident replay is a practical offline test: given the metrics, logs, and trace slices from that time, see whether the multi-agent system can approach the known root cause within a limited number of steps, and count skipped steps, missed detections, and over-attribution. Online, use a gradual rollout: enable automatic delivery first for non-critical services or off-peak windows, and widen the scope only after human confirmation. Feedback must flow back. Engineers should mark a result correct, partially correct, or wrong, and add the real root-cause label. That feedback should improve planning strategy, retrieval scope, and prompt structure, not merely the wording of the report.
Security and governance cannot be left out. Operational data often contains accounts, orders, and internal addresses. Ingestion and prompt assembly need redaction, role-based authorization, and an audit of every query. Agents should not hold change permissions that have not been approved. Recommended actions in a conclusion must stay separate from automatic execution. Model versions, the knowledge base—architecture notes, change records, and common failure runbooks—and prompt templates should be under change management so that one prompt edit does not silently shift how localization is done.
In short, LLM-based fault diagnosis and root cause analysis is about organizing scattered observability data into an operations workflow that can be divided, debated, and delivered. Aligned data supplies the facts, multiple agents supply the structure of reasoning, and human interaction supplies the final judgment. When those three close the loop, failures in complex systems no longer depend only on the memory of a few experts. Detection and repair paths can be shortened in a repeatable way. That is the practical value of this approach.
