Monitoring Alerting logo

Monitoring Alerting

Community
zhaoxuya520
monitoring-alerting

配置监控和告警时使用。适用于 Prometheus / Grafana / Loki / PagerDuty / SLO 定义 / 告警规则设计。融合 Google SRE 四大黄金信号 + USE Method + 告警分级。

Add to TypingMind

Overview

Publisherzhaoxuya520
RepositoryAI-Fullstack-Delivery-Workflow
Skill namemonitoring-alerting
Stars
56
Forks
18
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by zhaoxuya520 on GitHub. Read the source before you install it.

Installation

Install the Monitoring Alerting AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/zhaoxuya520/AI-Fullstack-Delivery-Workflow/tree/master/workflows/devops-engineer/skills/monitoring-alerting
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zhaoxuya520/AI-Fullstack-Delivery-Workflow.git /tmp/AI-Fullstack-Delivery-Workflow
mkdir -p .claude/skills
cp -r /tmp/AI-Fullstack-Delivery-Workflow/workflows/devops-engineer/skills/monitoring-alerting .claude/skills/monitoring-alerting
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Monitoring Alerting in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Monitoring Alerting on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Monitoring Alerting is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

监控与告警(Monitoring & Alerting)

参考来源:Google《Site Reliability Engineering》、Brendan Gregg USE Method、Prometheus 官方、Grafana Labs、PagerDuty Incident Response。

适用场景

  • 监控系统搭建(Prometheus + Grafana)
  • 日志收集(Loki / ELK)
  • 告警规则设计
  • SLO / SLI 定义
  • 仪表盘设计
  • On-call 配置

核心原则

text
1. 四大黄金信号(Google SRE)
   Latency / Traffic / Errors / Saturation

2. USE Method(Brendan Gregg)
   每种资源:Utilization / Saturation / Errors

3. 告警基于 SLO,不基于阈值
   "错误预算消耗 > 50%" 比 "CPU > 80%" 有意义

4. 告警可操作
   收到告警 → 知道做什么
   不可操作的告警 = 噪音

5. 分级告警
   P1(立即)/ P2(1 小时)/ P3(工作时间)/ P4(下周)

6. 不 alert fatigue
   宁可少告警,不可多到忽略

监控栈选型

组件开源SaaS
指标Prometheus + GrafanaDatadog / New Relic
日志Loki / ELKDatadog Logs / Splunk
追踪Jaeger / TempoDatadog APM / Honeycomb
告警AlertmanagerPagerDuty / OpsGenie
UptimeBlackbox ExporterUptimeRobot / Better Stack
错误Sentry(自建)Sentry Cloud
APMOpenTelemetryDatadog / Dynatrace

四大黄金信号

yaml
# Prometheus 规则示例

# 1. Latency(延迟)
- record: http_request_duration_seconds:p99
  expr: histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m]))

# 2. Traffic(流量)
- record: http_requests_per_second
  expr: rate(http_requests_total[5m])

# 3. Errors(错误率)
- record: http_error_rate
  expr: rate(http_requests_total{status=~"5.."}[5m]) / rate(http_requests_total[5m])

# 4. Saturation(饱和度)
- record: cpu_saturation
  expr: 1 - avg(rate(node_cpu_seconds_total{mode="idle"}[5m]))

SLO / SLI 定义

text
SLI(Service Level Indicator):
  - 可用性:成功请求 / 总请求
  - 延迟:P99 < 500ms 的请求比例
  - 吞吐:每秒处理请求数

SLO(Service Level Objective):
  - 可用性 SLO:99.9%(每月允许 43 分钟不可用)
  - 延迟 SLO:99% 请求 P99 < 500ms
  - 错误 SLO:错误率 < 0.1%

错误预算(Error Budget):
  - 月预算 = 1 - SLO = 0.1% = 43 分钟
  - 消耗 > 50% → 冻结发布
  - 消耗 > 80% → 专注稳定性
yaml
# Prometheus SLO 告警(Burn Rate)
groups:
  - name: slo-alerts
    rules:
      # 1 小时 burn rate > 14.4(快速消耗)→ P1
      - alert: HighErrorBudgetBurn_1h
        expr: |
          (
            rate(http_requests_total{status=~"5.."}[1h])
            / rate(http_requests_total[1h])
          ) > 14.4 * 0.001
        for: 2m
        labels:
          severity: critical
        annotations:
          summary: "Error budget burning fast (1h window)"
      
      # 6 小时 burn rate > 6 → P2
      - alert: HighErrorBudgetBurn_6h
        expr: |
          (
            rate(http_requests_total{status=~"5.."}[6h])
            / rate(http_requests_total[6h])
          ) > 6 * 0.001
        for: 5m
        labels:
          severity: warning

告警规则设计

分级

级别含义响应时间通知方式
P1 Critical服务不可用 / 数据丢失立即电话 + Slack
P2 High功能降级 / 性能退化1 小时Slack + 邮件
P3 Medium非紧急但需关注工作时间Slack
P4 Low信息性下周邮件

好告警 vs 坏告警

text
好告警:
  ✅ "订单创建错误率 > 5% 持续 2 分钟"
  ✅ "错误预算消耗 > 50%"
  ✅ "数据库连接池使用 > 90%"

