promql-generator

Generate PromQL queries, alerting rules, and recording rules from monitoring requirements.

1|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/devkeni/Skills --skill promql-generator-devkeni
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: promql-generator
Source: https://github.com/devkeni/Skills/tree/main/backend-devops/promql-generator
Command: npx skills add https://github.com/devkeni/Skills --skill promql-generator-devkeni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Generate and optimize PromQL queries, alerting rules, and recording rules from high-level monitoring requirements, ensuring consistency with Prometheus best practices.

Core Features & Use Cases

  • Interactive planning workflow to align queries with user goals (RED/USE patterns, histogram_percentiles, and recording rules)
  • Metric discovery and label-level filtering to minimize cardinality and improve performance
  • Output ready for dashboards, alerts, and recording rules, with validation guidance and references

Quick Start

Describe your monitoring goal and available metrics, and I will generate a tailored PromQL plan and final query.

Frequently Asked Questions about promql-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write PromQL queries for Grafana dashboards using RED or USE patterns?▼

Generating optimized PromQL queries requires an interactive planning stage to align metric expressions with RED or USE patterns, applying proper rate and histogram_quantile functions, and filtering labels to minimize cardinality while ensuring dashboard accuracy.

What's the best way to create Prometheus alerting rules with proper label filtering?▼

Creating Prometheus alerting rules involves a planning workflow that enforces PromQL best practices, ensuring correct metric-type usage and label-level filtering to generate ready-to-use Alertmanager rule configurations.

When do I need recording rules to optimize Prometheus query performance?▼

Recording rules are needed to optimize Prometheus query performance when frequently computing expensive expressions like histogram_quantile across services, pre-calculating them to reduce dashboard load and alert evaluation times.

How does metric discovery and label filtering affect PromQL cardinality?▼

Metric discovery and label-level filtering directly reduce PromQL cardinality by narrowing matched time series, preventing server overload and significantly improving query execution speed for dashboards and alerts.

Can I generate recording rules and alerting rules together from high-level monitoring requirements?▼

Yes, generating both recording and alerting rules from high-level monitoring requirements is possible by describing your monitoring goals and available metrics, which produces tailored PromQL plans with validation guidance.

Why do my histogram_quantile PromQL queries return inaccurate percentile results?▼

Histogram_quantile PromQL queries return inaccurate percentiles when applied without proper bucket alignment or label filtering, so enforcing documented patterns and metric-type best practices validates correct usage.