Building an AI-Powered AIOps System for Observability Data

    This article explains how to build an intelligent AIOps system on top of observability data, moving beyond manual dashboards and keyword searches that break down at scale. It covers a unified data ingestion layer that aligns metrics, logs, and traces through shared entity identifiers and time standards; a role-based multi-agent analysis layer that coordinates planning, metrics, log, topology, decision, and output agents through a shared evidence board and explicit state machine; and an interaction layer that keeps humans in the loop via chat-based cards and feedback. It also outlines a practical rollout path and engineering priorities for achieving minute-level, explainable, and auditable incident diagnosis.

    1. Why Traditional Ops Fails at Scale

    A single user request can span dozens of backend services—gateway, authentication, orders, inventory, payment, notifications—and once you add caches, message queues, databases, and third-party dependencies, call depth easily exceeds a dozen layers. This produces three data floods: high-frequency time-series metrics, unstructured logs, and call-chain spans with parent-child relationships. The traditional “watch the dashboards + search for keywords” model breaks down quickly at this scale, with four main bottlenecks:

    1. Data silos: Metrics, logs, and traces live in separate storage and query systems with inconsistent time references and entity identifiers, making cross-validation difficult.
    2. Low signal-to-noise ratio: During an alert storm, a single root cause may be accompanied by hundreds of derived alerts, and it is hard for humans to determine causality.
    3. Non-reusable knowledge: Fault-handling experience is scattered across individuals and historical tickets and cannot be distilled into executable analysis steps.
    4. Compressed response window: Service-level objectives for core paths often require minute-level localization, which serial manual investigation cannot meet.

    The goal of intelligent ops is not to replace people, but to automate the chain of “data acquisition → hypothesis generation → evidence validation → conclusion output” and place human judgment at the key decision points.

    2. Data Ingestion Layer: A Unified Observability Foundation

    Multi-agent analysis depends on data being available, comparable, and correlatable. The ingestion layer must solve three problems: collect everything, align it, and query it fast.

    2.1 Three Core Data Sources

    • Metrics: Cover infrastructure metrics (CPU, memory, disk IO, network throughput), application metrics (QPS, response latency percentiles, error rate, thread pool and connection pool saturation), and business metrics (order volume, payment success rate, fulfillment time). Metrics are low-cost and densely sampled, making them suitable for anomaly detection and trend analysis.
    • Logs: Include application logs, system logs, and middleware logs, with focus on ERROR/WARN entries and their context stacks. Logs provide the semantic clues for “why.”
    • Traces: Record a request’s full path across microservices, per-hop latency, and status codes. Traces directly expose bottleneck nodes and the direction of fault propagation.

    2.2 The Key to Unified Modeling: Entity and Time Alignment

    Whether the three data types can be linked depends on sharing the same identification system. Engineering practice should at least unify the following dimensions:

    1. Unified entity identifiers: service / instance / pod / host / api
    2. Unified time baseline: UTC + millisecond precision, full-chain clock synchronization
    3. Unified correlation keys: trace_id, span_id, request_id, tenant_id
    4. Unified tag conventions: env, region, cluster, version, team

    Only when trace_id can jump from a trace to logs, and from an anomaly timestamp to a metrics interval, can agents cross-validate “the same fact across multiple sources” instead of producing mutually contradictory conclusions.

    2.3 Ingestion Strategy

    • Real-time and near-real-time tiering: Metrics flow through second- to minute-level streaming channels; logs are buffered near-real-time then batch-loaded into the data lake; traces are reported by sampling rate, with higher sampling priority for anomalous requests.
    • Cost control: Converge high-cardinality tags, apply tiered log retention (hot, warm, cold), and use tail-based sampling for traces to retain anomalous samples.
    • Quality validation: Build field completeness, time drift, and duplicate-reporting checks into the ingestion side to avoid “dirty data driving wrong conclusions.”

    3. Analysis Layer: Role-Based Multi-Agent Collaboration

    Internally, the system is not a one-shot inference from a single model, but more like an ops team with clear division of labor. Each agent is assigned a fixed role, available tools, and an output contract, and they collaborate through a shared “evidence board” to progressively approach the root cause.

    3.1 Role Division and Responsibility Boundaries

    • Task Planning Agent (Ops Expert): Receives alert events, breaks them into executable analysis plans, defines hypotheses, priorities, and required evidence, and dispatches specific query tasks to the corresponding agents. It decides “what to check first, and what next.”
    • Metrics Analysis Agent: Performs anomaly detection, period-over-period comparison, and inter-metric correlation on time-series data, outputting anomaly intervals and suspicious metric combinations.
    • Log Analysis Agent: Uses NLP to cluster logs, extract error patterns, merge stacks, and locate key events, compressing millions of log lines into a few pattern clusters.
    • Topology-Aware Agent: Understands service dependencies and call relationships, and combined with trace data judges whether a fault is back-propagating from downstream to upstream or triggered by a common dependency, producing a propagation-path hypothesis.
    • Analysis Decision Agent (Shift Lead): Does not acquire new data or change system state; only performs structured, explicit reasoning over existing query results, adding a thought log. When evidence is missing, conflicting, or when recent steps show no progress, it decides whether to change direction, gather more evidence, or terminate.
    • Final Output Agent (Operations Expert): Summarizes the alert event and produces structured output: impact scope, root-cause judgment, confidence, remediation suggestions, and items to confirm.

    3.2 Collaboration Mechanism: Shared Evidence Board + Explicit State Machine

    The most common failure mode for multi-agent systems is agents “not knowing what the others did.” It is recommended to introduce a shared evidence board and an explicit state machine:

    1. {
    2. "incident_id": "INC-20251202-001",
    3. "phase": "evidence_gathering",
    4. "hypotheses": [
    5. {"id": "H1", "desc": "Downstream dependency latency causing upstream timeouts", "confidence": 0.62}
    6. ],
    7. "evidence": [
    8. {"source": "metrics", "ref": "api_p99@10:02-10:09", "conclusion": "Latency spiked to 8x baseline"},
    9. {"source": "traces", "ref": "trace_id=xxx", "conclusion": "Latency concentrated in inventory service"}
    10. ],
    11. "pending": ["Missing inventory service error logs"],
    12. "thought_log": ["H1 supported by two pieces of evidence, logs needed to confirm"]
    13. }

    The state machine should keep only a few clear states: plan → evidence_gathering → decision → summarize → closed, with budget constraints (max rounds, max queries, max elapsed time) to prevent infinite loops.

    3.3 Anti-Hallucination and Evidence Constraints

    • All conclusions must be bound to evidence references; without evidence, they can only be stated as “hypotheses to be verified.”
    • Tool call parameters are validated by schema; agents are forbidden from fabricating metric names or log query statements.
    • Conflicting evidence is not averaged; the decision agent lists the points of disagreement and triggers additional evidence gathering.

    4. Interaction and Feedback Layer: Keeping Humans in the Loop

    Analysis conclusions must be delivered through the entry point where ops staff currently work, or their value drops to zero. A practical approach is to push via a bot in enterprise collaboration tools, using card messages, Markdown text, or interactive buttons:

    • Card messages: Show event summary, impact scope, root-cause hypothesis, and confidence.
    • Interactive buttons: Provide actions such as “confirm root cause,” “add evidence,” “escalate to human,” and “mark as false positive,” feeding human feedback back as samples for training and rule optimization.
    • Collapsible thought log: The reasoning process is collapsed by default and expanded on demand, balancing efficiency and auditability.

    The value of the feedback loop is that every human confirmation or rejection is converted into reusable handling playbooks and priority weights, shortening the analysis path for the next similar event.

    5. Rollout Path and Engineering Priorities

    1. Fix the data first, then add intelligence: Unifying identifiers and tag conventions is the highest-ROI step.
    2. Start with high-frequency scenarios: Prioritize patterns with clear signatures such as “latency spikes,” “rising error rates,” and “dependency jitter.”
    3. Clear human-machine boundaries: Agents handle evidence gathering and hypothesis ranking; change operations remain subject to human approval.
    4. Observe the agents themselves: Record each round’s tool calls, elapsed time, and token consumption for cost governance and effectiveness evaluation.
    5. Measure, don’t guess: Continuously iterate using average localization time, root-cause hit rate, false-positive rate, and human-takeover rate as core metrics.

    Building the above system on top of general cloud product capabilities such as Baidu AI Cloud’s observability and container platforms, log service, and monitoring and alerting can reuse existing collection, storage, and alerting channels, concentrating engineering effort on agent orchestration and evidence governance—thereby obtaining minute-level, explainable, and auditable intelligent ops capabilities at lower cost.