
Cloud monitoring promql query
Builds valid PromQL queries for Google Cloud Monitoring metrics and resources
- Scripts
- Python
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 24.4K
- Last commit
- 2 days ago
- License
- Apache-2.0
- Listing updated
- 1 day ago
Similar skills
About Cloud monitoring promql query
Cloud monitoring promql query is an open-source agent skill for cloud and infrastructure. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
This skill guides an agent through writing PromQL queries against Cloud Monitoring metrics. It maps a metric descriptor's metric kind, value type and monitored resource onto the right PromQL structure, including how metric names are normalized from Cloud Monitoring type strings, such as adding the bucket suffix for distribution metrics. It also covers resource filtering, including keeping the user's literal resource names and using composite identifiers where a resource requires them.
The workflow requires a Google Cloud project ID before any query is written, and it stops to ask the user if none can be found. When descriptors are missing, the agent is directed to a metric selection skill, the Cloud Monitoring MCP tool or a direct REST call to fetch resource label schemas. The skill ships a Python validation script that parses generated queries in one batch, plus reference guides for aggregation mapping and error recovery.
The skill expects gcloud access for project lookup and Python 3 with the promql-parser package for validation. Output is a single-line query with no comments, wrapped in a promql code block.
When your agent uses it
Generates valid PromQL queries from Cloud Monitoring metric descriptors and resource parameters. Use when asked to create, generate, write, or format PromQL queries, PromQL strings, or PromQL aggregations for Cloud Monitoring metrics and resources. Don't use for raw metric discovery or metric selection.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
- Runs Python scripts(see the files on GitHub)
- No network calls found in its scripts(see the files on GitHub)
- License: Apache-2.0(see the files on GitHub)
From a static check of its 6 files (47 KB) on GitHub on 17 November 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
Copy the skill folder to ~/.claude/skills/cloud-monitoring-promql-query to use it in all your projects:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/google/skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/cloud-monitoring-promql-query &&
cp -R "$tmp/skills/cloud/cloud-monitoring-promql-query" ~/.claude/skills/cloud-monitoring-promql-query &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/cloud-monitoring-promql-query inside it instead.
Copy the skill folder to ~/.agents/skills/cloud-monitoring-promql-query to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/google/skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/cloud-monitoring-promql-query &&
cp -R "$tmp/skills/cloud/cloud-monitoring-promql-query" ~/.agents/skills/cloud-monitoring-promql-query &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/cloud-monitoring-promql-query inside it instead.
Copy the skill folder to ~/.cursor/skills/cloud-monitoring-promql-query to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/google/skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/cloud-monitoring-promql-query &&
cp -R "$tmp/skills/cloud/cloud-monitoring-promql-query" ~/.cursor/skills/cloud-monitoring-promql-query &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/cloud-monitoring-promql-query inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/google/skills.git --path skills/cloud/cloud-monitoring-promql-queryOr copy the folder to ~/.gemini/skills/cloud-monitoring-promql-query yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/cloud-monitoring-promql-query:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/google/skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/cloud-monitoring-promql-query &&
cp -R "$tmp/skills/cloud/cloud-monitoring-promql-query" ~/.copilot/skills/cloud-monitoring-promql-query &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/cloud-monitoring-promql-query inside it instead.
Get the folder:
git clone --depth 1 https://github.com/google/skills.gitThen copy skills/skills/cloud/cloud-monitoring-promql-query into your agent's skills folder as cloud-monitoring-promql-query. Agents that support SKILL.md read one folder per skill.
What it does
- Metric name normalization
- Converts Cloud Monitoring metric types into the colon-separated PromQL metric names used by Cloud Monitoring.
- Resource filter handling
- Applies monitored_resource filters and picks the correct resource identifier labels for each resource type.
- Aggregation mapping
- Maps metric kind, value type, aligner and reducer to PromQL functions such as rate, histogram_quantile, sum and avg.
- Query validation script
- Runs a Python linter that parses generated PromQL queries in a batch and reports syntax or type errors.
- Error recovery guide
- Provides fixes for common PromQL type mismatches and syntax errors found during validation.
- Utilization aggregation rules
- Keeps ratio and percentage utilization metrics unaggregated or grouped by instance rather than summed.
Good for
- Write a PromQL query for CPU utilization of a GKE cluster
- Build a histogram_quantile query for Cloud Functions execution times
- Create a PromQL aggregation of request counts grouped by service
- Generate a filtered query for a Cloud SQL database by its composite ID
Cloud monitoring promql query FAQ
What does the skill need before it writes a query?
It needs a Google Cloud project ID, taken from the prompt or from gcloud config. If none is available, the skill stops and asks the user for it.
Does it find metrics for me?
Not on its own. Vague requests are sent to the cloud-monitoring-metric-selection skill, and known metric types are looked up with the list_metric_descriptors MCP tool or a direct API call.
How are queries checked?
Generated queries are passed to scripts/validate_promql.py, which uses the promql-parser Python package, and failures are diagnosed with the error recovery reference.
Which clients can use it?
The skill follows the shared agent skills format with no client-specific tooling, so it applies to all supported agents.
How do I install Cloud monitoring promql query in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/cloud-monitoring-promql-query to use it in all your projects, or to .claude/skills/cloud-monitoring-promql-query in one project.
Does Cloud monitoring promql query run scripts?
Yes. It runs Python scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Cloud monitoring promql query?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Cloud monitoring promql query?
The closest alternatives to Cloud monitoring promql query are Cloud monitoring alert configuration, Cloud monitoring metric selection, Gke observability, Cloud run alert configuration and Cloud monitoring list time series request.
Where this comes from
- Description: from the skill's own SKILL.md.
More from google/skills

Route platform choices to Google's own skills by fetching and filtering its skill catalog
- Open source
- 24.4K GitHub stars
- Cloud and infrastructure

Guardrails for gcloud commands: validate syntax with help, scope projects, dry-run first
- Open source
- 24.4K GitHub stars
- Cloud and infrastructure

Authenticate to Google Cloud: ADC, impersonation, service accounts and IAM roles
- Open source
- 24.4K GitHub stars
- Cloud and infrastructure

First-time Google Cloud setup: sign in, pick a project, link billing, with consent gates
- Open source
- 24.4K GitHub stars
- Cloud and infrastructure

Look up Google developer docs through the Developer Knowledge MCP server or REST fallback
- Open source
- 24.4K GitHub stars
- Developer tools

Add, remove or clear audience members with the Google Data Manager API
- Open source
- 24.4K GitHub stars
- Marketing and SEO



