promql

promql is a skill for Claude Code from devantler-tech/agent-plugins. It costs 200 tokens per session (1,267 once invoked), scanned A, a copy of promql, Apache-2.0.

A guide for writing, checking, and improving PromQL queries for Prometheus, Grafana Mimir, and Grafana Cloud Metrics. PromQL is the language used to query time-series measurements such as request counts and response times.

In plain words
What is it for?
Use it to calculate rates and increases, filter and group metrics, find error ratios, query histograms, handle missing data, use time offsets, and validate queries.
Why use it?
It helps avoid invalid queries, incorrect rate calculations, missing labels, and misleading results from empty or stale data. It includes checks against a metrics endpoint before relying on a query.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the agentic-engineering plugin — 95 skills, 4 agents, 13 MCP servers shipped together

Good fit Use it to calculate rates and increases, filter and group metrics, find error ratios, query histograms, handle missing data, use time offsets, and validate queries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/devantler-tech/agent-plugins/promql
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add devantler-tech/agent-plugins --skill promql
Clone the repo
git clone --depth 1 https://github.com/devantler-tech/agent-plugins

Made for: Claude Code.

Or install agentic-engineering, the plugin that ships this one along with the rest of its 95 skills, 4 agents, 13 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for promql

README.md
[![agentmods](https://agentmods.dev/badge/skills/devantler-tech/agent-plugins/promql/github.svg)](https://agentmods.dev/skills/devantler-tech/agent-plugins/promql)
Your own site
<a href="https://agentmods.dev/skills/devantler-tech/agent-plugins/promql"><img src="https://agentmods.dev/badge/skills/devantler-tech/agent-plugins/promql/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for promql

Your own site · 80×15
<a href="https://agentmods.dev/skills/devantler-tech/agent-plugins/promql"><img src="https://agentmods.dev/badge/skills/devantler-tech/agent-plugins/promql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 200 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,267 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 95% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00200 $0.01267
Opus 5.5 $0.00080 $0.00507
Sonnet 5.5 $0.00040 $0.00253
Haiku 4.5 $0.00020 $0.00127

Measured 20d ago against content hash fd20b609cb03, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

promql scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

# and add basic auth (-u "<metrics_user>:<token>") to each curl below.
Origin

This is a copy

95% identical to promql — 10 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugins/agentic-engineering/skills/promql/SKILL.md · 108 lines

How it starts

The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

1. Write + validate a query

# 0. Point at your Prometheus/Mimir. For Grafana Cloud, use the metrics endpoint
#    and add basic auth (-u "<metrics_user>:<token>") to each curl below.
PROM=http://localhost:9090   # or https://prometheus-prod-XX.grafana.net/api/prom

# 1. Sketch the query — for "5xx error rate per service":
EXPR='sum(rate(http_requests_total{status_code=~"5.."}[5m])) by (service)'

# 2. Validate syntax + that the metric/labels exist
curl -sG --data-urlencode "query=${EXPR}" \
  "$PROM/api/v1/query" | jq '.status, (.data.result|length)'
# Expect: "success" and result count > 0. If 0 — check label spelling and scrape activity:
curl -sG --data-urlencode "match[]=http_requests_total" "$PROM/api/v1/series" | jq '.data | length'

# 3. Sanity-check the magnitude — open Grafana Explore, paste the expr,
#    confirm the values look right against a known ground truth (k6 run, log count, etc.)

2. Common patterns to copy

Per-status request rate (aggregate AFTER rate):

sum(rate(http_requests_total{job="api"}[5m])) by (status_code)

p95 latency (must keep le in the inner aggregation):

histogram_quantile(0.95,
  sum(rate(http_request_duration_seconds_bucket[5m])) by (le, service))

Error rate with divide-by-zero guard:

sum(rate(http_requests_total{status_code=~"5.."}[5m]))
  / (sum(rate(http_requests_total[5m])) > 0)

Full library (recording rules, SLO burn-rate, offsets, cardinality hunt, native histograms): references/patterns.md.

Read the full file on GitHub · 108 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 20d ago First seen · 108 lines · 200 tokens per session scan A fd20b609cb03

Subscribe to this mod's changes

promql is a skill published in the GitHub repository devantler-tech/agent-plugins (3 stars, last pushed 2d ago), licensed Apache-2.0. It adds 200 tokens to every session and 1,267 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). It is 95% identical to promql, differing in 10 lines, and is treated as a copy.

Related

promql compared with skills from other repositories

promql next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
promqldevantler-tech/agent-pluginsSkill32d agoApache-2.0A200Claude Code
provisioningxobotyi/cc-foundrySkill23todayMITA102Claude Code
proxmoxxobotyi/cc-foundrySkill23todayMITB91Claude Code
k8s-manifest-validationsigistry/marketplaceSkill33d agoMITB84Claude Code
devopsJoncik91/ucaiSkill283mo agoMITC41Claude Code
infrastructure-planninglukaskellerstein/claude-my-marketplaceSkill312d agononeA64Claude Code
istiolukaskellerstein/claude-my-marketplaceSkill312d agononeA0Claude Code