Railway's official agent skill: create projects, provision databases and buckets, deploy, manage variables and domains, and read build failures back — from the CLI, API or MCP server.
PromQL Query PatternsSkill
Summary
Grafana's official PromQL skill: write, validate, and optimise Prometheus queries, and hunt down the label that blew up your cardinality.
Features
- rate vs irate vs increase, and the 4x-scrape-interval rule
- Aggregation with sum, avg, topk, by and without
- Classic and native histogram_quantile for correct percentiles
- Ratio queries with divide-by-zero guards
- SLO and burn-rate maths for error-budget alerts
- Cardinality-hunting playbook for slow queries and OOMs
- Recording-rule naming and dashboard-query migration
Install This Skill
Add this skill to your favorite AI agent in a few steps.
Skill Content
Usage Instructions
Learn how to use this skill with different AI agents.
Example Usage
Our checkout p95 dashboard looks wrong after we moved to native histograms — rewrite the panel query and add a 2%/1h burn-rate alert for the 99.9% availability SLO.
Description
Prometheus queries fail in quiet ways. A rate() over too short a window returns nothing instead of erroring, a p95 computed from the wrong histogram type is off by an order of magnitude, and a ratio divides by zero the moment traffic drops — none of which announce themselves. This skill from Grafana Labs gives an agent the query patterns that make those failures visible before they reach a dashboard.
What it covers
The core is the set of distinctions that PromQL punishes you for getting wrong: rate versus irate versus increase, label matchers and regex behaviour, and aggregation with sum, avg, topk, by, and without. On top of that it covers classic and native histogram_quantile, ratio expressions with divide-by-zero guards, absent and changes for staleness detection, time offsets and predict_linear for trend work, recording-rule naming conventions, and the SLO and burn-rate arithmetic behind error-budget alerts.
It also carries a cardinality-hunting playbook — the workflow for finding which label is generating the series explosion behind a slow query, an OOMing Prometheus, or an unexpected Grafana Cloud bill.
The rule it enforces first
rate() and increase() need a range vector of at least four scrape intervals. On a 60-second scrape that means [5m] minimum. Most "my query returns no data" reports resolve to this one line, which is why the skill states it as a golden rule up front.
Where it applies
The queries work against Prometheus, Grafana Mimir, and Grafana Cloud Metrics. The skill is written to trigger on the way people actually phrase these requests — "calculate the error rate", "p99 latency", "sum by service", "why is this query slow", "what's filling Mimir" — rather than requiring anyone to say the word PromQL.
Part of the grafana-core plugin in Grafana's public skills marketplace, alongside dashboarding, alerting and IRM, Alloy, Beyla, and OpenTelemetry skills.
Related Skills
Diagnoses wrong gradients in differentiable NVIDIA Warp programs by measuring first — comparing autodiff against finite differences on a shrunk reproduction before proposing any fix.
Google's official skill for the gws CLI — drive Gmail, Drive, Calendar, Sheets, Docs, Chat and Admin APIs from an agent, with Model Armor screening.
Netlify's official skill for zero-config managed Postgres — querying from Functions, Drizzle setup, migrations and per-preview database branches.