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://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
references/kubernetes_promql_queries.md
Write PromQL Queries for Kubernetes Alerting
This document provides best-practice PromQL queries for monitoring Kubernetes clusters and services, organized by the Golden Signals and key Cluster Health metrics.
All queries are designed to be used with Google Cloud Managed Service for
Prometheus (GMP) and can be deployed through Cloud Monitoring alerting
policies using condition_prometheus_query_language.
Table of Contents
Enforce Mandatory Kubernetes and GKE Alerting Guardrails: Lines 32-133
Alert on Latency: Lines 134-177
Query Standard Prometheus HTTP Latency Metrics: Lines 139-153
Query OpenTelemetry HTTP Latency Metrics: Lines 154-177
Alert on Traffic Rate and Outages: Lines 178-250
Query Request Rate: Lines 183-195
Detect Traffic Drops and Outages: Lines 196-250
Compare Historical Traffic Using Default Zero: Lines 207-235
Detect Missing Series Using Absent: Lines 236-250
Alert on Multi Window Multi Burn Rate SLO Errors: Lines 251-481
Configure a Fast Burn Rate Alert: Lines 315-370
Configure a Medium Burn Rate Alert: Lines 371-424
Configure a Slow Burn Rate Alert: Lines 425-481
Alert on Memory Saturation: Lines 482-522
Calculate Memory Utilization Against Limits: Lines 491-522
Monitor Cluster Health and Infrastructure: Lines 523-562
Alert on Pod CrashLooping and Container Restarts: Lines 527-547
Alert on Unready Kubernetes Nodes: Lines 548-562
Enforce Mandatory Kubernetes and GKE Alerting Guardrails
For all Kubernetes and GKE requests, read the relevant
references/kubernetes_*.md files and respond directly. Do not search the
workspace for additional files before answering. Do NOT search the codebase
for external Terraform modules or extra reference files, and do NOT write .tf
files to disk unless the user explicitly specifies a target file path. When
configuring Kubernetes alerts, you MUST:
Mandatory KSM Permission Guardrail (Tier 2
kube_*metrics): If the requested alert useskube-state-metrics (KSM)metrics (kube_deployment_*,kube_statefulset_*,kube_daemonset_*,kube_cronjob_*,kube_job_*,kube_persistentvolume_*,kube_pod_status_phase,kube_pod_container_resource_limits), you MUST NOT assume KSM is enabled or write or apply any Terraform files (see kubernetes_metrics_and_alerts_catalog.md). At the very top of your response, you MUST: (a) alert the user that the policy requireskube-state-metrics (KSM), (b) explain that KSM incurs billable Managed Service for Prometheus (GMP) sample ingestion costs (see Cloud Monitoring pricing), (c) ask the user a direct question in second-person asking for explicit permission (literally include: "Do you grant explicit permission to enable and ingest kube-state-metrics (KSM) in your cluster for this alert?" — never phrase this as a passive statement such as "ensure you have approved KSM"), and (d) recommend a filteredPodMonitoringallowlist (metricRelabelingwithaction: keep) that keeps only the required metrics (along with any conditional draft HCL clearly marked as pending approval).Tier 1 Native Metrics (Zero KSM Surcharge): For native cAdvisor, Kubelet, or Control Plane metrics (
container_memory_working_set_bytes,container_spec_memory_limit_bytes,kube_pod_container_status_restarts_total,kubernetes.io/container/restart_count,kube_node_status_condition,kubelet_volume_stats_available_bytes,apiserver_*,rest_client_*), explicitly state that the metric is a Tier 1 native/standard metric with zero KSM cost surcharge (a Tier 1 Kubelet/cAdvisor metric that does not require kube-state-metrics or a Tier 1 Control Plane metric with zero KSM cost surcharge), explain that container resource limits (resources.limits) must be defined in pod specs for saturation alerts to resolve, and provide a clear plain-English explanation of the alert and thresholds.Mandatory Terraform Variables (
project_id,cluster_name,namespace) anduser_labels: In EVERY Kubernetes Terraform HCL configuration (including cluster-wide and multi-service latency and SLO alerts), you MUST definevariable "project_id",variable "cluster_name", andvariable "namespace"blocks, interpolate all three (var.project_id,${var.cluster_name},${var.namespace}), and includeuser_labels = { "created-with-google-skill" = "cloud-monitoring-alert-configuration" }in everygoogle_monitoring_alert_policyresource:
variable "project_id" {
type = string
default = "my-gcp-project"
}
variable "cluster_name" {
type = string
default = "my-gke-cluster"
}
variable "namespace" {
type = string
default = "default"
}
variable "slo_target" {
type = number
default = 0.99
}
resource "google_monitoring_alert_policy" "k8s_alert_example" {
project = var.project_id
display_name = "[K8s] ${var.cluster_name} - Example Alert"
combiner = "OR"
conditions {
display_name = "PromQL Condition"
condition_prometheus_query_language {
query = <<-EOT
# Insert PromQL query filtering by cluster="${var.cluster_name}" and namespace="${var.namespace}"
EOT
duration = "300s"
disable_metric_validation = true
}
}
user_labels = {
"created-with-google-skill" = "cloud-monitoring-alert-configuration"
}
}Validate Kubernetes HCL and PromQL Configurations: When validating or deduplicating existing Kubernetes
.tffiles on disk, runpython3 scripts/kubernetes/validate_config.py --file <path_to_tf_file>(for a single file) orpython3 scripts/kubernetes/validate_config.py --directory <path_to_tf_dir>(to check a directory for PromQL syntax errors, missing Kubernetes resource labels, and duplicate signal targets).
Alert on Latency
Monitors the 95th percentile (P95) of HTTP request duration to detect slow responses.
Query Standard Prometheus HTTP Latency Metrics
histogram_quantile(0.95,
sum(
rate(
http_request_duration_seconds_bucket{
cluster="${var.cluster_name}",
namespace="${var.namespace}"
}[5m]
)
) by (le, service, ingress)
) > 2.0Query OpenTelemetry HTTP Latency Metrics
If your application is instrumented with OpenTelemetry, it might use
http_server_request_duration_milliseconds:
histogram_quantile(0.95,
sum(
rate(
http_server_request_duration_milliseconds_bucket{
cluster="${var.cluster_name}",
namespace="${var.namespace}"
}[5m]
)
) by (le, service)
) > 2000Threshold:
2.0seconds (or2000ms). Adjust based on latency target.Buffer: Use
duration = "300s"in the alert policy for instantaneous percentiles orduration = "0s"when multi-window smoothing is applied.
Alert on Traffic Rate and Outages
Monitors the volume of requests to detect sudden drops (indicating outage) or overload spikes.
Query Request Rate
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}"
}[5m]
)
) by (service)Detect Traffic Drops and Outages
[!WARNING] The
== 0Metric Disappearance Gotcha: When a service experiences a total traffic outage, HTTP requests stop entirely and Prometheus stops emitting thehttp_requests_totalmetric series. Evaluatingrate(...) == 0returns an empty vector (no data) rather than a0value, so the alert will fail to fire.
To reliably detect a complete traffic loss, use default 0 or
absent():
Compare Historical Traffic Using Default Zero
Fires if current 5m traffic is zero when historical traffic 1 week ago was active (> 1 QPS):
(
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}"
}[5m]
)
) by (service) default 0
) == 0
and
(
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}"
}[5m] offset 1w
)
) by (service)
) > 1Detect Missing Series Using Absent
Fires if the metric series is completely absent:
absent(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}"
}
) == 1Alert on Multi Window Multi Burn Rate SLO Errors
Monitors service reliability against defined Service Level Objectives (SLOs) using Multi-Window Multi-Burn-Rate (MWMBR) alerts.
Service availability and latency SLOs are owned by the
google-cloud-slo-alert-configuration skill. Delegate to it whenever the user
asks for an SLO, an error budget, or burn-rate alerting on a GKE service. That
skill owns the SLO wizard, the burn-rate templates
(references/promql_templates.md), the SLI mapping
(references/service_metrics.md), and the App Hub scoping labels
(references/app_hub_labels.md).
Context to hand off (so the SLO skill does not repeat discovery):
Resource type: GKE service (
prometheus_target/ App Hub service).Grouping labels:
cluster,namespace,service.Availability SLI: the request metric the workload actually emits — see the table below.
SLO target: the user's target, or
0.999(99.9%) if they did not give one.
Resolve the SLI source before delegating. GKE has no single default availability SLI — which metric exists depends on how the workload is instrumented:
| SLI source | Metric | When it applies |
|---|---|---|
| App Hub registered service | service:server_request_count | Service is registered in an App Hub application |
| OTLP or Prometheus sidecar | http_requests_total | Workload exports its own HTTP request counter |
| Istio or Anthos Service Mesh | istio_requests_total | Mesh-managed traffic |
[!IMPORTANT] If you cannot determine which of these the cluster emits, you MUST ask the user which request metric their services expose and say so explicitly in your response. Do not silently assume one.
Fallback — only if google-cloud-slo-alert-configuration is not installed:
use the burn-rate queries below, which are a complete solution on their own.
Even then, your response MUST name google-cloud-slo-alert-configuration as the
owner of SLO configuration, state that what you emitted is a local fallback, and
list the handoff context above. Never silently present SLO policies as if this
skill owned them.
[!NOTE] Why SLO Burn Rates over Simple Ratios? Simple static error ratios (such as
rate(5xx)/rate(total) > 5%) cause severe alert fatigue during low-traffic periods (where 1 error out of 2 requests = 50%) and fail to detect slow, steady error budget drains. Multi-window burn rates evaluate both a short-term window (to ensure the outage is currently active) and a long-term window (to ensure significant error budget consumption).
The threshold formula is: [ \text{Threshold} = (1 - \text{SLO_TARGET}) \times \text{BURN_RATE_FACTOR} ]
[!WARNING] Do not mix up the tiers. When you emit the standard two-policy burn-rate pair, it is Fast Burn (factor
14.4,1hand5m) plus Slow Burn (factor1.0,3dand6h). Medium Burn (factor6.0,6hand30m) is an optional third tier — never substitute it for Slow Burn and never label a6.0/6hand30mpolicy "Slow Burn".
[!IMPORTANT] Parameterize the SLO target. Generated Terraform MUST declare a
variable "slo_target"and substitute(1 - var.slo_target)(or(1 - ${var.slo_target})inside a heredoc) in every burn-rate threshold. Never hardcode the error budget in the emitted PromQL.
Configure a Fast Burn Rate Alert
Burn Rate Factor:
14.4(Consumes 2% of a 30-day error budget in 1 hour)Windows: Long window =
1h, Short window =5mDuration:
0s(the dual lookback windows already smooth transient spikes)
(
(
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}",
status=~"5.."
}[5m]
)
) by (service)
/
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}"
}[5m]
)
) by (service)
) > (1 - ${var.slo_target}) * 14.4
)
and
(
(
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}",
status=~"5.."
}[1h]
)
) by (service)
/
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}"
}[1h]
)
) by (service)
) > (1 - ${var.slo_target}) * 14.4
)Configure a Medium Burn Rate Alert
Burn Rate Factor:
6.0(Consumes 5% of error budget in 6 hours)Windows: Long window =
6h, Short window =30mDuration:
0s
(
(
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}",
status=~"5.."
}[30m]
)
) by (service)
/
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}"
}[30m]
)
) by (service)
) > (1 - ${var.slo_target}) * 6.0
)
and
(
(
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}",
status=~"5.."
}[6h]
)
) by (service)
/
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}"
}[6h]
)
) by (service)
) > (1 - ${var.slo_target}) * 6.0
)Configure a Slow Burn Rate Alert
Burn Rate Factor:
1.0(Consumes 10% of error budget in 3 days)Windows: Long window =
3d, Short window =6hDuration: Omit the
durationfield entirely (Cloud Monitoring rejects a retest buffer when the lookback window exceeds 25 hours).
(
(
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}",
status=~"5.."
}[6h]
)
) by (service)
/
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}"
}[6h]
)
) by (service)
) > (1 - ${var.slo_target}) * 1.0
)
and
(
(
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}",
status=~"5.."
}[3d]
)
) by (service)
/
sum(
rate(
http_requests_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}"
}[3d]
)
) by (service)
) > (1 - ${var.slo_target}) * 1.0
)Alert on Memory Saturation
In Kubernetes, CPU is compressible and throttled by CFS quotas rather than
causing container termination. Memory saturation, however, is uncompressible and
directly causes Out-Of-Memory (OOMKilled) pod terminations. Therefore,
Kubernetes cluster saturation alerting focuses on Memory Saturation. (CPU
saturation alerts and container_cpu_usage_seconds_total are not recommended
for cluster alert policies).
Calculate Memory Utilization Against Limits
Uses container_memory_working_set_bytes (active memory plus unevictable
caches) compared to the configured limit container_spec_memory_limit_bytes:
sum(
container_memory_working_set_bytes{
cluster="${var.cluster_name}",
namespace="${var.namespace}",
container!=""
}
) by (pod, container)
/
sum(
container_spec_memory_limit_bytes{
cluster="${var.cluster_name}",
namespace="${var.namespace}",
container!=""
}
) by (pod, container) > 0.9Cost Tier: Tier 1 Kubelet/cAdvisor metric that does not require kube-state-metrics (Zero KSM cost).
Buffer:
duration = "300s"to allow short-lived memory spikes.Prerequisite: Workload pod specs MUST configure explicit memory limits (
resources.limits.memory) or this query will returnNaNand fail to resolve.
Monitor Cluster Health and Infrastructure
Critical infrastructure alerts that impact service reliability.
Alert on Pod CrashLooping and Container Restarts
Alerts if a pod is restarting frequently, indicating crash loops (such as OOMKilled events, panics, or configuration errors).
sum(
increase(
kube_pod_container_status_restarts_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}"
}[15m]
)
) by (pod, container) > 3Duration: Set Terraform
duration = "0s"(or"60s").Crucial Rule: The
[15m]lookback window already smooths out spikes. Adding a300sduration causes a 20-minute delay before critical crashloop alerts fire.
Alert on Unready Kubernetes Nodes
Alerts if a Kubernetes node enters an unhealthy state.
kube_node_status_condition{
cluster="${var.cluster_name}",
condition="Ready",
status="true"
} == 0Trigger: When the value is
0, the node is NotReady.Buffer: Use
duration = "300s"to account for transient network blips or node drainage during GKE node pool upgrades.
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 or Google.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download cloud-monitoring-alert-configuration.zip