TL;DR
This paper introduces HADES, a novel approach for detecting anomalies in software systems by integrating log and metric data using an attentive multi-modal learning framework. HADES significantly outperforms existing single-modal and multi-modal methods by effectively capturing the complementary nature of these data sources, leading to more accurate and robust anomaly detection.
What Problem Does This Paper Address?
Ensuring the reliability of complex software systems is paramount, and detecting anomalies is a critical step. Traditionally, anomaly detection systems rely on a single type of monitoring data, such as system metrics (e.g., CPU usage, response time) or logs (textual records of system events). However, the authors argue that this single-source approach is insufficient because anomalies can manifest differently across various data types. For instance, a system failure might trigger specific error logs but have subtle effects on metrics, or vice-versa. Existing methods often fail to effectively combine information from multiple sources, leading to a significant number of false positives and negatives. This paper aims to bridge this gap by developing a method that can holistically analyze heterogeneous data (logs and metrics) to achieve more accurate and comprehensive anomaly detection.
Methods
The core of HADES is its hierarchical, multi-modal architecture designed to learn a unified representation of system status from both logs and metrics.
- Log Modeling:
- Parsing: Raw log messages are first processed using the Drain algorithm to extract structured log events, removing variable information.
- Vectorization: Log events are then converted into numerical vectors using FastText to capture lexical semantics.
- Representation Learning: A Transformer encoder is employed to learn contextual semantics from sequences of log events, creating a log representation.
- Metric Modeling:
- Intra-Aspect Encoder: Metrics are grouped by their aspects (e.g., CPU, I/O, memory) and processed by causal convolutional networks to capture aspect-specific temporal dependencies.
- Inter-Aspect Encoder: Another causal convolutional network then models the correlations between different metric aspects, learning a more holistic metric representation.
- Heterogeneous Representation Fusion: This is the key novel component. A cross-modal attention mechanism is used to fuse the log and metric representations. This mechanism allows the model to:
- Match log events to metric changes (log as Query, metrics as Key/Value).
-
Match metric variations to log content (metrics as Query, logs as Key/Value). This fusion process creates a global representation that captures both intra-modal (within logs or metrics) and inter-modal (between logs and metrics) interactions.
-
Detection: The fused global representation is fed into a simple classifier (fully-connected layers with softmax) to predict whether the system chunk is normal or abnormal.
Datasets
The authors introduce a new benchmark dataset for anomaly detection research.
- Dataset A (Simulated): Generated by injecting 21 types of faults into Apache Spark workloads. This dataset contains 1,435,139 log messages and 11 monitoring metrics, with temporally aligned data and annotations.
- Dataset B & C (Industrial): Two datasets from Huawei's production cloud systems, containing logs and metrics from real-world services. These datasets were also augmented with injected faults and annotated by experienced engineers.
All datasets were split into training, validation, and testing sets in a 7:1:2 ratio.
Key Insights and Ideas
- Anomalies are Multi-faceted: System anomalies don't always manifest uniformly. They can appear distinctly in logs, metrics, or both, highlighting the need for multi-modal analysis.
- Logs Aren't Always Enough: While critical logs can signal problems, their absence doesn't guarantee a healthy system. Subtle issues or "gray failures" are often missed by log-based methods due to the inherent subjectivity in log writing.
- Metrics Can Be Noisy: Metrics are more responsive but can also produce false alarms due to normal fluctuations. Relying solely on metrics can lead to over-sensitivity.
- Complementary Information: Logs and metrics offer complementary views of system health. Logs capture internal execution logic, while metrics reflect external performance. Combining them provides a more complete picture.
- Inter-Modal Gap is a Challenge: The difference in format (text vs. time-series) and semantics between logs and metrics creates a significant challenge for effective fusion. The cross-modal attention mechanism in HADES is designed to bridge this gap.
- Aspect-Aware Metric Modeling: Different types of metrics (e.g., CPU vs. I/O) behave differently. Modeling them separately within an "intra-aspect encoder" before combining them in an "inter-aspect encoder" improves representation learning.
Key Results
HADES demonstrated superior performance across all datasets and evaluation metrics.
- Overall Performance: HADES achieved an average F1-score of 0.93 across all datasets, significantly outperforming both single-modal (log-based and metric-based) and existing multi-modal baselines. For example, on Dataset B, HADES achieved an F1-score of 0.9790, compared to the best single-modal baseline (Adsketch) at 0.9254.
- Ablation Studies:
- HADES significantly outperformed its single-modal counterparts (log-HADES and metric-HADES), confirming the benefit of heterogeneous data.
- The attentive fusion mechanism was crucial, outperforming simpler concatenation methods.
- The aspect-aware metric modeling was also important, with an "agnostic" version performing worse.
- Sensitivity Analysis: HADES showed good robustness to variations in chunk length (T), making it practical for deployment.
Limitations and Future Work
- Log Event Embeddings: The paper acknowledges that using average token embeddings for log events ignores intra-event sequential information. While this was a trade-off for efficiency, future work could explore more sophisticated methods for capturing this.
- Dataset Representativeness: While the authors used simulated and industrial datasets with diverse workloads and faults, they note that generalizing to a wider variety of datasets remains an open question.
- Annotation Noise: Manual annotation, even by experts, can introduce noise. The authors mitigated this by using experienced annotators and a consensus mechanism.
- Future Work: The authors suggest extending HADES to handle scenarios where data sources might be intermittently unavailable or have different sampling frequencies, making it more adaptable to real-world streaming environments. They also plan to evaluate HADES on a broader range of datasets.
Summary updated