核心概念
告警 (Alert)
告警是平台处理的基本单元,代表从监控系统接收到的单个事件通知。
告警结构
json
{
"id": "alert_001",
"name": "数据节点CPU使用率",
"description": "阿里云监控告警: CPU使用率95.7%",
"severity": "critical",
"source": ["aliyun_cloudmonitor"],
"fingerprint": "abc123",
"status": "firing",
"lastReceived": "2023-06-01T10:30:00Z",
"labels": {
"namespace": "acs_kvstore",
"instanceId": "r-bp15eqmgyf44m0rzwu"
},
"enriched_fields": {
"instance_info": {
"type": "Redis",
"version": "5.0",
"region": "cn-hangzhou"
}
}
}告警属性
- id: 告警唯一标识
- name: 告警名称
- description: 告警详细描述
- severity: 严重程度 (critical, warning, info)
- source: 告警来源
- fingerprint: 告警指纹,用于去重
- status: 告警状态 (firing, resolved, pending)
- lastReceived: 最后接收时间
- labels: 告警标签,包含分类信息
- enriched_fields: 富化字段,包含额外上下文信息
事件 (Incident)
事件是相关告警的聚合单元,代表需要处理的一个完整问题。
事件结构
json
{
"id": "incident_001",
"tenant_id": "tenant_001",
"running_number": 42,
"name": "Redis实例性能异常",
"user_summary": "Redis连接池耗尽导致服务不可用",
"generated_summary": "检测到Redis实例r-bp15eqm连接数超限,同时MySQL高CPU和K8s节点内存压力,判断为数据库连接池耗尽引起的级联故障。",
"assignee": "ops_team",
"severity": 1,
"status": "acknowledged",
"creation_time": "2023-06-01T10:35:00Z",
"start_time": "2023-06-01T10:30:00Z",
"end_time": null,
"alerts_count": 3,
"affected_services": ["payment-service", "order-service"]
}事件属性
- id: 事件唯一标识
- tenant_id: 租户ID
- running_number: 事件序号
- name: 事件名称
- user_summary: 用户提供的摘要
- generated_summary: 系统生成的摘要
- assignee: 负责人
- severity: 严重程度 (1-5,1最高)
- status: 状态 (firing, acknowledged, resolved)
- creation_time: 创建时间
- start_time: 开始时间
- end_time: 结束时间
- alerts_count: 关联告警数量
- affected_services: 受影响的服务
工作流 (Workflow)
工作流是定义自动化处理逻辑的配置单元,支持复杂的条件判断和操作步骤。
工作流结构
yaml
workflow:
id: redis-diagnostic
name: Redis诊断工作流
description: 自动诊断Redis实例问题并执行初步修复
triggers:
- type: alert
filters:
- key: source
value: ["aliyun_cloudmonitor"]
- key: labels.namespace
value: "acs_kvstore"
steps:
- name: collect-info
provider:
type: redis
config: "{{ providers.redis }}"
with:
command: "INFO"
instance_id: "{{ alert.labels.instanceId }}"
enrich_alert:
- key: redis_info
value: results
- name: check-connections
if: "{{ alert.name contains '连接数' }}"
provider:
type: redis
config: "{{ providers.redis }}"
with:
command: "CLIENT LIST"
enrich_alert:
- key: client_list
value: results
actions:
- name: notify-team
provider:
type: slack
with:
channel: "#redis-alerts"
message: "Redis实例 {{ alert.labels.instanceId }} 出现异常: {{ alert.name }}"
- name: create-ticket
if: "{{ alert.severity == 'critical' }}"
provider:
type: jira
with:
project: OPS
title: "Redis告警: {{ alert.name }}"
description: "{{ alert.description }}"工作流属性
- id: 工作流唯一标识
- name: 工作流名称
- description: 工作流描述
- triggers: 触发条件
- steps: 执行步骤
- actions: 执行动作
规则 (Rule)
规则定义了告警关联和事件创建的逻辑。
CEL规则结构
json
{
"ruleName": "Redis实例关联",
"celQuery": "source == 'aliyun_cloudmonitor' && labels.namespace == 'acs_kvstore'",
"timeframeInSeconds": 300,
"groupingCriteria": ["labels.instanceId"],
"threshold": 2,
"incidentNameTemplate": "Redis实例 {{ labels.instanceId }} 异常"
}规则属性
- ruleName: 规则名称
- celQuery: CEL表达式查询条件
- timeframeInSeconds: 时间窗口
- groupingCriteria: 分组条件
- threshold: 触发阈值
- incidentNameTemplate: 事件名称模板
提取规则 (Extraction Rule)
提取规则用于从告警文本中提取结构化信息。
提取规则结构
json
{
"id": "extract-error-code",
"name": "错误码提取",
"priority": 100,
"pre": true,
"condition": "source contains 'mysql'",
"attribute": "error_code",
"regex": "(?<error_code>ERR-\\d+)"
}提取规则属性
- id: 规则ID
- name: 规则名称
- priority: 优先级
- pre: 是否预处理
- condition: 应用条件
- attribute: 目标属性
- regex: 正则表达式
映射规则 (Mapping Rule)
映射规则用于将外部数据映射到告警属性。
映射规则结构
json
{
"id": "service-owner-mapping",
"name": "服务负责人映射",
"priority": 100,
"type": "csv",
"condition": "true",
"matchers": [
{
"alertField": "service",
"mappingField": "service_name"
}
],
"rows": [
{
"service_name": "payment-service",
"owner": "payment-team",
"slack_channel": "#payment-alerts"
},
{
"service_name": "order-service",
"owner": "order-team",
"slack_channel": "#order-alerts"
}
]
}映射规则属性
- id: 规则ID
- name: 规则名称
- priority: 优先级
- type: 类型 (csv, topology)
- condition: 应用条件
- matchers: 匹配条件
- rows: 映射数据
AlertMind分析结果
AlertMind AI系统生成的分析结果。
分析结果结构
json
{
"alert_id": "alert_001",
"classification": {
"severity": {
"prediction": "critical",
"confidence": 0.95,
"probabilities": {
"critical": 0.95,
"warning": 0.04,
"info": 0.01
}
},
"type": {
"prediction": "database",
"confidence": 0.88
}
},
"correlation": {
"related_alerts": [
{
"alert_id": "alert_002",
"similarity_score": 0.85
}
]
},
"explanation": "数据节点CPU使用率达到95.7%,超过阈值95%。这通常表示Redis实例负载过高,可能影响服务性能。建议检查慢查询、优化数据结构或考虑扩容。",
"confidence_score": 0.91,
"processing_time": 0.15
}分析结果属性
- alert_id: 关联的告警ID
- classification: 分类结果
- correlation: 关联分析
- explanation: 解释文本
- confidence_score: 置信度
- processing_time: 处理时间
概念关系图
术语表
| 术语 | 定义 |
|---|---|
| 告警 (Alert) | 从监控系统接收到的单个事件通知 |
| 事件 (Incident) | 相关告警的聚合单元,代表需要处理的一个完整问题 |
| 工作流 (Workflow) | 定义自动化处理逻辑的配置单元 |
| 规则 (Rule) | 定义告警关联和事件创建的逻辑 |
| 提取规则 (Extraction Rule) | 从告警文本中提取结构化信息的规则 |
| 映射规则 (Mapping Rule) | 将外部数据映射到告警属性的规则 |
| 指纹 (Fingerprint) | 告警的唯一标识,用于去重 |
| 哈希 (Hash) | 告警内容的哈希值,用于判断全量重复 |
| Provider | 告警源适配器,负责接收和标准化告警 |
| CEL | Common Expression Language,用于定义规则条件 |
| AlertMind | 平台的AI分析引擎,包括LLM和专用模型 |
