Generated banner for Cloud Monitoring Alert Configuration
Generated logo for Cloud Monitoring Alert Configuration

Cloud Monitoring Alert Configuration

GoogleOfficialPublished by Google

  • Skill
  • Workflow
  • Cloud and DevOps
  • Apache-2.0
  • Low risk
  • Has scripts

From the author

Configures Cloud Monitoring alerting policies using Terraform and PromQL across Cloud Run, Google Kubernetes Engine (GKE), Compute Engine, AI Hypercomputer reservations, Vertex AI Agent Engine, and generic Google Cloud resources. Use when creating, reviewing, migrating, or deduplicating Terraform alerting policies for latency, traffic, error rates, saturation, host or reservation maintenance, GPU XID insights, or AI agent telemetry. Don't use for standalone PromQL query authoring without alerting, log querying, or billing cost audits.
— the description by Google

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

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/google/cloud-monitoring-alert-configuration/download
  2. Unzip 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

  1. Apply the Four Golden Signals: Cover latency, traffic, errors, and saturation for the target workload.

  2. Use Dynamic Grouping: Aggregate metrics by resource labels and parameterize thresholds with Terraform variables. Never hardcode ephemeral pod or instance identifiers.

  3. Default to PromQL: Use Prometheus Query Language (PromQL) for metric conditions, and use log-based alerts (condition_matched_log or google_logging_metric) for lifecycle and audit events.

  4. Attach Skill Attribution Labels: Always include user_labels with created-with-google-skill = "cloud-monitoring-alert-configuration" on every generated google_monitoring_alert_policy resource.

  5. 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.

  6. 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
Configure Google Kubernetes Engine Alerts
Configure AI Agent Alerts
Configure Compute Engine and AI Hypercomputer Alerts
  • Compute Engine VMs, MIGs, GPU XID Insights, Host or Reservation Maintenance (type=scheduled, unscheduled, or multiple), and Machine or Domain Health: compute_engine_alerts.md

Configure Generic Resource Alerts
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:

  1. 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.

  2. Require the returned policies to carry user_labels with created-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 set created-with-google-skill = "google-cloud-slo-alert-configuration" on policies generated through this delegation.

  3. Preserve the burn-rate duration contract, which google-cloud-slo-alert-configuration does not specify: Fast Burn (1h and 5m windows, factor 14.4) carries duration = "300s", and Slow Burn ([3d] and [6h] lookback, factor 1.0) omits the duration field entirely — do not emit duration = "0s" in its place. Cloud Monitoring rejects a non-zero retest buffer when the lookback window exceeds 25 hours.

  4. 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-configuration skill is not installed. If you emit policies from those fallback templates, your response MUST still tell the user that google-cloud-slo-alert-configuration owns 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.

  • Notification Channels: Delegate to cloud-monitoring-notification-channels-configuration to 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-query for standalone PromQL query authoring or metric exploration.

Follow the Alert Configuration Workflow

  1. 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).

  2. Route: Load the reference file for the target resource type or delegate SLOs to google-cloud-slo-alert-configuration.

  3. Generate: Produce parameterized Terraform HCL configurations with required user_labels.

  4. 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.

  5. 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

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:

  1. Mandatory KSM Permission Guardrail (Tier 2 kube_* metrics): If the requested alert uses kube-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 requires kube-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 filtered PodMonitoring allowlist (metricRelabeling with action: keep) that keeps only the required metrics (along with any conditional draft HCL clearly marked as pending approval).

  2. 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.

  3. Mandatory Terraform Variables (project_id, cluster_name, namespace) and user_labels: In EVERY Kubernetes Terraform HCL configuration (including cluster-wide and multi-service latency and SLO alerts), you MUST define variable "project_id", variable "cluster_name", and variable "namespace" blocks, interpolate all three (var.project_id, ${var.cluster_name}, ${var.namespace}), and include user_labels = { "created-with-google-skill" = "cloud-monitoring-alert-configuration" } in every google_monitoring_alert_policy resource:

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"
  }
}
  1. Validate Kubernetes HCL and PromQL Configurations: When validating or deduplicating existing Kubernetes .tf files on disk, run python3 scripts/kubernetes/validate_config.py --file <path_to_tf_file> (for a single file) or python3 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.0
Query 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)
) > 2000
  • Threshold: 2.0 seconds (or 2000 ms). Adjust based on latency target.

  • Buffer: Use duration = "300s" in the alert policy for instantaneous percentiles or duration = "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 == 0 Metric Disappearance Gotcha: When a service experiences a total traffic outage, HTTP requests stop entirely and Prometheus stops emitting the http_requests_total metric series. Evaluating rate(...) == 0 returns an empty vector (no data) rather than a 0 value, 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)
) > 1
Detect Missing Series Using Absent

Fires if the metric series is completely absent:

absent(
  http_requests_total{
    cluster="${var.cluster_name}",
    namespace="${var.namespace}"
  }
) == 1

Alert 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 sourceMetricWhen it applies
App Hub registered serviceservice:server_request_countService is registered in an App Hub application
OTLP or Prometheus sidecarhttp_requests_totalWorkload exports its own HTTP request counter
Istio or Anthos Service Meshistio_requests_totalMesh-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, 1h and 5m) plus Slow Burn (factor 1.0, 3d and 6h). Medium Burn (factor 6.0, 6h and 30m) is an optional third tier — never substitute it for Slow Burn and never label a 6.0 / 6h and 30m policy "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 = 5m

  • Duration: 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 = 30m

  • Duration: 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 = 6h

  • Duration: Omit the duration field 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.9
  • Cost 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 return NaN and 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) > 3
  • Duration: Set Terraform duration = "0s" (or "60s").

    • Crucial Rule: The [15m] lookback window already smooths out spikes. Adding a 300s duration 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"
} == 0
  • Trigger: 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
Google
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