promql-generator

promql-generator is a skill for Claude Code, Codex from ccfos/nightingale. It costs 11 tokens per session (919 once invoked), scanned A, original, Apache-2.0.

A helper that turns plain-language monitoring requests into PromQL queries. PromQL is the query language used by Prometheus, a system that stores time-based measurements such as CPU usage or request counts.

In plain words
What is it for?
Use it to create queries for selecting, filtering, aggregating, or examining metrics over time. It first searches available metrics and their labels to match the request.
Why use it?
It reduces the need to remember PromQL syntax and helps choose metric names and filters that actually exist. It can inspect metric labels before building the query.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create queries for selecting, filtering, aggregating, or examining metrics…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ccfos/nightingale/promql-generator
About the project

Nightingale is an open-source monitoring and alerting system that connects to stored metrics and log data, evaluates alert rules, and distributes notifications. Operations teams use it to manage alarms and explore observability data alongside existing data sources and collectors. Catalogue add-ons provide skills for operating Nightingale.

ccfos/nightingale · 13,280 stars · on GitHub · n9e.github.io

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 ccfos/nightingale --skill promql-generator
Clone the repo
git clone --depth 1 https://github.com/ccfos/nightingale

Made for: Claude Code, Codex.

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-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/ccfos/nightingale/promql-generator.svg)](https://agentmods.dev/skills/ccfos/nightingale/promql-generator)
Your own site
<a href="https://agentmods.dev/skills/ccfos/nightingale/promql-generator"><img src="https://agentmods.dev/badge/skills/ccfos/nightingale/promql-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 11 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 919 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found 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.00011 $0.00919
Opus 5 $0.00005 $0.00460
Sonnet 5 $0.00002 $0.00184
Haiku 4.5 $0.00001 $0.00092

Measured 7d ago against content hash 6e7db0a2a5e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

promql-generator scanned grade A with 0 findings 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 7d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

aiagent/skill/embedded/builtin/promql-generator/SKILL.md · 97 lines

How it starts

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

PromQL Generation Expert

You are a PromQL expert who generates correct PromQL queries based on the user's natural-language description.

Workflow

  1. Understand the user's intent: Analyze what the user wants to query (metrics, conditions, aggregation method, time range, etc.)
  2. Search for relevant metrics: Use the list_metrics tool to search for potentially relevant metric names
  3. Understand the metric's structure: Use the get_metric_labels tool to obtain the metric's label keys and values, and learn the available filtering dimensions
  4. Build the PromQL: Based on the metadata you obtained, build an accurate PromQL query

Available Tools

list_metrics

Search Prometheus metric names, with support for fuzzy keyword matching.

  • keyword: search keyword (optional)
  • limit: limit on the number of returned items, default 30

get_metric_labels

Get all label keys of the specified metric and their possible values.

  • metric: metric name (required)

PromQL Syntax Essentials

Selectors

  • Instant vector: metric_name{label="value"}
  • Range vector: metric_name{label="value"}[5m]
  • Label matching: = (exact), != (not equal), =~ (regex), !~ (regex negation)

Aggregation Operations

  • sum, avg, max, min, count, stddev, stdvar
  • topk(n, metric), bottomk(n, metric)
  • by (label) or without (label) for grouping

Common Functions

  • rate(metric[5m]) - per-second growth rate for Counter-type metrics
  • increase(metric[1h]) - increment for Counter-type metrics
  • irate(metric[5m]) - instantaneous growth rate
  • histogram_quantile(0.95, metric) - quantile calculation
  • avg_over_time(metric[1h]) - average value over a time range
  • absent(metric) - detect whether a metric exists

Operators

  • Arithmetic: +, -, *, /, %, ^
  • Comparison: ==, !=, >, <, >=, <=
  • Logical: and, or, unless

Output Format

The final answer must be in JSON format:

{
    "query": "the generated PromQL statement",
    "explanation": "a brief explanation of the query logic"
}

Read the full file on GitHub · 97 lines

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. 7d ago First seen · 97 lines · 11 tokens per session scan A 6e7db0a2a5e6

Subscribe to this mod's changes

promql-generator is a skill published in the GitHub repository ccfos/nightingale (13,280 stars, last pushed 2d ago), licensed Apache-2.0. It adds 11 tokens to every session and 919 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

cis-aws-database-10.8

Ensure Monitoring and Alerting is Enabled.

CyberStrikeus/CyberStrike · 17 tokens

monitoring

Use when setting up uptime and health monitoring, alerts, or on-call basics for a service already in production, so you learn it is down before customers do — health and readiness probes, alerting on SLO error-budget burn rather than raw counts, curing alert fatigue, on-call rotation with escalation, and a status…

ericrisco/rsc-harness · 88 tokens

grafana-expert

Expert-level Grafana dashboards, visualization, data sources, alerting, and production operations. Use when the user mentions dashboards, visualization, monitoring, observability, or alerting, or when the task involves Grafana Architecture, Installation on Kubernetes, Data Sources, or Dashboard JSON.

personamanagmentlayer/pcl · 61 tokens

datadog

Full-stack observability with Datadog APM, logs, metrics, synthetics, and RUM. Use when implementing monitoring, tracing, alerting, or cost optimization for production systems.

bobmatnyc/claude-mpm-skills · 43 tokens

monitoring-expert

Expert-level monitoring and observability with Prometheus, Grafana, logging, and alerting. Use when the user mentions observability, Prometheus, Grafana, logging, metrics, or alerting, or when the task involves The Three Pillars of Observability, Monitoring Fundamentals, Prometheus Configuration, or Alert Rules.

personamanagmentlayer/pcl · 70 tokens

prometheus-expert

Expert-level Prometheus monitoring, metrics collection, PromQL queries, alerting, and production operations. Use when the user mentions monitoring, metrics, observability, alerting, or PromQL, or when the task involves Prometheus Architecture, Installation on Kubernetes, ServiceMonitor, or PromQL Queries.

personamanagmentlayer/pcl · 65 tokens