坏告警:
  ❌ "CPU > 80%"(可能正常)
  ❌ "磁盘 > 70%"(太早)
  ❌ "某个 Pod 重启了"(可能正常)
  ❌ "日志有 ERROR"(太多噪音)

告警模板

yaml
- alert: HighErrorRate
  expr: http_error_rate > 0.05
  for: 2m
  labels:
    severity: critical
    team: backend
  annotations:
    summary: "High error rate: {{ $value | humanizePercentage }}"
    description: "Error rate > 5% for 2 minutes"
    runbook: "https://wiki.example.com/runbooks/high-error-rate"
    dashboard: "https://grafana.example.com/d/xxx"

Grafana 仪表盘设计

推荐 5 个 Dashboard

text
1. 服务总览(Golden Signals)
   - QPS / 错误率 / P50 / P99 / 饱和度
   - 按服务分组

2. 业务指标
   - 订单数 / 支付成功率 / 注册数
   - 按时间对比(vs 昨天 / 上周)

3. 基础设施
   - CPU / Memory / Disk / Network
   - 按节点 / Pod 分组

4. 数据库
   - 连接数 / 慢查询 / 锁等待 / 复制延迟

5. 发布追踪
   - 部署时间线
   - 发布前后指标对比

Prometheus + Grafana 部署

yaml
# docker-compose(快速启动)
services:
  prometheus:
    image: prom/prometheus:latest
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
    ports:
      - "9090:9090"

  grafana:
    image: grafana/grafana:latest
    ports:
      - "3000:3000"
    environment:
      - GF_SECURITY_ADMIN_PASSWORD=admin

  alertmanager:
    image: prom/alertmanager:latest
    volumes:
      - ./alertmanager.yml:/etc/alertmanager/alertmanager.yml
    ports:
      - "9093:9093"
yaml
# prometheus.yml
global:
  scrape_interval: 15s
  evaluation_interval: 15s

rule_files:
  - "alerts/*.yml"

alerting:
  alertmanagers:
    - static_configs:
        - targets: ['alertmanager:9093']

scrape_configs:
  - job_name: 'app'
    static_configs:
      - targets: ['app:8080']
    metrics_path: '/metrics'

日志收集(Loki)

yaml
# Loki + Promtail
services:
  loki:
    image: grafana/loki:latest
    ports:
      - "3100:3100"

  promtail:
    image: grafana/promtail:latest
    volumes:
      - /var/log:/var/log
      - ./promtail.yml:/etc/promtail/config.yml
text
日志规范:
  - JSON 格式(结构化)
  - 含 trace_id / service / level / timestamp
  - 不输出 PII / Token
  - 保留期:7~30 天

On-call 配置

text
轮值:
  - 每周轮换
  - 主 + 副(backup)
  - 交接文档

升级路径:
  P1:5 分钟无响应 → 升级到副
  P1:15 分钟无响应 → 升级到 Tech Lead
  P1:30 分钟无响应 → 升级到 CTO

工具:
  - PagerDuty / OpsGenie / Grafana OnCall
  - Slack 集成
  - 电话 + 短信

配套模板

  • templates/monitoring-setup-template.md — 监控配置 + SLO + 告警规则 + 仪表盘
  • templates/alert-rule-template.md — 告警规则与发布门禁

质量自检

text
□ 四大黄金信号覆盖
□ SLO / SLI 定义
□ 告警基于 SLO(不基于阈值)
□ 告警分级(P1~P4)
□ 告警可操作(有 Runbook)
□ 不 alert fatigue
□ 仪表盘覆盖(5 个)
□ 日志结构化 + 集中
□ On-call 配置
□ 升级路径
□ 错误预算跟踪
□ 发布后监控

常见坑

  1. CPU > 80% 告警——可能正常,应该看 SLO
  2. 告警太多——alert fatigue,重要的被忽略
  3. 告警不可操作——收到不知道做什么
  4. 不分级——所有告警都是 P1
  5. 没有 Runbook——半夜被叫起来不知道怎么修
  6. 日志不结构化——搜索困难
  7. 不监控业务指标——只盯技术指标
  8. SLO 不定义——不知道什么算"正常"
  9. 不做错误预算——永远在救火
  10. On-call 不轮换——一个人扛

与其他 skill 的协作

text
上游:
  ci-cd-pipeline → 部署后触发监控
  release-strategy → 发布后观察
  kubernetes-orchestration → K8s 指标

下游:
  sre-operations 工作流 → 事故响应
  backend-engineer observability → 应用层指标

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Monitoring Alerting AI skill do?

配置监控和告警时使用。适用于 Prometheus / Grafana / Loki / PagerDuty / SLO 定义 / 告警规则设计。融合 Google SRE 四大黄金信号 + USE Method + 告警分级。

Why use Monitoring Alerting on TypingMind?

Because you install it once and use it with any model. Monitoring Alerting is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Monitoring Alerting in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/zhaoxuya520/AI-Fullstack-Delivery-Workflow/tree/master/workflows/devops-engineer/skills/monitoring-alerting. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Monitoring Alerting?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Monitoring Alerting?

As many as you like. As long as a model supports skills, you can use Monitoring Alerting with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Monitoring Alerting AI skill free?

It is published on GitHub by zhaoxuya520. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