Download for MacApple silicon, macOS 14+
Skill

promql

@grafana Updated 2026-10-17

Write, validate, and optimize PromQL for Prometheus / Grafana Mimir / Grafana Cloud Metrics. Covers `rate` vs `irate` vs `increase`, label matchers and regex, `sum / avg / topk / by / without` aggregation, classic + native `histogram_quantile`, ratios with divide-by-zero guards, `absent` / `changes` for staleness, time offsets and `predict_linear`, recording-rule naming, SLO + burn-rate math, and a cardinality-hunting playbook. Use when writing a metric query, fixing wrong p95s, building an error-budget alert, debugging "query is slow", finding the noisy label that blew up cardinality, or migrating a dashboard query to a recording rule — even when the user says "calculate the error rate", "p99 latency", "sum by service", "why is this query slow", or "what's filling Mimir" without naming PromQL.

Install

With your agent

Install OMGSkills skill "grafana/skills:promql" into this agent's normal skills directory: call the OMGSkills MCP get_install_plan tool for your agent and run the script it returns (it installs only the pinned commit and verifies SKILL.md), and stop if MCP or the pin is unavailable. Do not overwrite or change existing skills without asking me.

Manual command

git clone https://github.com/grafana/skills /tmp/skills && ln -s /tmp/skills/skills/grafana-core/promql ~/.claude/skills/promql

From README

PromQL Query Patterns Docs: https://prometheus.io/docs/prometheus/latest/querying/basics/ PromQL returns either an instant vector, a range vector, or a scalar. Golden rule: rate() / increase() require a range vector ≥ 4× the scrape interval. 60s scrape → use [5m] minimum. Prerequisites A Prometheus / Mimir / Grafana Cloud endpoint to query (/api/v1/query or via Grafana Explore) The PromQL pattern library in references/patterns.md Common Workflows Write + validate a query Common patterns to copy Per-status request rate (aggregate AFTER rate): p95 latency (must keep le in the inner aggregation): Error rate with divide-by-zero guard: Full library (recording rules, SLO burn-rate, offsets, cardinality hunt, native histograms): references/patterns.md.