cloud-monitoring-list-time-series-request
Generates valid Cloud Monitoring ListTimeSeries requests and aggregation specifications from metric descriptors and resource parameters. Use when asked to create, generate, format, or build ListTimeSeries requests, JSON payloads, filter expressions, or aligner/reducer aggregations for Cloud Monitori
- 01GitHub stars
- 22.8K
- 02Installs
- New
- 03Files scanned
- 3
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 f1a8715ee8ce07cb… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
Cloud Monitoring ListTimeSeries Request Generator
Use this skill to translate any Cloud Monitoring metric descriptor into valid,
production-ready ListTimeSeries REST API query parameters (name, filter,
interval.startTime, interval.endTime, aggregation.*, view).
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:cloud-monitoring-list-time-series-request)"
and append agent-skills/1.0 (skill:cloud-monitoring-list-time-series-request) to User-Agent headers.
CRITICAL RULES
- Mandatory Project ID Clarification: You MUST ensure the GCP Project ID
is present in the user prompt, input payload, or environment context (such
as via
gcloud config get-value project). If the Project ID is missing and cannot be resolved, you MUST ask the user to clarify it before generating or executingListTimeSeriesrequests. Do NOT use placeholders for project names.
Workflow
Inspect Metric Metadata
- Use Provided Metric Metadata First: If the user's prompt already
includes metric metadata such as
metric.type,metricKind,valueType, resource types, or label keys, use those values directly instead of calling API tools. - Discover Missing Metadata: If exact metric descriptors including
metric.type,metricKind, andvalueTypeare missing or underspecified, resolve the target metric's descriptor using one of these paths:- Vague Query: If the prompt is vague, such as asking for VM CPU
usage, use the
cloud-monitoring-metric-selectionskill first to identify the specific metric type. - Known Metric Type: If you already have the specific metric type name
such as
compute.googleapis.com/instance/cpu/utilization, but need its descriptor, call thelist_metric_descriptorsMCP tool. If the tool is missing, refer to thecloud-monitoring-metric-selectionskill to configure the Cloud Monitoring MCP server. - Fallback: If the MCP tool cannot be configured, fall back to making a direct Cloud Monitoring API call.
- Vague Query: If the prompt is vague, such as asking for VM CPU
usage, use the
- Identify Key Fields: From the retrieved descriptor, identify key schema
attributes:
type: The Cloud Monitoring metric type string.metricKind:GAUGE,DELTA, orCUMULATIVE.valueType:INT64,DOUBLE,DISTRIBUTION, orBOOL.monitoredResourceTypes: Compatibleresource.typestrings, for example["cloudsql_database", "cloudsql_instance"]. If multiple resource types are listed, select the specificresource.typethat matches the target granularity of the user's request.
Construct Monitoring Filter
The filter parameter is a mandatory string in Cloud Monitoring syntax that
restricts the query to a single metric.type and optional resource and metric
labels:
-
Single Metric Type Restriction: Every
filterMUST specify exactly onemetric.typeclause using an equality operator. For example:metric.type = "compute.googleapis.com/instance/cpu/utilization"
-
Monitored Resource Type Filter: MUST include the
resource.typefilter when the target resource granularity is known, preventing collisions across services that share metric types or sub-resources. For example:metric.type = "cloudsql.googleapis.com/database/cpu/utilization" AND resource.type = "cloudsql_database"
-
Preserve User Literals and IDs: You MUST use literal resource names, IDs, zones, and project parameters provided by the user without alteration. Do NOT override or replace user-specified identifiers with active resources found during metric metadata discovery unless explicitly requested.
-
Label Type Prefixing:
- Prefix resource-level dimensions, such as instance ID, zone, project,
database ID, or subscription ID, with the
resource.labels.prefix. For example:resource.labels.instance_id = "123456789"resource.labels.database_id = "my-project:my-instance"
- Prefix metric-level dimensions, such as state, command, response code,
or instance name metadata when stored on the metric, with the
metric.labels.prefix. For example:metric.labels.state != "free"metric.labels.instance_name = "instance-1"
- Prefix resource-level dimensions, such as instance ID, zone, project,
database ID, or subscription ID, with the
-
Resource Name versus ID Resolution:
- If the user specifies a human-readable GCE VM instance name such as
"instance-1", butresource.labels.instance_idexpects a numeric ID, you MUST filter using eithermetric.labels.instance_name = "instance-1"ormetadata.system_labels.name = "instance-1". - Do NOT use
resource.metadata.nameorresource.metadata.*. This prefix is invalid in Cloud Monitoring filter syntax. - Do NOT assign a string instance name directly to
resource.labels.instance_idunless the resource type explicitly uses string IDs.
- If the user specifies a human-readable GCE VM instance name such as
-
Database Identifier Labels: Database labels such as
database_idfor Cloud SQL and Spanner, ordataset_idfor BigQuery, use composite keys formatted as<project_id>:<instance_name>. For example:resource.labels.database_id = "my-project:foo". -
Ops Agent Metrics State Label Filtering: For
agent.googleapis.com/memory/percent_usedandagent.googleapis.com/disk/percent_usedmetrics, you MUST usemetric.labels.state != "free". Do NOT filter bymetric.labels.state = "used".
Choose Aggregation Structure
Select the perSeriesAligner, crossSeriesReducer, groupByFields, and
alignmentPeriod according to the metric properties and visualization goal:
- Consult the Aggregations Reference: You MUST include both
perSeriesAlignerandcrossSeriesReducerin theaggregationquery parameters of every request. Read and follow the Cloud Monitoring ListTimeSeries Basic Aggregations Reference to select the exactperSeriesAlignerandcrossSeriesReducercombinations for your metric's Metric Kind and Value Type pairing, and to apply mandatory SRE rules for utilization metrics, counters, distributions, and state-based gauges such as memory filtered bystate != "free". - Grouping Fields and Resource Granularity: When
crossSeriesReduceris specified as anything other thanREDUCE_NONE, list the exact labels to preserve. When querying multi-instance resources like VMs, databases, or subscriptions, include the primary resource identifier ingroupByFields. For example, useresource.labels.instance_idfor VMs orresource.labels.database_idfor databases. This prevents collapsing separate resource streams into a single global aggregate. - Alignment Period Determination: Calculate the query lookback duration
from
endTimeminusstartTime, ensuringstartTimeprecedesendTime. IfendTime <= startTime, flag an error before computing duration. SetalignmentPeriodaccording to Cloud Console default fine granularity standards:- Duration <= 110 minutes: Set
alignmentPeriod = "60s". - Duration <= 23 hours: Set
alignmentPeriod = "300s". - Duration <= 6 days: Set
alignmentPeriod = "3600s". - Duration <= 23 days: Set
alignmentPeriod = "10800s". - Duration <= 80 days: Set
alignmentPeriod = "21600s". - Duration <= 180 days: Set
alignmentPeriod = "43200s". - Duration <= 350 days: Set
alignmentPeriod = "86400s". - Duration <= 500 days: Set
alignmentPeriod = "172800s". - Omission Rule:
alignmentPeriodis omitted only whenperSeriesAligneris set toALIGN_NONE.
- Duration <= 110 minutes: Set
Format Valid Request
Present the generated ListTimeSeries REST query parameters. For example:
{
"name": "projects/<project_id>",
"filter": "metric.type = \"<metric_type>\" AND resource.type = \"<resource_type>\"",
"interval": {
"startTime": "<iso_8601_start>",
"endTime": "<iso_8601_end>"
},
"aggregation": {
"alignmentPeriod": "60s",
"perSeriesAligner": "ALIGN_RATE",
"crossSeriesReducer": "REDUCE_SUM",
"groupByFields": [
"resource.labels.zone"
]
},
"view": "FULL"
}
- Aggregation Requirements: Populate the
aggregationparameters with theperSeriesAligner,crossSeriesReducer,alignmentPeriod, and optionalgroupByFieldsvalues determined during aggregation selection. - Interval Requirements:
startTimeandendTimeMUST be valid RFC 3339 and ISO 8601 timestamps such as"YYYY-MM-DDTHH:MM:SSZ". If not explicitly provided by the user, dynamically compute a one-hour lookback interval ending at the current time, whereendTimeis the present moment andstartTimeis one hour prior. Do NOT hardcode static dates from examples. - Alignment Period Requirement: Determine
alignmentPeriodfrom the lookback duration ofendTimeminusstartTimeusing the mapping above. For the default one-hour lookback interval,alignmentPeriodis"60s". - View Requirement: MUST default to
"FULL"when time series data points are needed, or"HEADERS"when inspecting metadata and series identities only.
Validate Request via list_timeseries MCP Tool
You MUST validate the generated request parameters against live Cloud Monitoring
telemetry before returning the final output. Call the list_timeseries MCP tool
passing all generated query parameters (name, filter, interval,
aggregation). When validating you MUST set view="HEADERS" to minimize
latency and payload size while verifying request structure. A response without
API errors confirms that your filter and aggregation settings are valid.
If the list_timeseries tool is unavailable, fall back to a direct API call.
References
Files
3- SKILL.md
2386179b3811.4 KB - references/attribution.md
a521434f801.9 KB - references/basic_aggregations.md
f9a641911410.4 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from google/skills8
Audits AI agent data access, blast radius, and blocked policy operations in Google Cloud by querying Cloud Audit Logs via BigQuery. Use when investigating what resources or services an agent accessed, identifying top originating principals the agent is acting as, or triaging PERMISSION_DENIED errors
Manages Google Cloud Agent Registry (agentregistry.googleapis.com) resources using gcloud CLI and Kubernetes manifests, including agents, MCP servers, endpoints, services, bindings, AI applications, skills and skill revisions, resource-level IAM policies, Cloud Run and GKE automatic workload registr
Configures best-practice alerting policies for AI agents using OpenTelemetry (OTel) metrics, generating output as Terraform (.tf) configuration files. Use when analyzing, writing, or deploying alerting policies to monitor agent latency, error rates, token usage, and quality metrics. Don't use for st
Designs, engineers, and validates enterprise Gemini platform architectures. Use when designing multi-project hierarchies (Host, Central Governance Hub, Runtime Spoke, Tool/MCP Spoke), configuring Agent Gateway, authoring Agent Connectivity Templates (ALL_TRAFFIC vs PRIVATE_RANGES_ONLY), deploying Se
Customizes an autorater (evaluation metric) for an AI agent so its grades match the user's own judgment, starting from the agent's real trajectories. Use when a user wants a metric tailored to their agent, wants to turn failing trajectories into rubrics, says an existing autorater grades their agent
Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up resources by undeploying models and deleting endpoints. Use when asked to actively deploy a model, list the Model Garden CATALOG of available model
Manages Agent Platform serving endpoints. Use when you need to create, list, describe, update, or delete serving endpoints for model deployment on Agent Platform. Also use when troubleshooting endpoint permission, quota, or resource busy errors. Don't use for deploying models to endpoints or for run
Measures and improves the quality of AI models and agents on Google Cloud using the Eval Quality Flywheel methodology. Use when generating synthetic user scenarios, evaluating an agent or model, building an eval dataset, picking or writing evaluation metrics, analyzing failures, comparing results be
Related devops skillsscan passed
Deploy and configure web frameworks on Netlify — build settings and SSR/edge adapters plus local platform emulation and env vars. Use when setting up or fixing a framework deploy (Next.js / Astro / Nuxt / SvelteKit / Remix / React Router / TanStack Start / SolidStart / Gatsby / Angular / Vite / Expr
Post-deploy canary monitoring. Use for: monitor after deploy, canary check. (gstack)
Build, migrate, and deploy Next.js apps on Cloudflare Workers with vinext. Use when starting a Next.js project on Cloudflare, moving an existing app to Workers, choosing between vinext and OpenNext, or setting up vinext for Workers. For setup, migration, or deployment, install vinext's upstream skil
Use this skill when choosing or configuring NeMo Relay 0.6 or 0.7 observability through the built-in plugin, subscribers, or exporters, including raw ATOF events, ATIF trajectories, OpenTelemetry, OpenInference, or custom event handling.
Integrates an AI agent with Amazon OpenSearch Memory (OpenSearch Memory, CLI `aws opensearchmemory`, IAM prefix `osm:`), a managed service that stores conversation events and extracts long-term memories from them. Use only when the user names OpenSearch Memory, an OpenSearch Memory space, or `aws op