
Cloud Monitoring PromQL Query Generator
Writes and validates PromQL queries for Google Cloud Monitoring metrics
- Repository
- google/skills
- Stars
- 21,782
- Licence
- Apache-2.0
- Files
- 6 files
What it does
Once installed, the agent can turn a Google Cloud Monitoring metric and resource details into a correctly structured PromQL query, choosing functions like rate, sum or histogram_quantile according to the metric type. It requires a Google Cloud project ID before it will generate anything, and it follows rules such as always filtering by monitored resource and not summing ratio metrics like CPU percentage across instances. It also includes a validator script that checks generated queries for the required syntax.
Great for
- Site reliability engineers writing dashboards or alerts for Google Cloud services
- Developers who need PromQL for Cloud Monitoring metrics and do not know the metric schema well
- Teams wanting consistent query conventions across Cloud Monitoring metrics
Skip it if
- Finding or choosing which metric to use; the skill itself defers that to a separate metric-selection skill
- Non-Google Cloud Prometheus setups, since it is specific to Cloud Monitoring naming and labels
- Running queries against production without review, because generated queries are only checked for structure, not for correct results
Try asking
- “Write a PromQL query for the CPU utilization of my GCE instances in project my-project, grouped by instance”
- “Create a histogram_quantile p95 query for Spanner query latency in project prod-123”
- “Generate a PromQL request count query for a Cloud Load Balancer rule and validate it”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 6 original files, the Apache-2.0 licence and an attribution note.
cloud-monitoring-promql-query.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip cloud-monitoring-promql-query.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip cloud-monitoring-promql-query.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- Provide the project ID and exact metric type up front to avoid extra discovery calls.
- Make sure gcloud is authenticated before asking for queries, since the skill runs gcloud config and curl calls with an access token.
- Review generated queries in a non-production project before using them in alerts or dashboards.
What's inside
- references/attribution.md
- references/basic_aggregations.md
- references/promql_error_recovery.md
- scripts/validate_promql_test.py
- scripts/validate_promql.py
- SKILL.md
Redistributed unmodified from google/skills under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.