Automatic Root Cause Analysis via Large Language Models for Cloud Incidents

Yinfang Chen, Huaibing Xie, Minghua Ma, Yu Kang, Xin Gao, Liu Shi, Yunjie Cao, Xuedong Gao, Hao Fan, Ming Wen, Jun Zeng, Supriyo Ghosh, Xuchao Zhang, Chaoyun Zhang, Qingwei Lin, Saravan Rajmohan, Dongmei Zhang, Tianyin Xu · DOI

TL;DR

This paper introduces RCACOPILOT, a novel system that leverages Large Language Models (LLMs) to automate root cause analysis (RCA) for cloud incidents. By intelligently collecting diagnostic data and using LLMs to predict and explain the root cause, RCACOPILOT significantly improves the efficiency and accuracy of incident resolution, outperforming traditional methods.

What Problem Does This Paper Address?

Cloud services are complex and prone to incidents that can disrupt operations. Identifying the root cause of these incidents (Root Cause Analysis or RCA) is crucial for restoring service and preventing recurrence. However, traditional RCA methods are often manual, time-consuming, error-prone, and require significant human expertise. This is exacerbated by the sheer volume and complexity of data generated by cloud systems, leading to an "information spectrum" where engineers can be either overwhelmed or lack sufficient data. Existing automated solutions often struggle with the dynamic nature of cloud environments and the need for deep domain knowledge.

Methods

RCACOPILOT employs a two-stage approach:

  1. Diagnostic Information Collection Stage: This stage uses "incident handlers" that are essentially automated workflows tailored to specific alert types. These handlers, built by experienced on-call engineers (OCEs), systematically collect relevant diagnostic data from various sources (logs, metrics, traces). This stage is designed to intelligently gather the right information, avoiding information overload. Key actions within handlers include:
  2. Scope Switching: Adjusting the data collection scope (e.g., from a forest to a specific machine) for more targeted investigation.
  3. Query Action: Fetching data from different sources or executing scripts to gather specific information.
  4. Mitigation Action: Suggesting steps to alleviate the incident.
  5. Root Cause Prediction Stage: This stage leverages LLMs to process the collected diagnostic data.
  6. Summarization: The raw diagnostic data, which can be extensive, is first summarized by an LLM to create a concise and informative input.
  7. Embedding and Nearest Neighbor Search: Incidents are represented as vectors in an embedding space. A custom similarity formula is used to find the most relevant past incidents, considering both semantic and temporal proximity.
  8. Chain-of-Thought (CoT) Prompting: The summarized diagnostic information, along with examples of similar past incidents (demonstrations), is fed into an LLM. The LLM is prompted to predict the root cause category and provide an explanation using a CoT approach, guiding it through a reasoning process.

Datasets

The study uses a one-year dataset of 653 incidents from Microsoft's global email service system, "Transport." This dataset was manually labeled with root cause categories by experienced OCEs and was split into training (75%) and testing (25%) sets.

Key Insights and Ideas

  • The "Information Spectrum" is Real: Cloud incident analysis suffers from either too much data or too little. RCACOPILOT's handler-based data collection aims to navigate this spectrum effectively.
  • LLMs Need Context, But Not Just Any Context: While LLMs are powerful, they lack intrinsic domain-specific knowledge. RCACOPILOT bridges this gap by using domain-expert-built handlers to gather relevant data and then using this data to guide the LLM's reasoning.
  • Summarization is Key for LLM Efficiency: Raw diagnostic logs can be too verbose for LLMs. Summarizing this information significantly improves the LLM's ability to process and reason effectively.
  • Temporal Proximity Matters for RCA: Past incidents are more relevant to current ones if they occurred recently. The similarity metric explicitly incorporates temporal distance.
  • New Root Causes are a Major Challenge: A significant portion of incidents stem from new, previously unseen root causes. RCACOPILOT's ability to generate new category labels and explanations for these is crucial.

Key Results

  • RCACOPILOT achieved a Micro-F1 score of 0.766 and a Macro-F1 score of 0.533 on the test dataset, outperforming baseline methods like XGBoost, FastText, and fine-tuned LLMs.
  • The diagnostic information collection module has been in use at Microsoft for over four years across 30 teams, demonstrating its practical applicability and robustness.
  • The system can generate new root cause category labels and explanations for unseen incidents, with an example showing a prediction of "I/O Bottleneck" for an incident later categorized as "DiskFull."
  • The average inference time for RCACOPILOT is around 4.205 seconds, which is considered efficient.
  • Experiments showed that using summarized diagnostic information improved Micro-F1 by 0.077 and Macro-F1 by 0.023 compared to using raw diagnostic information.

Limitations and Future Work

  • Monitor Dependency: RCACOPILOT's effectiveness relies on monitors detecting incidents. If monitors fail or there's no corresponding handler for an alert type, the system's applicability is limited.
  • LLM Instability: While experiments were conducted in multiple rounds to ensure trustworthiness, the inherent instability of LLMs can still lead to variations.
  • Handler Creation Effort: While handlers can be reused and modified, creating new ones for unique alert types still requires manual effort from OCEs.
  • Future Work: The authors suggest evaluating RCACOPILOT across different services to assess its generalizability and exploring other LLMs beyond OpenAI's GPT models. They also plan to further investigate the impact of different prompt designs and embedding models.

Summary updated

BibTeX
@inproceedings{chen2024automatic,
  author = {Yinfang Chen and Huaibing Xie and Minghua Ma and Yu Kang and Xin Gao and Liu Shi and Yunjie Cao and Xuedong Gao and Hao Fan and Ming Wen and Jun Zeng and Supriyo Ghosh and Xuchao Zhang and Chaoyun Zhang and Qingwei Lin and Saravan Rajmohan and Dongmei Zhang and Tianyin Xu},
  title = {{Automatic Root Cause Analysis via Large Language Models for Cloud Incidents}},
  booktitle = {EuroSys},
  year = {2024},
  doi = {10.1145/3627703.3629553},
}
Figure