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
references/kubernetes_metrics_and_alerts_catalog.md
Select GKE Metrics and Kubernetes Alerting Policies
This catalog compiles public Google Kubernetes Engine (GKE) telemetry metrics from Google Cloud Kubernetes Metrics and critical alerting rules from the open-source Awesome Prometheus Alerts for Kubernetes catalog.
It serves as the reference catalog for the cloud-monitoring-alert-configuration
skill when generating evaluation suites and production alerting policies in
Google Cloud Managed Service for Prometheus (GMP) and Cloud Monitoring.
Table of Contents
Enforce Kubernetes and GKE Telemetry Guardrails: Lines 37-138
Classify Telemetry Tiers and Optimize Ingestion Costs: Lines 102-138
Filter Tier 2 Metrics with a PodMonitoring Allowlist: Lines 112-138
Query Native GKE System Metrics: Lines 139-189
Monitor Container and Pod Core Metrics: Lines 144-163
Monitor Node and Infrastructure Core Metrics: Lines 164-177
Monitor Autoscaling and Hardware Accelerator Metrics: Lines 178-189
Map Open Source Kubernetes Alert Rules: Lines 190-241
Configure Node Health and Capacity Alerts: Lines 194-204
Configure Workload and Container Reliability Alerts: Lines 205-219
Configure Job CronJob and Storage Alerts: Lines 220-230
Configure API Server and Control Plane Alerts: Lines 231-241
Implement Non KSM Native Alternative Alerts: Lines 242-350
Alert on Container Memory Saturation and OOM Risk: Lines 248-277
Alert on Pod CrashLoopBackOff and Container Restarts: Lines 278-297
Alert on Node Readiness and Health: Lines 298-307
Alert on Multi Window Multi Burn Rate SLO Error Rates: Lines 308-340
Detect Traffic Outages: Lines 341-350
Enforce Kubernetes and GKE Telemetry Guardrails
For all Kubernetes and GKE requests, read the 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.
Mandatory KSM Permission Guardrail (Tier 2
kube_*metrics): In Google Cloud Managed Service for Prometheus (GMP), billing is based on samples ingested. Deploying open-sourcekube-state-metrics (KSM)unmodified scrapes state for every object across the cluster, generating high time-series volume and significant ingestion cost. If the requested alert uses 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. At the very top of your response, you MUST:(a) Alert the user that the policy requires
kube-state-metrics (KSM).(b) Explain the GMP cost impact: Explain that KSM incurs billable Managed Service for Prometheus (GMP) sample ingestion costs (see Cloud Monitoring pricing).
(c) Ask a direct question in second-person for explicit permission (literally include this exact question in bold): "Do you grant explicit permission to enable and ingest kube-state-metrics (KSM) in your cluster for this alert?" (Critical: Never phrase this as a passive statement such as "ensure you have approved KSM" or "before enabling KSM, review below" — always ask the user directly with a question mark!)
(d) Recommend a filtered
PodMonitoringallowlist (metricRelabelingwithaction: keep) that keeps only the required metrics (along with any conditional draft HCL clearly marked as pending approval), and offer Non-KSM Native Alternatives where possible.
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 multi-service latency and SLO burn-rate 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.
flowchart TD
A["User Request for Alert Policy"] --> B{"Can alert use Native GKE or cAdvisor?"}
B -->|Yes - Tier 1| C["Use Native GKE or cAdvisor Metric (Zero KSM Surcharge)"]
B -->|No - Requires KSM| D["Alert User on KSM Cost and Ask Explicit Permission Question"]
D --> E{"User Approved KSM?"}
E -->|No or Pending| F["Do NOT Write Files to Disk; Show Filtered PodMonitoring Allowlist and Conditional Preview Only"]
E -->|Yes - Tier 2| G["Generate KSM Alert Policy and Recommend Filtered PodMonitoring Allowlist"]Classify Telemetry Tiers and Optimize Ingestion Costs
Tier 1: Native GKE Built-ins and cAdvisor (Zero KSM Cost): Metrics collected natively by GKE, Kubelet/cAdvisor, or Control Plane without
kube-state-metrics(zero KSM cost surcharge).Tier 2: Filtered KSM (Requires Explicit Consent Question and Allowlist): Rules requiring Kubernetes control-plane state (such as Deployment, StatefulSet, DaemonSet, CronJob, Job, PersistentVolume, or Pod phase metrics) that require
kube-state-metrics.
Filter Tier 2 Metrics with a PodMonitoring Allowlist
When a Tier 2 (KSM) alert is requested, ALWAYS ask the user for explicit
permission first and provide a filtered PodMonitoring resource (to be used if
KSM is approved) that scrapes only the required metrics and drops all others:
apiVersion: monitoring.googleapis.com/v1
kind: PodMonitoring
metadata:
name: kube-state-metrics-filtered
namespace: kube-system
spec:
selector:
matchLabels:
app.kubernetes.io/name: kube-state-metrics
endpoints:
- port: http-metrics
interval: 30s
metricRelabeling:
- action: keep
sourceLabels: [__name__]
regex: "^(kube_deployment_spec_replicas|kube_deployment_status_replicas_available|kube_statefulset_status_replicas_ready|kube_statefulset_status_replicas)$"Query Native GKE System Metrics
Below are the public native GKE telemetry metrics (kubernetes.io/) available
in Cloud Monitoring.
Monitor Container and Pod Core Metrics
| Metric Path | Unit | Description | Cost Tier |
|---|---|---|---|
kubernetes.io/container/cpu/core_usage_time | s | Cumulative CPU time consumed by the container. | Tier 1 (Native) |
kubernetes.io/container/cpu/limit_cores | 1 | CPU core limit configured for the container. | Tier 1 (Native) |
kubernetes.io/container/cpu/request_cores | 1 | CPU core request configured for the container. | Tier 1 (Native) |
kubernetes.io/container/memory/used_bytes | By | Total memory currently used by the container. | Tier 1 (Native) |
kubernetes.io/container/memory/limit_bytes | By | Memory limit configured for the container. | Tier 1 (Native) |
kubernetes.io/container/memory/request_bytes | By | Memory request configured for the container. | Tier 1 (Native) |
kubernetes.io/container/memory/page_fault_count | 1 | Cumulative count of memory page faults. | Tier 1 (Native) |
kubernetes.io/container/restart_count | 1 | Number of times the container has restarted. | Tier 1 (Native) |
kubernetes.io/container/uptime | s | Duration the container has been running. | Tier 1 (Native) |
kubernetes.io/container/ephemeral_storage/used_bytes | By | Local ephemeral storage used by container. | Tier 1 (Native) |
kubernetes.io/container/ephemeral_storage/limit_bytes | By | Ephemeral storage limit for container. | Tier 1 (Native) |
kubernetes.io/pod/network/received_bytes_count | By | Cumulative bytes received by pod network interface. | Tier 1 (Native) |
kubernetes.io/pod/network/sent_bytes_count | By | Cumulative bytes sent by pod network interface. | Tier 1 (Native) |
kubernetes.io/pod/volume/used_bytes | By | Persistent volume storage used by pod. | Tier 1 (Native) |
kubernetes.io/pod/volume/total_bytes | By | Total persistent volume storage capacity. | Tier 1 (Native) |
Monitor Node and Infrastructure Core Metrics
| Metric Path | Unit | Description | Cost Tier |
|---|---|---|---|
kubernetes.io/node/cpu/allocatable_cores | 1 | Total allocatable CPU cores on the node. | Tier 1 (Native) |
kubernetes.io/node/cpu/total_cores | 1 | Total physical CPU cores on the node. | Tier 1 (Native) |
kubernetes.io/node/cpu/core_usage_time | s | Cumulative CPU core seconds used across node. | Tier 1 (Native) |
kubernetes.io/node/memory/allocatable_bytes | By | Total allocatable memory on the node. | Tier 1 (Native) |
kubernetes.io/node/memory/used_bytes | By | Total memory currently used on the node. | Tier 1 (Native) |
kubernetes.io/node/status | 1 | Current operational status of the node. | Tier 1 (Native) |
kubernetes.io/node/status_condition | 1 | Condition status (Ready, MemoryPressure, DiskPressure). | Tier 1 (Native) |
kubernetes.io/node/ephemeral_storage/used_bytes | By | Ephemeral storage bytes used on node filesystem. | Tier 1 (Native) |
kubernetes.io/node/pid_used / pid_limit | 1 | PIDs used compared to maximum PID limit on node. | Tier 1 (Native) |
Monitor Autoscaling and Hardware Accelerator Metrics
| Metric Path | Unit | Description | Cost Tier |
|---|---|---|---|
kubernetes.io/autoscaler/container/cpu/per_replica_recommended_request_cores | 1 | VPA recommended CPU request per replica. | Tier 1 (Native) |
kubernetes.io/autoscaler/container/memory/per_replica_recommended_request_bytes | By | VPA recommended memory request per replica. | Tier 1 (Native) |
kubernetes.io/autoscaler/recommenders/horizontal/target_value | 1 | HPA target metric value for autoscaling. | Tier 1 (Native) |
kubernetes.io/container/accelerator/duty_cycle | % | GPU/TPU accelerator execution duty cycle. | Tier 1 (Native) |
kubernetes.io/container/accelerator/memory_used | By | GPU/TPU accelerator memory allocated. | Tier 1 (Native) |
Map Open Source Kubernetes Alert Rules
Compiled from the open-source awesome-prometheus-alerts community catalog.
Configure Node Health and Capacity Alerts
| Alert Name | Open Source PromQL Rule | Severity | KSM Required? | Non-KSM Native Alternative Available? |
|---|---|---|---|---|
| Kubernetes Node not ready | kube_node_status_condition{condition="Ready",status="true"} == 0 | Critical | No (Standard) | Yes (Tier 1 PromQL / native node status) |
| Kubernetes Node scheduling disabled | kube_node_spec_taint{key="node.kubernetes.io/unschedulable"} == 1 | Warning | No (Standard) | Yes |
| Kubernetes Node memory pressure | kube_node_status_condition{condition="MemoryPressure",status="true"} == 1 | Critical | No (Standard) | Yes |
| Kubernetes Node disk pressure | kube_node_status_condition{condition="DiskPressure",status="true"} == 1 | Critical | No (Standard) | Yes |
| Kubernetes Node network unavailable | kube_node_status_condition{condition="NetworkUnavailable",status="true"} == 1 | Critical | No (Standard) | Yes |
| Kubernetes Node out of pod capacity | sum by (node) ((kube_pod_status_phase{phase="Running"} == 1) + on(uid, instance) group_left(node) (0 * kube_pod_info{pod_template_hash=""})) / sum by (node) (kube_node_status_allocatable{resource="pods"}) * 100 > 90 | Warning | Yes (KSM) | Yes (Approximate using cAdvisor pod count) |
Configure Workload and Container Reliability Alerts
| Alert Name | Open Source PromQL Rule | Severity | KSM Required? | Non-KSM Native Alternative Available? |
|---|---|---|---|---|
| Kubernetes Pod crash looping | increase(kube_pod_container_status_restarts_total[15m]) > 3 | Warning | No (cAdvisor) | Yes (kubernetes.io/container/restart_count) |
| Kubernetes Pod not healthy | sum by (namespace, pod) (kube_pod_status_phase{phase=~"Pending|Unknown|Failed"}) > 0 | Critical | Yes (KSM) | Partial (Native pod availability metrics) |
| Kubernetes Container OOMKiller | (kube_pod_container_status_restarts_total - kube_pod_container_status_restarts_total offset 10m >= 1) and ignoring (reason) min_over_time(kube_pod_container_status_last_terminated_reason{reason="OOMKilled"}[10m]) == 1 | Warning | Yes (KSM) | Yes (Memory usage > 95% of container limit) |
| Kubernetes Deployment replicas mismatch | kube_deployment_spec_replicas != kube_deployment_status_replicas_available | Warning | Yes (KSM) | No exact match without KSM (Control Plane state) |
| Kubernetes StatefulSet replicas mismatch | kube_statefulset_status_replicas_ready != kube_statefulset_status_replicas | Warning | Yes (KSM) | No exact match without KSM |
| Kubernetes StatefulSet down | kube_statefulset_replicas != kube_statefulset_status_replicas_ready > 0 | Critical | Yes (KSM) | No exact match without KSM |
| Kubernetes Deployment generation mismatch | kube_deployment_status_observed_generation != kube_deployment_metadata_generation | Critical | Yes (KSM) | Requires KSM |
| Kubernetes StatefulSet update not rolled out | max without (revision) (kube_statefulset_status_current_revision unless kube_statefulset_status_update_revision) * (kube_statefulset_replicas != kube_statefulset_status_replicas_updated) | Warning | Yes (KSM) | Requires KSM |
| Kubernetes DaemonSet rollout stuck | (kube_daemonset_status_number_ready / kube_daemonset_status_desired_number_scheduled * 100 < 100) or (kube_daemonset_status_desired_number_scheduled - kube_daemonset_status_current_number_scheduled > 0) | Warning | Yes (KSM) | Requires KSM |
| Kubernetes DaemonSet misscheduled | kube_daemonset_status_number_misscheduled > 0 | Critical | Yes (KSM) | Requires KSM |
Configure Job CronJob and Storage Alerts
| Alert Name | Open Source PromQL Rule | Severity | KSM Required? | Non-KSM Native Alternative Available? |
|---|---|---|---|---|
| Kubernetes Job failed | kube_job_status_failed > 0 | Warning | Yes (KSM) | Requires KSM |
| Kubernetes Job not starting | kube_job_status_active == 0 and kube_job_status_failed == 0 and kube_job_status_succeeded == 0 and (time() - kube_job_status_start_time) > 600 | Warning | Yes (KSM) | Requires KSM |
| Kubernetes CronJob failing | (kube_cronjob_status_last_schedule_time > kube_cronjob_status_last_successful_time) AND (kube_cronjob_status_active == 0) AND (kube_cronjob_spec_suspend == 0) | Critical | Yes (KSM) | Requires KSM |
| Kubernetes Volume out of disk space | kubelet_volume_stats_available_bytes / kubelet_volume_stats_capacity_bytes * 100 < 10 and kubelet_volume_stats_capacity_bytes > 0 | Warning | No (Kubelet) | Yes (kubernetes.io/pod/volume/used_bytes) |
| Kubernetes Volume full in four days | predict_linear(kubelet_volume_stats_available_bytes[6h:5m], 4 * 24 * 3600) < 0 | Critical | No (Kubelet) | Yes |
| Kubernetes PersistentVolume error | kube_persistentvolume_status_phase{phase=~"Failed|Pending"} > 0 | Critical | Yes (KSM) | Requires KSM |
Configure API Server and Control Plane Alerts
| Alert Name | Open Source PromQL Rule | Severity | KSM Required? | Non-KSM Native Alternative Available? |
|---|---|---|---|---|
| Kubernetes API server errors | sum(rate(apiserver_request_total{job="apiserver",code=~"(?:5..)"}[1m])) by (instance, job) / sum(rate(apiserver_request_total{job="apiserver"}[1m])) by (instance, job) * 100 > 3 and sum(rate(apiserver_request_total{job="apiserver"}[1m])) by (instance, job) > 0 | Critical | No | Yes (Native Control Plane PromQL) |
| Kubernetes API client errors | (sum(rate(rest_client_requests_total{code=~"(4|5).."}[1m])) by (instance, job) / sum(rate(rest_client_requests_total[1m])) by (instance, job)) * 100 > 1 and sum(rate(rest_client_requests_total[1m])) by (instance, job) > 0 | Critical | No | Yes (Native Control Plane PromQL) |
| Kubernetes client certificate expires soon | apiserver_client_certificate_expiration_seconds_count{job="apiserver"} > 0 and histogram_quantile(0.01, sum by (job, le) (rate(apiserver_client_certificate_expiration_seconds_bucket{job="apiserver"}[5m]))) < 24*60*60 | Critical | No | Yes (Native Control Plane PromQL) |
| Kubernetes API server latency | histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{verb!~"(?:CONNECT|WATCHLIST|WATCH|PROXY)"}[10m])) WITHOUT (subresource)) > 1 | Warning | No | Yes (Native Control Plane PromQL) |
Implement Non KSM Native Alternative Alerts
When a user requests open-source catalog alerts that normally rely on
kube-state-metrics, first offer these Tier 1 (Non-KSM) equivalents to
avoid customer ingestion costs:
Alert on Container Memory Saturation and OOM Risk
Instead of container_memory_working_set_bytes / kube_pod_container_resource_limits, use native cAdvisor limits:
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!=""
}
) > 0.90[!NOTE] Memory Compared to CPU Saturation: In Kubernetes, CPU is compressible and throttled by the CFS scheduler without killing containers. Memory is uncompressible and triggers fatal OOMKilled events. Therefore, cluster saturation alerting focuses on Memory Saturation, and CPU saturation alerts (and
container_cpu_usage_seconds_total) are excluded from the recommended cluster alert suite.
Alert on Pod CrashLoopBackOff and Container Restarts
Use native GKE Cloud Monitoring metric kubernetes.io/container/restart_count
or the cAdvisor restart counter:
sum(
increase(
kube_pod_container_status_restarts_total{
cluster="${var.cluster_name}",
namespace="${var.namespace}"
}[15m]
)
) by (pod, container) > 3Duration Rule: Set Terraform
duration = "0s"(or"60s"). The[15m]lookback window already smooths transient spikes; addingduration = "300s"delays critical crashloop alerts by 20 minutes total.
Alert on Node Readiness and Health
kube_node_status_condition{
cluster="${var.cluster_name}",
condition="Ready",
status="true"
} == 0Alert on Multi Window Multi Burn Rate SLO Error Rates
For service error rate monitoring, use multi-window burn rate alerts instead of simple static ratios:
[!IMPORTANT] Service availability and latency SLOs are owned by the
google-cloud-slo-alert-configurationskill. Delegate to it whenever the user asks for an SLO, an error budget, or burn-rate alerting on a GKE service. The full handoff contract, the SLI source table, and the fallback variants — including the Medium (6.0, 6h/30m) and Slow (1.0, 3d/6h) burn rates — are in kubernetes_promql_queries.md. If you emit the fallback queries, your response MUST still namegoogle-cloud-slo-alert-configurationas the owner of SLO configuration and state that what you emitted is a local fallback.
(
(
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
)Detect Traffic Outages
Avoid brittle == 0 comparisons. Use default 0 or absent() to detect total
traffic loss:
(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)) > 1Requirements 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