name: dashboard-generator description: 为Grafana和DataDog生成监控仪表板,并集成告警功能 allowed-tools:
- Bash
- Read
- Write
- Glob
仪表板生成器技能
概述
根据JSON/YAML定义生成Grafana和DataDog的监控仪表板,包含面板配置和告警规则集成。
能力
- 从JSON/YAML生成Grafana仪表板
- 创建DataDog仪表板
- 面板配置和模板
- 告警规则集成
- 变量模板化
- 注释支持
- 仪表板版本控制
- 行和面板布局
目标流程
- 可观测性实施
- 性能优化
- 弹性模式
输入模式
{
"type": "object",
"required": ["dashboards"],
"properties": {
"dashboards": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"type": { "type": "string", "enum": ["service", "infrastructure", "business", "slo"] },
"metrics": { "type": "array" },
"panels": { "type": "array" }
}
}
},
"platform": {
"type": "string",
"enum": ["grafana", "datadog", "cloudwatch"],
"default": "grafana"
},
"options": {
"type": "object",
"properties": {
"datasource": {
"type": "string",
"default": "prometheus"
},
"refreshInterval": {
"type": "string",
"default": "30s"
},
"timeRange": {
"type": "string",
"default": "6h"
},
"includeAlerts": {
"type": "boolean",
"default": true
},
"variables": {
"type": "array"
}
}
}
}
}
输出模式
{
"type": "object",
"properties": {
"dashboards": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"uid": { "type": "string" },
"json": { "type": "object" },
"path": { "type": "string" }
}
}
},
"alerts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"condition": { "type": "string" },
"threshold": { "type": "number" }
}
}
},
"variables": {
"type": "array"
}
}
}
使用示例
{
kind: 'skill',
skill: {
name: 'dashboard-generator',
context: {
dashboards: [
{
name: 'API服务概览',
type: 'service',
metrics: ['http_requests_total', 'http_request_duration_seconds'],
panels: [
{ type: 'graph', title: '请求速率' },
{ type: 'stat', title: '错误率' }
]
}
],
platform: 'grafana',
options: {
datasource: 'prometheus',
includeAlerts: true
}
}
}
}