Guide · Agent skill
How to use the Cloud Monitoring Chart Generator agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The Cloud Monitoring Chart Generator is an agent skill from the google/skills repository (skill name cloud-monitoring-chart-generation, licensed Apache-2.0). It is for engineers who manage Google Cloud Monitoring dashboards as code and want an agent to produce consistent, valid widget definitions from queries they already have. After this guide you will know what an agent skill is, how to install this one, how to ask for a chart in plain language, and what to check before deploying the output.
Quick start
- 1Download and unzip the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or your project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills in the Claude apps.
- 2Install dependencies. From your workspace root, run pip install -r scripts/requirements.txt.
- 3Gather your inputs. Have your PromQL query or ListTimeSeries filter, metric display name, resource type and unit ready. Do not edit the query text.
- 4Ask for the widget. Describe the chart in plain language and paste the query. The agent will use the skill when the request matches it.
- 5Review the generated file. Check the path reported after 'Wrote widget textproto to:', plus the title, axis label, plot type and unit.
- 6Deploy through your pipeline. Use the file with the Cloud Monitoring Dashboards API, gcloud CLI or your provisioning pipeline after a human review.
What is an agent skill and what does this one make the agent do?
An agent skill is a folder of instructions and helper scripts that an AI agent loads when a task matches the skill's description. This skill covers one job: taking an existing Cloud Monitoring query, either PromQL or a ListTimeSeries filter, and turning it into a dashboard widget definition.
The output is a Protocol Buffer text file (a textproto) describing a google.monitoring.dashboard.v1.Widget. Cloud Monitoring's dashboard tools accept this format. The agent also suggests a title, axis label, plot type and unit, using three bundled Python scripts that compute label candidates, assemble the widget file and validate it.
- Input: a PromQL query or a ListTimeSeries filter you already have, plus the metric display name, resource type and unit.
- Output: a widget textproto written to a uniquely named file, then validated.
- The skill copies your queries exactly and does not search the repository for metric data.
Install the skill from the ZIP download
Download the skill as a ZIP from this page and unzip it. For a personal setup, place the unzipped skill folder in ~/.claude/skills/. For a single project, place it in that project's .claude/skills/ folder instead.
If you use the Claude apps, you can instead upload the ZIP under Settings → Capabilities → Skills.
- Personal install: ~/.claude/skills/
- Project install: .claude/skills/ inside your project
- Claude apps: Settings → Capabilities → Skills, then upload the ZIP
Install the Python dependencies
The scripts run with python3. The skill's instructions say to install the dependencies listed in scripts/requirements.txt before running them. The requirements file notes that the core scripts use only the Python standard library, and that the file lists absl-py for the tests.
Run this from your workspace root, not from inside the skill folder.
pip install -r scripts/requirements.txtTrigger the skill with natural requests
You do not run the skill by name. Ask for a dashboard widget or chart for a query you already have, and the agent will use the skill when your request matches its description. Include the query, the metric display name, the resource type and the unit so the agent has what it needs.
The skill is not for finding metrics or writing new PromQL. For those, the source points to the separate cloud-monitoring-metric-selection and cloud-monitoring-promql-query skills.
- "Make a Cloud Monitoring dashboard widget for this PromQL query: <your query>. Metric is CPU utilization on gce_instance, unit is %."
- "Generate a widget textproto for this ListTimeSeries filter, with rate aligner and sum reducer."
- "Create a stacked area widget for this query, title it for our us-central1 VMs."
What the agent does step by step
The skill runs a three-stage pipeline. Stage 1 computes baseline label candidates with compute_labels.py. Stage 2 is the model's own step: it reviews your query and those candidates and writes a small SemanticPlotSpec with a title, y-axis label, plot type and UCUM unit. Stage 3 runs assemble_widget_proto.py, which writes the widget file.
The script prints the generated filename to standard error, prefixed with "Wrote widget textproto to:". The agent reads that path and validates the file with validate_chart.py. The skill also says the title should stay under 80 characters, and the y-axis label should not carry unit symbols such as "(%)", because the unit is applied separately.
- Stage 1: compute_labels.py generates candidate labels.
- Stage 2: the agent writes the SemanticPlotSpec.
- Stage 3: assemble_widget_proto.py writes the textproto, then validate_chart.py checks it.
python3 scripts/compute_labels.py \
--metric_display_name "METRIC_DISPLAY_NAME" \
--resource_type "RESOURCE_TYPE" \
--metric_unit "UNIT" \
--promql_query 'PROMQL_QUERY'Check the output and handle units
For ListTimeSeries queries, the skill takes the unit from Stage 1 directly. For PromQL, the agent reasons about the unit itself: rate() appends /s to the raw unit, ratios of identical units usually become %, and simple aggregations keep the original unit. The skill notes an exception for rate() inside histogram_quantile(), which keeps the raw bucket unit.
The skill does not set a legend template, so Cloud Monitoring renders its own legend at runtime. Review the title, axis label and unit before using the file anywhere that matters, since the agent chooses them.
- Rate of bytes: By becomes By/s.
- Percentage ratio: usually %.
- Plain aggregation such as sum by (...): keeps the underlying unit.
Safety notes: scripts and network
This skill runs Python scripts on your machine. The source states that it runs scripts and does not use the network. Read the scripts before you run them if your environment requires that.
The skill also tells the agent to use the gcloud attribution variable on every gcloud command it runs in the terminal, and to add an attribution User-Agent header to direct HTTP calls. Commands in generated scripts, Terraform or user code do not get it. The tag contains only the skill name and version, and the reference file warns against gcloud config set for this purpose.
- Runs scripts: yes. Uses network: no.
- Attribution tag is set inline per command, not persisted.
What people use it for
- Turning a PromQL query for VM CPU utilization into a dashboard widget file kept in version control.
- Generating widget files for ListTimeSeries filters from an existing dashboard-as-code repository.
- Producing consistent titles and units across many widgets for a team's provisioning pipeline.
- Creating stacked area widgets for distribution-style queries when requested.
Frequently asked questions
How do I install the cloud monitoring chart generation skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps you can instead upload the ZIP under Settings → Capabilities → Skills.
What do I need to run it?
You need Python 3, the packages in scripts/requirements.txt, and Google Cloud project access with the Cloud Monitoring Dashboards API, the gcloud CLI, or a dashboard provisioning pipeline to use the output. The core scripts use only the Python standard library, so the requirements file mainly matters for tests.
Is the cloud monitoring chart generator free?
The skill is licensed under Apache-2.0, as stated on this page. The source does not discuss pricing for Google Cloud or the agent platform you run it in, so check those separately.
Can this skill write new PromQL queries or find metrics?
No. The skill says not to use it for metric discovery or PromQL generation, and points to the cloud-monitoring-metric-selection or cloud-monitoring-promql-query skills for those tasks.
Does the skill need an internet connection?
The source states that it does not use the network. It does run Python scripts, so review them if your environment needs that.
Why does the agent say it found no metric data when I asked it to look up a metric?
The skill instructs the agent never to search files or the codebase for metric metadata, and to rely on the query, unit and resource type you provide in the conversation. Include those details in your request so the agent does not need to look them up.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you manage Cloud Monitoring dashboards as code and want an agent to turn queries you already have into valid, consistently formatted widget files. Pick something else if you need metric discovery, new PromQL, or generic charts outside Cloud Monitoring, and always have a person review titles and units before production deployment.
Download the skill