promql
Skill by grafana
Writes, validates and optimizes PromQL queries for Prometheus, Grafana Mimir and Grafana Cloud Metrics. Aimed at engineers who query metrics, build alerts or fix slow dashboard queries.
Install promql
Built from the published package, never by AI.
git clone --depth 1 https://github.com/grafana/skills /tmp/skills && mkdir -p ~/.claude/skills && cp -r /tmp/skills/skills/grafana-core/promql ~/.claude/skills/promqlRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/grafana/skills /tmp/skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/skills/skills/grafana-core/promql ~/.gemini/antigravity-cli/skills/promqlAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill gives an AI assistant guidance for writing and checking PromQL, the query language for Prometheus, Grafana Mimir and Grafana Cloud Metrics. It covers rate, irate and increase, label matchers, aggregation with sum, avg, topk, by and without, and classic and native histogram_quantile. It also covers ratios with divide-by-zero guards, staleness checks with absent and changes, time offsets, predict_linear, recording-rule naming, SLO and burn-rate math, and a cardinality-hunting playbook.
The workflow is to sketch a query, send it to the Prometheus HTTP API with curl, and confirm the result count and the magnitude of the values. A detailed pattern library sits in a separate reference file. The skill also shows how to turn a slow dashboard query into a recording rule and verify that both return the same value. It is for people who write metric queries, fix wrong percentiles, build error-budget alerts or investigate high cardinality.
Written from the project's SKILL.md and checked against it.
What it can do
- Write and validate queriesSketches a PromQL expression and checks syntax and metric existence through the Prometheus API.
- Common query patternsProvides copyable patterns for per-status request rates, p95 latency and error rates with a zero guard.
- Recording rule conversionTurns a slow dashboard query into a named recording rule and checks it matches the original.
- Troubleshooting common bugsExplains causes of NaN histogram results, empty data, wrong rate magnitude and query timeouts.
- Pattern library referencePoints to a reference file covering SLO burn-rate, offsets, cardinality hunting and native histograms.
What you need
- A Prometheus, Grafana Mimir or Grafana Cloud metrics endpoint
- Basic auth user and token for Grafana Cloud endpoints
- curl and jq for the command examples
Try asking
- Write a PromQL query for 5xx error rate per service over 5 minutes
- Fix my p95 latency query that returns NaN in Prometheus
- Turn this slow dashboard query into a Prometheus recording rule
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/grafana-core/promql/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md4 KB -
references/patterns.md4 KB
Alternatives to promql
All alternatives →Runs the full Next.js deployment test suite for an internal vercel/next.js pull request. It validates the commit's preview package, then dispatches the test_e2e_deploy_release.yml workflow. Meant for maintainers who explicitly ask for the entire suite.
Instruments Python AI applications with DeepEval's native tracing so their execution appears span by span in Confident AI's Observatory. It is for developers building LLM apps, agents, RAG pipelines and chatbots.
Manages Azure Container Registry through the az acr Azure CLI command group. It covers registries, images, cloud builds, ACR Tasks, tokens, geo-replication and networking. Built for developers and operators who work with ACR in Azure.
Opens, runs, and shows apps on a temporary Crabbox machine, including native desktops and web previews. It is for OpenClaw users who want an app running and visible in their chat side panel.
Runs batch and HPC workloads on GKE using job queues and parallel processing. Aimed at teams running batch pipelines, HPC simulations, or ML training jobs on Google Kubernetes Engine.
Answers questions about GKE cluster and workload costs using BigQuery billing exports and live cluster metrics. Built for platform engineers and cloud teams who need to analyze and diagnose GKE spend.
Compare with deploy-release-test, deepeval-tracing or azure-container-registry-cli
promql: common questions
What query languages does this skill cover?
It covers PromQL for Prometheus, Grafana Mimir and Grafana Cloud Metrics. The source does not mention other query languages.
Why does my histogram_quantile return NaN?
The source says this usually means the inner aggregation is missing by (le). Keep le in the inner aggregation when computing percentiles.
How long should my rate range be?
The source gives a golden rule that rate and increase need a range vector at least 4 times the scrape interval. For a 60 second scrape, use [5m] at minimum.
How do I install promql?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is promql free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is promql safe to use?
It scores 80 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to promql?
Similar skills: deploy-release-test, deepeval-tracing, azure-container-registry-cli, crabbox-apps.
