Agent skill · google

cloud-monitoring-promql-query

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.

What it needs

About 5k tokens when loaded.

What this skill does

Cloud Monitoring PromQL Generator Use this skill to generate a valid PromQL query from any Cloud Monitoring metric type. This guide applies to all Cloud Monitoring metric types by mapping Cloud Monitoring metric and resource descriptors to PromQL structures. Workflow Resolve Project ID (CRITICAL & BLOCKING) Before performing any other actions (such as searching code, reading references, or running validation), you MUST verify whether the Google Cloud Project ID is available: 1. Check Prompt/Payload: Look for the Project ID in the user's prompt or input. 2. Check Environment: If the Project ID is not present in the prompt, you MUST run gcloud config get-value project to attempt to resolve it from the environment. 3. Ask for Clarification (BLOCKING): If the Project ID is not in the prompt AND the gcloud command fails, returns an empty string, or is unavailable, you MUST immediately stop. Do NOT generate a PromQL query, do not run the validation script, and do not use placeholders (like YOURPROJECTID). You must refuse to proceed and ask the user to provide the Project ID. Inspect Metric and Resource Descriptors 1. Use Provided Descriptors First: If the user's prompt already includes metric descriptor details (such as metric.type, metricKind, valueType, or monitoredResourceTypes) or specific resource filter values, use those values directly instead of calling the Cloud Monitoring API. 2. Discover Missing Descriptors: If exact metric descriptors (metric.type, metricKind, valueType) are missing or underspecified, resolve the target metric type's descriptor using one of these paths: Vague Query: If the prompt is vague (for example, "VM CPU usage"), use the cloud-monitoring-metric-selection skill first to identify the specific metric type. Known Metric Type: If you already have the specific metric type name (for example, compute.googleapis.com/instance/cpu/utilization) but need its descriptor, call the google-cloud-monitoring:listmetricdescriptors MCP tool. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills google/cloud-monitoring-promql-query

View the source on GitHub

Browse the @skills marketplace