promql-generator
БесплатноБез исполняемых скриптовНе проверенGenerate/create/write PromQL queries, metric expressions, alerting rules, recording rules, Prometheus dashboards.
от akin-ozer★ 346 звёзд на GitHubОб этом скилле
PromQL Query Generator
Overview
This skill provides a comprehensive, interactive workflow for generating production-ready PromQL queries with best practices built-in. Generate queries for monitoring dashboards, alerting rules, and ad-hoc analysis with an emphasis on user collaboration and planning before code generation.
When to Use This Skill
Invoke this skill when:
- Creating new PromQL queries from scratch
- Building monitoring dashboards (Grafana, Prometheus UI, etc.)
- Implementing alerting rules for Prometheus Alertmanager
- Analyzing metrics for troubleshooting or capacity planning
- Converting monitoring requirements into PromQL expressions
- Learning PromQL or teaching others
- The user asks to "create", "generate", "build", or "write" PromQL queries
- Working with Prometheus metrics (counters, gauges, histograms, summaries)
- Implementing RED (Rate, Errors, Duration) or USE (Utilization, Saturation, Errors) metrics
Interactive Query Planning Workflow
CRITICAL: This skill emphasizes interactive planning before query generation. Always engage the user in a collaborative planning process to ensure the generated query matches their exact intentions.
Follow this workflow when generating PromQL queries:
Stage 1: Understand the Monitoring Goal
Start by understanding what the user wants to monitor or measure. Ask clarifying questions to gather requirements:
Primary Goal: What are you trying to monitor or measure?
- Request rate (requests per second)
- Error rate (percentage of failed requests)
- Latency/duration (response times, percentiles)
- Resource usage (CPU, memory, disk, network)
- Availability/uptime
- Queue depth, saturation, throughput
- Custom business metrics
Use Case: What will this query be used for?
- Dashboard visualization (Grafana, Prometheus UI)
- Alerting rule (firing when threshold exceeded)
- Ad-hoc troubleshooting/analysis
- Recording rule (pre-computed aggregation)
- Capacity planning or SLO tracking
Context: Any additional context?
- Service/application name
- Team or project
- Priority level
- Existing metrics or naming conventions
Use the AskUserQuestion tool to gather this information if not provided.
When to Ask vs. Infer: If the user's initial request already clearly specifies the goal, use case, and context (e.g., "Create an alert for P95 latency > 500ms for payment-service"), you may acknowledge these details in your response instead of re-asking. Only ask clarifying questions for information that is missing or ambiguous.
Stage 2: Identify Available Metrics
Determine which metrics are available and relevant:
Metric Discovery: What metrics are available?
- Ask the user for metric names
- If uncertain, suggest common naming patterns
- Check for metric type indicators in the name:
_totalsuffix → Counter_bucket,_sum,_countsuffix → Histogram- No suffix → Likely Gauge
_createdsuffix → Counter creation timestamp
Metric Type Identification: Confirm the metric type(s)
- Counter: Cumulative metric that only increases (or resets to zero)
- Examples:
http_requests_total,errors_total,bytes_sent_total - Use with:
rate(),irate(),increase()
- Examples:
- Gauge: Point-in-time value that can go up or down
- Examples:
memory_usage_bytes,cpu_temperature_celsius,queue_length - Use with:
avg_over_time(),min_over_time(),max_over_time(), or directly
- Examples:
- Histogram: Buckets of observations with cumulative counts
- Examples:
http_request_duration_seconds_bucket,response_size_bytes_bucket - Use with:
histogram_quantile(),rate()
- Examples:
- Summary: Pre-calculated quantiles with count and sum
- Examples:
rpc_duration_seconds{quantile="0.95"} - Use
_sumand_countfor averages; don't average quantiles
- Examples:
- Counter: Cumulative metric that only increases (or resets to zero)
Label Discovery: What labels are available on these metrics?
- Common labels:
job,instance,environment,service,endpoint,status_code,method - Ask which labels are important for filtering or grouping
- Common labels:
Use the AskUserQuestion tool to confirm metric names, types, and available labels.
Stage 3: Determine Query Parameters
Gather specific requirements for the query.
Pre-confirmation for User-Provided Parameters
IMPORTANT: When the user has already specified parameters in their initial request (e.g., "5-minute window", "500ms threshold", "> 5% error rate"), you MUST:
- Acknowledge the provided values explicitly in your response
- Present them as pre-filled defaults in AskUserQuestion with the first option being "Use specified values"
- Allow quick confirmation rather than re-asking for information already given
Example: If user says "alert when P95 latency exceeds 500ms", use:
AskUserQuestion:
- Question: "Confirm the alert threshold?"
- Options:
1. "500ms
Установить promql-generator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл promql-generator?
Generate/create/write PromQL queries, metric expressions, alerting rules, recording rules, Prometheus dashboards.
Как установить скилл promql-generator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл promql-generator запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic