Community编程与开发github.com

grafana/promql

针对 Prometheus 和 Grafana Cloud Metrics 编写、验证和优化 PromQL 查询。当用户需要查询指标、编写 PromQL 表达式、计算速率、按标签聚合、构建直方图分位数、创建记录规则、调试查询性能或理解指标基数时使用。

promql 是什么?

grafana/promql 是一个专为 AI 代理(例如 Claude Code、Cursor 等)设计的技能,用于在 Prometheus 和 Grafana Cloud Metrics 生态系统中高效地编写、验证和优化 PromQL 查询。该技能能够处理从简单的指标查询到复杂的聚合、直方图分位数计算、记录规则创建以及查询性能调试等任务。它通过识别诸如“PromQL”、“Prometheus query”、“write a metric query”、“calculate rate”、“histogram_quantile”、“recording rule”等触发短语来自动激活。该技能的核心优势在于帮助开发者和运维人员快速生成准确的 PromQL 表达式,避免常见的语法错误,并优化查询以降低延迟和资源消耗。它适用于任何需要与 Prometheus 兼容的数据源交互的场景,支持多种平台,从而显著提升指标查询和故障排查的效率。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/grafana/skills/tree/main/skills/promql

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

promql 是做什么的?

为 Prometheus 和 Grafana Cloud Metrics 编写、验证和优化 PromQL 查询。当用户要求查询指标、编写 PromQL 表达式、计算速率、按标签聚合、构建直方图分位数、创建记录规则、调试查询性能或理解指标基数时使用。触发短语包括“PromQL”、“Prometheus query”、“write a metric query”、“calculate rate”、“histogram_quantile”、“recording rule”、“metric cardinality”、“sum by”、“rate vs irate”、“absent()”或“query is slow”。

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

grafana/dashboarding

Create, modify, and organise Grafana dashboards including panels, variables, transformations, and alerting. Use when the user asks to create a Grafana dashboard, add a panel, configure a time series or stat panel, add template variables, set up dashboard linking, use transformations, configure thresholds, build a dashboard for a service, or export dashboard JSON. Triggers on phrases like "create dashboard", "add panel", "time series panel", "Grafana dashboard JSON", "template variables", "dashboard variable", "panel transformation", "threshold", "stat panel", "table panel", "Grafana annotations", or "dashboard folder".

grafana/grafana-oss

Configure Grafana OSS — provisions dashboards from YAML, sets up data sources (Prometheus / Loki / Tempo / Pyroscope), writes dashboard JSON with template variables, builds panel queries, assigns built-in roles (Viewer / Editor / Admin / GrafanaAdmin), mints service-account tokens, edits grafana.ini server config, creates annotations, installs plugins via provisioning, and validates each step with a health-check curl. Use when building dashboards, configuring data sources, setting up provisioning YAML, picking a panel type, writing template variables, managing users and roles, configuring SMTP/OAuth in grafana.ini, creating annotations via API, troubleshooting why a provisioned dashboard isn't showing up, or running Grafana OSS locally — even when the user says "set up a Prometheus data source", "provision dashboards from git", "make a service account", or "configure SSO in OSS" without saying "Grafana OSS".

grafana/opentelemetry

OpenTelemetry with Grafana stack. Covers OTel SDK instrumentation for Go/Java/Python/Node.js/.NET, OTLP protocol and endpoint configuration, sending telemetry to Grafana Cloud via OTLP endpoint, Grafana Alloy as OTel collector, sampling strategies, Kubernetes OTel Operator, and migration from other observability tools. Use when instrumenting apps with OTel, configuring OTLP endpoints, setting up collectors, or migrating to OpenTelemetry.

grafana/prometheus

Prometheus and Grafana Cloud Metrics overview including PromQL query language, Metrics Drilldown, alerting, recording rules, and integration patterns. Use when working with Prometheus, writing PromQL queries, configuring alerting, or discussing metrics architecture and best practices.

相关技能