← 返回案例库
CUSTOMER STORY · 跨系统流程自动化

告警一来,AI 智能体自动排查 Kubernetes 并回帖诊断报告

Diagnose Kubernetes alerts with MCP servers

Tools · 使用工具n8n
Source · 来源原作者 · community.n8n.io
Zaowuyun · 可参考能力智能体工作台 + 技能库
01

谁在用

Who

一位搭建运维自动化的工程师。

02

遇到什么问题

Challenge

告警频繁,值班人员要手动查集群、监控和代码变更。

03

怎么用 AI 解决

Solution
  1. Alertmanager 的 webhook 触发 n8n 工作流,48 小时内去重,并从 Prometheus 规则 API 获取触发的 PromQL。
  2. AI 智能体通过 Kubernetes、Grafana、DigitalOcean 和 GitHub 的 MCP 服务器及内部文档库只读调查。
  3. 在 Mattermost 原告警帖下回复诊断报告。
04

结果如何

Results据原作者自述
  • 报告包含摘要、事件时间线、最多两个根因假设和排查步骤
  • 没有效果数据;建议每次失败调用只重试一次以免循环

以上内容均由原作者自行报告,未经独立核实,也不代表造物云产品的效果。

05

提示词

Prompt

参考提示词(由 agentusecases.ai 整理为模板,非原帖原文)

中文

搭一个 n8n 工作流:接收 Alertmanager webhook,启动连接【Kubernetes、Grafana 等】MCP 服务器的 AI 智能体,只读调查告警,再把带证据和根因假设排序的诊断报告回复到告警帖下。

ENGLISH

Build an n8n workflow that receives Alertmanager webhooks and starts an AI agent connected to my MCP servers for [Kubernetes, Grafana, other tools]. The agent should investigate the alert read-only, then post a diagnostic report with evidence and ranked root-cause hypotheses as a thread reply in [Mattermost channel]. You're done when a sample alert produces a report; it must not change anything in the cluster, and show me the report before the first post.