用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ffsshhttiikk/opencode-agents-skills --skill grafana命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | grafana |
| description | Grafana visualization and analytics for monitoring and observability |
| license | MIT |
| compatibility | opencode |
| metadata | {"audience":"devops","category":"monitoring"} |
When visualizing metrics and creating monitoring dashboards.
{
"dashboard": {
"title": "Application Overview",
"tags": ["production", "app"],
"timezone": "browser",
"panels": [
{
"id": 1,
"title": "Request Rate",
"type": "graph",
"datasource": "Prometheus",
"targets": [
{
"expr": "rate(http_requests_total[5m])",
"legendFormat": "{{method}} - {{status}}"
}
],
"gridPos": {"x": 0, "y": 0, "w": 12, "h": 8}
},
{
"id": 2,
"title": "Error Rate",
"type": "stat",
"targets": [
{
"expr": "rate(http_requests_total{status=~\"5..\"}[5m]) * 100"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{"color": "green", "value": null},
{"color": "red", "value": 5}
]
}
}
]
}
}
// Query variable
// Name: $env
// Query: label_values(http_requests_total, env)
// Query using variable
rate(http_requests_total{env="$env"}[5m])
// Multi-value variable
sum by (service) (http_requests_total{env=~"$env"})
// Custom variable
// Name: $group
// Custom: backend,frontend,worker
// All value: .*
{
"annotations": [
{
"name": "Deployments",
"datasource": "Prometheus",
"query": "deployments{env=\"$env\"}"
}
]
}
// Outer Join
{
"id": "joinByField",
"options": {"mode": "outer"}
}
// Reduce
{
"id": "reduce",
"options": {
"reducers": ["sum", "mean", "max"]
}
}
// Calculate field
{
"id": "calculateField",
"options": {
"mode": "binary",
"reduce": {"reducer": "sum"},
"binary": {
"left": "requests",
"operator": "/",
"right": "errors"
}
}
}
{
"alert": {
"conditions": [
{
"type": "query",
"query": {
"params": ["A", "5m", "now"]
},
"reducer": {
"type": "avg"
},
"evaluator": {
"type": "gt",
"params": [100]
}
}
],
"notifications": [
{
"uid": "notification_uid"
from grafana_api.grafana_api import GrafanaClient
# Connect
gc = GrafanaClient(auth=('admin', 'admin'), host='localhost:3000')
# Create dashboard
dashboard = {
"dashboard": {
"id": None,
"title": "My Dashboard",
"tags": ["generated"],
"timezone": "browser",
"panels": [
{
"id": 1,
"title": "CPU Usage",
"type": "graph",
"targets": [
{
"expr": "100 - (avg by(instance) (rate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)"
}
]
}
]
}
}
gc.dashboard.update_dashboard(dashboard)