Cloud Monitoring Alert Configuration
GoogleOfficialPublished by Google
- Skill
- Workflow
- Cloud and DevOps
- Apache-2.0
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured workflow for defining, reviewing, and managing Cloud Monitoring alerting policies. It leverages Terraform for infrastructure-as-code and PromQL for metric conditions, ensuring consistent observability across Google Cloud resources including Cloud Run, GKE, Compute Engine, and AI Agent platforms. The skill enforces best practices like the Four Golden Signals, dynamic grouping, and proper labeling, while providing clear paths for delegating SLO-specific configurations and notification channel management.
What it does
- Generates parameterized Terraform configurations for Cloud Monitoring alert policies.
- Implements PromQL-based conditions for high-signal monitoring.
- Provides resource-specific guidance for GKE, Cloud Run, Compute Engine, and AI agents.
- Enforces standardized labeling for all generated alerting resources.
- Integrates with specialized scripts to analyze traffic patterns for AI agent telemetry.
- Delegates SLO and notification channel configuration to dedicated skills.
When to use it
- When creating or migrating Terraform-based alerting policies for Google Cloud infrastructure.
- When setting up monitoring for AI agent reliability, quality, and cost telemetry.
- When deduplicating existing alert policies to improve signal-to-noise ratios.
- When configuring alerts for latency, traffic, error rates, or saturation across cloud services.
Advantages
- Ensures consistent observability standards across diverse cloud environments.
- Reduces manual configuration errors through structured Terraform templates.
- Promotes best practices like dynamic grouping and the Four Golden Signals.
- Maintains clear separation of concerns by delegating SLO and notification tasks.
- Provides data-driven traffic analysis for accurate AI agent alert thresholds.
Usage examples
- “Create a Terraform alerting policy for high latency on my GKE service.”
- The agent will guide you through selecting the appropriate GKE PromQL queries, generate the google_monitoring_alert_policy Terraform resource, and prompt you to attach notification channels.
- “Configure a cost alert for my Vertex AI Agent based on token usage.”
- The agent will run the traffic analysis script to determine your workload pattern and generate a PromQL-based alert policy tailored to your agent's historical token consumption.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/google/cloud-monitoring-alert-configuration/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip cloud-monitoring-alert-configuration.zip -d .agents/skills
Documentation by Google
Configure Cloud Monitoring Alerts
Configure high-signal alerting policies in Cloud Monitoring using
Terraform (google_monitoring_alert_policy) and PromQL
(condition_prometheus_query_language).
Usage Attribution
For all gcloud CLI, REST API, and MCP attribution requirements when executing
commands with this skill, follow the instructions in
Usage Attribution.
Enforce Core Alerting Rules
Apply the Four Golden Signals: Cover latency, traffic, errors, and saturation for the target workload.
Use Dynamic Grouping: Aggregate metrics by resource labels and parameterize thresholds with Terraform variables. Never hardcode ephemeral pod or instance identifiers.
Default to PromQL: Use Prometheus Query Language (PromQL) for metric conditions, and use log-based alerts (
condition_matched_logorgoogle_logging_metric) for lifecycle and audit events.Attach Skill Attribution Labels: Always include
user_labelswithcreated-with-google-skill = "cloud-monitoring-alert-configuration"on every generatedgoogle_monitoring_alert_policyresource.Require User Confirmation Before Mutating Resources: Never execute commands that modify infrastructure, enable telemetry, create online monitors, or apply Terraform without waiting for explicit user confirmation.
Prompt for Notification Channels: Alerting policies without notification channels incur charges without notifying anyone during an incident. Whenever notification channels are not specified in the user prompt across any workflow, explicitly inform the user that no notification channels are attached to the alerting policies, advise them to configure and attach notification channels before deploying, and ask at the end of your response if they want to configure notification channels.
Route by Target Resource Type
Identify the target resource type and read only the matching reference file
directly. Never run directory listings or workspace file searches to look for
queries or .tf files unless the prompt
explicitly provides a file path. If a user asks to fix or validate a PromQL
query without providing the query text or a file path, construct a
representative broken-and-corrected query example directly.
Configure Cloud Run Alerts
HTTP Services: cloud_run_services.md
Batch Jobs: cloud_run_jobs.md
Worker Pools: cloud_run_worker_pools.md
Configure Google Kubernetes Engine Alerts
PromQL Queries and Golden Signals: GKE PromQL Queries
Metrics Catalog and Open-Source Alerts: GKE Metrics
Prerequisites and Setup: GKE Setup
Configure AI Agent Alerts
Reliability: Reliability
Quality: Quality
Cost: Cost
Safety: Safety
Security: Security
Telemetry Enablement: Telemetry
Traffic Profiles: Historical and No History
Configure Compute Engine and AI Hypercomputer Alerts
Compute Engine VMs, MIGs, GPU XID Insights, Host or Reservation Maintenance (
type=scheduled,unscheduled, ormultiple), and Machine or Domain Health: compute_engine_alerts.md
Configure Generic Resource Alerts
Generic Workloads, Custom Metrics, MQL Migration, and HCL Deduplication: generic_alert_policies.md
Delegate Service Level Objective Alerts
Delegate to the google-cloud-slo-alert-configuration skill. That skill
owns the SLO setup wizard, the burn-rate PromQL templates
(references/promql_templates.md), the SLI metric mapping
(references/service_metrics.md), and the App Hub scoping labels
(references/app_hub_labels.md). Do NOT duplicate those templates here or
claim that this skill owns its own SLO PromQL template library.
Delegate whenever the user asks for an availability or latency SLO, an error budget or burn-rate alert, or a Service Level Objective on any resource. When SLOs are only one part of a broader request (for example, a full production alerting suite for a Cloud Run service), delegate the SLO policies and continue generating the remaining golden-signal policies from the resource-specific reference in the same response.
Every resource reference carries a Context to hand off list naming the SLI
metric, its good or bad filter, and the grouping labels — under a ## Delegate Service Level Objective Alerts heading for Cloud Run and generic resources, and
inside the SLO section itself for GKE and Agent Platform. Read it and pass that
context on, so the SLO skill does not repeat discovery you have already done.
When delegating, you MUST also:
State the SLO target and window explicitly if the user gave them, or let the SLO skill apply its SRE defaults (99.9% over a rolling 28 days) if they did not.
Require the returned policies to carry
user_labelswithcreated-with-google-skill = "cloud-monitoring-alert-configuration"so attribution stays consistent with the rest of the generated suite. This literal value does NOT change when you delegate: the label records the entry-point skill, not whichever skill supplied the template. Do NOT setcreated-with-google-skill = "google-cloud-slo-alert-configuration"on policies generated through this delegation.Preserve the burn-rate duration contract, which
google-cloud-slo-alert-configurationdoes not specify: Fast Burn (1hand5mwindows, factor14.4) carriesduration = "300s", and Slow Burn ([3d]and[6h]lookback, factor1.0) omits thedurationfield entirely — do not emitduration = "0s"in its place. Cloud Monitoring rejects a non-zero retest buffer when the lookback window exceeds 25 hours.When no notification channels are provided, inform the user that no notification channels are attached to the alerting policies, advise them to configure and attach notification channels, and ask if they want to configure notification channels.
[!IMPORTANT] Always tell the user about the referral, even on the fallback path. Some reference files in this skill include standalone burn-rate templates to use when the
google-cloud-slo-alert-configurationskill is not installed. If you emit policies from those fallback templates, your response MUST still tell the user thatgoogle-cloud-slo-alert-configurationowns SLO configuration, state that the emitted policies use the local fallback templates, and list the handoff context. Never silently present SLO policies as if this skill owned them.
[!NOTE] Exception: Agent Platform (OpenTelemetry-instrumented AI agents on any runtime, including Vertex AI Agent Engine and Cloud Run) is the one resource whose Fast and Slow burn policies live in this skill and remain authoritative. Delegate only for SLO customization — see Reliability.
Delegate Related Observability Tasks
Notification Channels: Delegate to
cloud-monitoring-notification-channels-configurationto configure email, PagerDuty, Pub/Sub, or Slack channels. When an alerting policy has no notification channels attached, inform the user that no notification channels are attached and that they should configure notification channels and attach them to the alerting policy.PromQL Authoring: Delegate to
cloud-monitoring-promql-queryfor standalone PromQL query authoring or metric exploration.
Follow the Alert Configuration Workflow
Discover: Identify target resources, metric schemas, and scoping projects using the lookup commands in the matching reference file (such as discover_metric_schema.py for Compute Engine metrics and other Google Cloud resource metrics, or gather_agent_info.py, check_telemetry.py, analyze_traffic.py, create_online_monitor.py, list_trace_scope_table_names.py, and list_log_scope_table_names.py for AI agents).
Route: Load the reference file for the target resource type or delegate SLOs to
google-cloud-slo-alert-configuration.Generate: Produce parameterized Terraform HCL configurations with required
user_labels.Validate: When the loaded reference file requires a validation script (such as lint_promql.py, validate_config.py, lint_syntax.py, or scan_duplicates.py), run or print that exact script command. Do not list or search the
scripts/directory.Explain and Prompt: Explain each alert policy in plain English. When no notification channels are provided, tell the user that no notification channels are attached to the alerting policy, advise them to configure and attach notification channels, and ask if they want to configure notification channels.
Files
- ATTRIBUTION.mdAdded by AutoGineer890 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md11.1 KiB
- references/agent_platform_cost_alert_policies.md9.7 KiB
- references/agent_platform_has_historical_traffic_data.md5.8 KiB
- references/agent_platform_no_historical_traffic_data.md4.1 KiB
- references/agent_platform_quality_alert_policies.md12.8 KiB
- references/agent_platform_reliability_alert_policies.md28.5 KiB
- references/agent_platform_safety_alert_policies.md7.0 KiB
- references/agent_platform_security_alert_policies.md6.8 KiB
- references/agent_platform_telemetry_enablement.md2.6 KiB
- references/attribution.md1.8 KiB
- references/cloud_run_jobs.md5.3 KiB
- references/cloud_run_services.md37.8 KiB
- references/cloud_run_worker_pools.md13.7 KiB
- references/compute_engine_alerts.md40.5 KiB
- references/generic_alert_policies.md18.9 KiB
- references/kubernetes_gke_configuration_prerequisites.md13.3 KiB
- references/kubernetes_metrics_and_alerts_catalog.md22.0 KiB
- references/kubernetes_promql_queries.md18.2 KiB
- scripts/agent_platform/analyze_traffic.pyScript12.8 KiB
- scripts/agent_platform/analyze_traffic_test.pyScript7.8 KiB
- scripts/agent_platform/check_telemetry.pyScript5.8 KiB
- scripts/agent_platform/check_telemetry_test.pyScript5.4 KiB
- scripts/agent_platform/config_utils.pyScript9.4 KiB
- scripts/agent_platform/config_utils_test.pyScript10.2 KiB
- scripts/agent_platform/create_online_monitor.pyScript5.8 KiB
- scripts/agent_platform/create_online_monitor_test.pyScript5.7 KiB
- scripts/agent_platform/gather_agent_info.pyScript14.8 KiB
- scripts/agent_platform/gather_agent_info_test.pyScript11.0 KiB
- scripts/agent_platform/lint_syntax.pyScript1.9 KiB
- scripts/agent_platform/list_log_scope_table_names.pyScript4.7 KiB
- scripts/agent_platform/list_log_scope_table_names_test.pyScript8.6 KiB
- scripts/agent_platform/list_trace_scope_table_names.pyScript4.3 KiB
- scripts/agent_platform/list_trace_scope_table_names_test.pyScript6.4 KiB
- scripts/agent_platform/mock_traffic_data.pyScript100.4 KiB
- scripts/agent_platform/requirements.txt102 B
- scripts/agent_platform/scan_duplicates.pyScript3.7 KiB
- scripts/agent_platform/scan_duplicates_test.pyScript3.9 KiB
- scripts/discover_metric_schema.pyScript13.1 KiB
- scripts/discover_metric_schema_test.pyScript10.4 KiB
- scripts/kubernetes/validate_config.pyScript9.2 KiB
- scripts/lint_promql.pyScript2.5 KiB
scripts/discover_metric_schema.py
#!/usr/bin/env python3
"""Universal GCP Metric Schema Discovery & PromQL Validator for Generic Resources.
Queries the Cloud Monitoring v3 API (metricDescriptors and
monitoredResourceDescriptors) to discover exact PromQL metric names, units,
resource grouping labels, metric label keys, and documented label enum values
for any GCP service or custom workload. Optionally validates a PromQL query
against the live schema to catch metric name typos, unit scaling bugs (e.g.,
microseconds 'us' vs milliseconds 'ms'), and invalid label enum comparisons.
"""
import argparse
import json
import re
import subprocess
import sys
from typing import Any, Dict, List, Optional
import urllib.error
import urllib.parse
import urllib.request
def get_access_token() -> str:
"""Retrieves a GCP access token using ADC or gcloud auth."""
commands = [
["gcloud", "auth", "application-default", "print-access-token"],
["gcloud", "auth", "print-access-token"],
]
for cmd in commands:
try:
result = subprocess.run(
cmd,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
)
token = result.stdout.strip()
if token:
return token
except subprocess.CalledProcessError:
continue
raise RuntimeError(
"Failed to obtain GCP access token via 'gcloud auth application-default"
" print-access-token' or 'gcloud auth print-access-token'."
)
def get_default_project() -> Optional[str]:
"""Retrieves default project ID from gcloud config if not specified."""
try:
result = subprocess.run(
["gcloud", "config", "get-value", "project"],
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
)
proj = result.stdout.strip()
return proj if proj and proj != "(unset)" else None
except subprocess.CalledProcessError:
return None
def api_get(url: str, token: str) -> Dict[str, Any]:
"""Performs a GET request against the Cloud Monitoring v3 API."""
headers = {
"Authorization": f"Bearer {token}",
"User-Agent": (
"google-skills/1.0 (skill:cloud-monitoring-alert-configuration;"
" script:discover_metric_schema)"
),
}
req = urllib.request.Request(url, headers=headers)
try:
with urllib.request.urlopen(req, timeout=15) as resp:
return json.loads(resp.read().decode("utf-8"))
except urllib.error.HTTPError as e:
body = e.read().decode("utf-8", errors="replace")
raise RuntimeError(f"HTTP {e.code} from {url}: {body}") from e
def gcp_metric_to_promql(metric_type: str, value_type: str) -> str:
"""Converts a GCP metric type (<domain>/<path>) to its PromQL equivalent."""
if "/" not in metric_type:
return metric_type
domain, path = metric_type.split("/", 1)
prom_domain = domain.replace(".", "_")
prom_path = path.replace(".", "_").replace("/", "_")
prom_name = f"{prom_domain}:{prom_path}"
if value_type == "DISTRIBUTION" and not prom_name.endswith("_bucket"):
prom_name += "_bucket"
return prom_name
def promql_to_gcp_prefix(promql_metric: str) -> str:
"""Infers a GCP metric domain/prefix from a PromQL metric identifier."""
if ":" not in promql_metric:
return promql_metric
domain_part, path_part = promql_metric.split(":", 1)
# Strip distribution suffixes for lookup
for suffix in ("_bucket", "_count", "_sum"):
if path_part.endswith(suffix):
path_part = path_part[: -len(suffix)]
break
gcp_domain = domain_part.replace("_googleapis_com", ".googleapis.com")
first_segment = path_part.split("_")[0] if "_" in path_part else path_part
return f"{gcp_domain}/{first_segment}"
def format_unit_guidance(unit: str) -> str:
"""Returns clear threshold scaling guidance based on the metric unit."""
if unit == "us":
return (
"MICROSECONDS ('us') -> [!] MULTIPLY MILLISECONDS BY 1,000 (e.g., 1s ="
" 1000000, 100ms = 100000, 1ms = 1000)"
)
if unit == "ns":
return (
"NANOSECONDS ('ns') -> [!] MULTIPLY MILLISECONDS BY 1,000,000 (e.g., 1s"
" = 1000000000)"
)
if unit == "ms":
return "Milliseconds ('ms') -> (e.g., 1s = 1000)"
if unit == "s":
return "Seconds ('s') -> (e.g., 5 minutes = 300)"
if unit in ("By", "By/s"):
return f"Bytes ('{unit}') -> (1 KiB = 1024, 1 MiB = 1048576)"
if unit in ("1", "10^2.%"):
return f"Count / Ratio ('{unit}')"
return f"'{unit}'"
def extract_documented_enums(description: str) -> List[str]:
"""Extracts documented enum values from a label description string."""
# Match bracketed list e.g. ['success', 'invalid', 'internal']
bracket_match = re.search(r"\[([^\]]+)\]", description)
if bracket_match:
items = re.findall(r"['\"]([^'\"]+)['\"]", bracket_match.group(1))
if items:
return items
# Match parenthetical e.g. (e.g., 'success', 'not_found', 'unavailable')
quoted = re.findall(r"['\"]([a-zA-Z0-9_\-]+)['\"]", description)
return list(dict.fromkeys(quoted))
def fetch_resource_descriptor(
project: str, resource_type: str, token: str
) -> Optional[Dict[str, Any]]:
"""Fetches a monitoredResourceDescriptor from the Cloud Monitoring API."""
url = (
f"https://monitoring.googleapis.com/v3/projects/{project}/"
f"monitoredResourceDescriptors/{resource_type}"
)
try:
return api_get(url, token)
except RuntimeError:
return None
def fetch_metric_descriptors(
project: str,
token: str,
resource_type: Optional[str] = None,
metric_prefix: Optional[str] = None,
) -> List[Dict[str, Any]]:
"""Lists metricDescriptors matching the given resource_type or metric_prefix."""
filters = []
if resource_type:
filters.append(f'resource.type="{resource_type}"')
if metric_prefix:
if ":" in metric_prefix:
metric_prefix = promql_to_gcp_prefix(metric_prefix)
filters.append(f'metric.type=starts_with("{metric_prefix}")')
filter_str = " AND ".join(filters)
params = {"pageSize": "500"}
if filter_str:
params["filter"] = filter_str
query_string = urllib.parse.urlencode(params)
url = (
f"https://monitoring.googleapis.com/v3/projects/{project}/"
f"metricDescriptors?{query_string}"
)
data = api_get(url, token)
return data.get("metricDescriptors", [])
def validate_promql_against_schema(
promql: str, descriptors: List[Dict[str, Any]]
) -> List[str]:
"""Validates a PromQL expression against discovered metric descriptors."""
warnings: List[str] = []
by_prom_name: Dict[str, Dict[str, Any]] = {}
for d in descriptors:
mtype = d.get("type", "")
vtype = d.get("valueType", "")
pname = gcp_metric_to_promql(mtype, vtype)
by_prom_name[pname] = d
# Also register base name without _bucket
if pname.endswith("_bucket"):
by_prom_name[pname[:-7]] = d
# Find all PromQL metric names in the query
prom_metrics = re.findall(
r"\b([a-z0-9_]+_googleapis_com:[a-z0-9_]+)\b", promql
)
for pm in prom_metrics:
if pm not in by_prom_name:
suggestions = [k for k in by_prom_name if pm.split(":")[-1][:8] in k]
msg = (
f"[ERROR] PromQL metric '{pm}' does NOT exist in GCP metric"
" descriptors."
)
if suggestions:
msg += f" Did you mean: {', '.join(sorted(set(suggestions))[:5])}?"
warnings.append(msg)
continue
desc = by_prom_name[pm]
vtype = desc.get("valueType", "")
unit = desc.get("unit", "")
if vtype == "DISTRIBUTION" and not pm.endswith(
("_bucket", "_count", "_sum")
):
warnings.append(
f"[ERROR] Metric '{pm}' has valueType=DISTRIBUTION; in PromQL"
f" histogram_quantile you must query '{pm}_bucket'."
)
# Check threshold magnitude if unit is 'us' or 'ns'
if unit in ("us", "ns"):
comp_match = re.search(r"[<>]=?\s*(\d+(?:\.\d+)?)", promql)
if comp_match:
val = float(comp_match.group(1))
if 0 < val < 10000:
warnings.append(
f"[WARNING] Metric '{pm}' has unit '{unit}'"
f" (microseconds/nanoseconds), but threshold is '{val}'. If you"
" meant milliseconds/seconds, scale accordingly (e.g., 1000ms ="
" 1000000 us)."
)
# Check label matchers
valid_metric_labels = {
lbl.get("key", ""): lbl.get("description", "")
for lbl in desc.get("labels", [])
}
# Extract label filters inside { ... } following this metric
brace_match = re.search(re.escape(pm) + r"\s*\{([^}]+)\}", promql)
if brace_match:
matcher_str = brace_match.group(1)
matchers = re.findall(
r'([a-zA-Z0-9_]+)\s*(=~|!~|!=|=)\s*"([^"]*)"', matcher_str
)
for lkey, op, lval in matchers:
if lkey in ("project_id", "monitored_resource", "le", "region"):
continue
if lkey in valid_metric_labels:
enums = extract_documented_enums(valid_metric_labels[lkey])
if enums and op in ("=", "!=") and lval not in enums:
warnings.append(
f"[WARNING] Label matcher '{lkey}{op}\"{lval}\"' uses value"
f" '{lval}', but documented enum values for '{lkey}' are:"
f" {enums}. Verify casing (e.g., 'success' vs 'OK')."
)
return warnings
def main() -> None:
parser = argparse.ArgumentParser(
description=(
"Discovers GCP Metric & Monitored Resource Descriptors and validates"
" PromQL schema."
)
)
parser.add_argument(
"--project",
"-p",
type=str,
help="GCP Project ID (defaults to gcloud config project).",
)
parser.add_argument(
"--resource-type",
"-r",
type=str,
help="Monitored resource type (e.g., pubsub_topic, cloudsql_database).",
)
parser.add_argument(
"--metric-prefix",
"-m",
type=str,
help=(
"Metric type prefix or PromQL name (e.g.,"
" pubsub.googleapis.com/topic/ or pubsub_googleapis_com:topic_...)."
),
)
parser.add_argument(
"--promql",
"-q",
type=str,
help="Optional PromQL query string to validate against the schema.",
)
args = parser.parse_args()
project = args.project or get_default_project()
if not project:
print(
"Error: --project must be specified or configured via gcloud config.",
file=sys.stderr,
)
sys.exit(1)
if not args.resource_type and not args.metric_prefix and not args.promql:
parser.error(
"At least one of --resource-type (-r), --metric-prefix (-m), or"
" --promql (-q) must be specified."
)
token = get_access_token()
# Infer metric prefix from PromQL if not explicitly provided
metric_prefix = args.metric_prefix
if not metric_prefix and args.promql:
found = re.findall(
r"\b([a-z0-9_]+_googleapis_com:[a-z0-9_]+)\b", args.promql
)
if found:
metric_prefix = promql_to_gcp_prefix(found[0])
descriptors = fetch_metric_descriptors(
project=project,
token=token,
resource_type=args.resource_type,
metric_prefix=metric_prefix,
)
print("=" * 80)
print(f"GCP METRIC & RESOURCE SCHEMA DISCOVERY (Project: {project})")
print("=" * 80)
# 1. Discover Monitored Resource Labels
resource_types = set()
if args.resource_type:
resource_types.add(args.resource_type)
for d in descriptors:
for rt in d.get("monitoredResourceTypes", []):
resource_types.add(rt)
if resource_types:
print(
"\n[1] MONITORED RESOURCE TYPES & GROUPING LABELS (for 'sum by (...)')"
)
print("-" * 80)
for rt in sorted(resource_types):
rdesc = fetch_resource_descriptor(project, rt, token)
if rdesc:
rlabels = [lbl.get("key", "") for lbl in rdesc.get("labels", [])]
print(f" * Resource Type : {rt}")
print(f" Grouping Keys : {', '.join(rlabels)}")
else:
print(f" * Resource Type : {rt}")
# 2. Print Metric Descriptors Table
print(f"\n[2] DISCOVERED METRIC DESCRIPTORS ({len(descriptors)} matches)")
print("-" * 80)
for d in descriptors:
mtype = d.get("type", "")
vtype = d.get("valueType", "")
mkind = d.get("metricKind", "")
unit = d.get("unit", "1")
prom_name = gcp_metric_to_promql(mtype, vtype)
print(f" * GCP Metric Type : {mtype}")
print(f" PromQL Name : {prom_name}")
print(f" Kind / Type : {mkind} / {vtype}")
print(f" Unit Guidance : {format_unit_guidance(unit)}")
labels = d.get("labels", [])
if labels:
print(" Metric Labels :")
for lbl in labels:
lkey = lbl.get("key", "")
ldesc = lbl.get("description", "")
enums = extract_documented_enums(ldesc)
enum_str = f" [Documented Enums: {enums}]" if enums else ""
print(f" - {lkey}: {ldesc}{enum_str}")
print()
# 3. Validate PromQL Query if provided
if args.promql:
print("[3] PROMQL SCHEMA & SEMANTIC VALIDATION")
print("-" * 80)
print(f" Query: {args.promql.strip()}\n")
warnings = validate_promql_against_schema(args.promql, descriptors)
if warnings:
for w in warnings:
print(f" {w}")
sys.exit(1)
else:
print(
" [OK] PromQL metric names, units, and label matchers verified"
" against live GCP schema!"
)
print("=" * 80)
if __name__ == "__main__":
main()
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Python
Security
What our scanner noticed· Low risk
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Publisher
- Google (Official)
- Source
- google/skills · skills/cloud/cloud-monitoring-alert-configuration · commit 2194d3b
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download cloud-monitoring-alert-configuration.zip