Iván

Grafana

运维安全v1.0.0
作者:Iván更新于 2026-05-11grafana@clawhub_ivangdavila/grafana
监控告警配置生成

据 AlphaMoat 统计,截至 2026-09,Grafana 累计下载 3,746 次、获 4 个星标,在全部 5,078 个 AI 技能中排名第 2,847 位,在「运维安全」分类(264 个)中排名第 176 位。

累计安装
103
累计下载
3,746
星标
4
全站排名
#2,847
全站前 57% · 「运维安全」前 67%
平台累计安装累计下载星标评论
ClawHub ↗1033,3584-
SkillHub ↗993,7464—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

它覆盖变量插值、Prometheus rate 查询、面板阈值、服务端告警、通知渠道、仪表板导入、数据源模式和转换顺序,并提示高基数查询或注释查询可能增加负载。具体行为会受数据源和 Grafana 配置影响,应用前应在目标环境验证查询与告警结果。

资料发布于 2026-10-29

可以用来做什么

  • 排查变量插值和 Prometheus 指标查询问题。
  • 检查告警评估条件、待处理状态和通知渠道配置。
  • 识别仪表板导入、数据源认证及查询性能的常见问题。

什么时候用

  • 需要诊断 Grafana 面板无数据或查询结果异常时。
  • 需要检查告警是否在服务端正确评估并连接通知渠道时。
  • 导入仪表板或优化高基数查询之前,需要验证实际数据源设置时。

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

根据这份指南检查一条 Prometheus rate 查询是否使用了合适的范围向量。
整理告警从查询评估到通知送达的核对清单。

月度数据趋势

累计下载3,746
1,7722,8323,8922026-03 · 累计下载 1,9182026-05 · 累计下载 2,4872026-06 · 累计下载 2,6522026-07 · 累计下载 2,9292026-08 · 累计下载 3,1362026-09 · 累计下载 3,74626-0326-09
星标4
3452026-03 · 星标 42026-05 · 星标 42026-06 · 星标 42026-07 · 星标 42026-08 · 星标 42026-09 · 星标 426-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。 该技能有同名的其他版本,调整前的数据归属当前下载量最大的这一个。

月份累计下载环比星标
2026-093,746—4
2026-083,136+7.1%4
2026-072,929+10.4%4
2026-062,652+6.6%4
2026-052,487—4
2026-031,918—4

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

3.0 KB · ClawHub v1.0.0
---
name: Grafana
description: Avoid common Grafana mistakes — query pitfalls, variable templating, alerting traps, and provisioning gotchas.
metadata: {"clawdbot":{"emoji":"📊","os":["linux","darwin","win32"]}}
---

## Variables and Templating
- Multi-value variable needs `$__all` in regex — or only first value used
- `${var:csv}` for comma-separated — `${var:pipe}` for pipe-separated in regex
- Variable in query: `$var` or `${var}` — different escaping per data source
展开全部(共 58 行)
- `$__interval` auto-adjusts to time range — use for aggregation window
- Chained variables: child depends on parent — set "Refresh" to "On time range change"

## Prometheus Queries
- `rate()` needs range vector — `rate(requests_total[5m])` not `rate(requests_total)`
- `rate()` for counters, `deriv()` for gauges — rate handles counter resets
- `$__rate_interval` over hardcoded — adapts to scrape interval and dashboard range
- Labels in legend: `{{label}}` — multiple: `{{instance}} - {{job}}`
- Regex filter: `metric{label=~"val1|val2"}` — `!~` for negative match

## Panel Configuration
- "No data" vs "null" are different — configure in display options
- Thresholds work on last value — not all values in range
- Min/max must match your data range — auto-scaling can hide anomalies
- Time series for trends, stat for current value — choose visualization wisely

## Alerting
- Alert evaluates on server — not browser, query must work without variables
- Variables not supported in alerts — hardcode values or use templates
- Multiple conditions: AND is default — configure for OR if needed
- Alert state "Pending" before "Firing" — for duration, prevents flapping
- Notification channel must be configured — alert without channel = no notification

## Dashboard Provisioning
- JSON export includes data source UID — will fail if different on import
- Use data source variables — `${DS_PROMETHEUS}` substituted at runtime
- Provisioned dashboards read-only by default — `allowEditing: true` in provisioning
- Folder must exist before dashboard provisioning — or import fails silently

## Data Sources
- "Server" mode proxies through Grafana — hides credentials from browser
- "Browser" mode direct from browser — faster but exposes URL/auth
- Test connection catches most issues — but not query-specific problems
- TLS skip verify for self-signed — but fix proper certs for production

## Transformations
- Order matters — transformations apply in sequence
- Outer join for combining queries — match on time or label
- Reduce for aggregating time series — last, mean, max, etc.
- Add field from calculation — combine metrics client-side

## Common Mistakes
- Time range selector affects variable queries — unexpected results with "All time"
- Dashboard saved but datasource not — works locally, breaks on import
- Alert rule in dashboard vs Grafana alerting — different systems, don't mix
- Panel queries run on every refresh — high-cardinality queries slow dashboard
- Annotation queries add DB load — use sparingly on busy dashboards

「运维安全」分类下的热门技能

Iván 的其他技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。