gke-alert-configuration

Generates Terraform alerting policies for GKE workloads using PromQL and Managed Service for Prometheus.

19.1k|1.5k|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/google/skills --skill gke-alert-configuration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gke-alert-configuration
Source: https://github.com/google/skills/tree/main/skills/cloud/gke-alert-configuration
Command: npx skills add https://github.com/google/skills --skill gke-alert-configuration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Writing correct, low-noise alerting policies for Google Kubernetes Engine is hard: PromQL queries have subtle pitfalls (disappearing time series, redundant duration windows), kube-state-metrics ingestion can create unexpected billing costs, and naive error-rate thresholds cause false alarms. This Skill produces validated Terraform alerting policies that follow Google SRE best practices.

Core Features & Use Cases

  • Golden Signals Coverage: Generates alerts for latency (P95), errors (Multi-Window Multi-Burn-Rate SLO), traffic drops (absent()/default 0), and memory saturation, plus cluster health signals like CrashLoopBackOff and Node NotReady.
  • KSM Cost Guardrails: Classifies metrics into Tier 1 (native, zero surcharge) and Tier 2 (kube-state-metrics), asks permission before using KSM metrics, and recommends filtered PodMonitoring allowlists to control ingestion costs.
  • Plan-Validate-Execute Workflow: Validates change plans and Terraform files with a linting script that checks PromQL syntax, time windows, duration rules, and duplicate alert targets.
  • Use Case: Ask for alerting on a GKE service and receive a complete alerts.tf with MWMBR SLO burn-rate alerts, dynamic grouping by cluster/namespace/pod, and plain-English explanations of each threshold.

Quick Start

Generate Terraform alerting policies covering the four golden signals for my GKE service in the production namespace.

Frequently Asked Questions about gke-alert-configuration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create GKE alerting policies in Terraform with PromQL?

Use the google_monitoring_alert_policy resource with condition_prometheus_query_language blocks containing PromQL queries. Declare variables for project_id, cluster_name, and namespace, and use grouping aggregations like by (cluster, namespace, pod) so one policy dynamically covers all resources.

What is a multi-window multi-burn-rate SLO alert?

A MWMBR alert evaluates error budget consumption across two simultaneous lookback windows, such as 5 minutes and 1 hour, and fires only when both exceed the burn rate threshold. For a 99% SLO, a fast-burn alert uses a 14.4x factor, eliminating false alarms from short error bursts.

Does kube-state-metrics cost money in Google Cloud Managed Service for Prometheus?

Yes, kube-state-metrics metrics incur billable sample ingestion costs in Managed Service for Prometheus. Reduce costs by deploying a filtered PodMonitoring resource with metricRelabeling keep rules that allowlist only the specific kube_* metrics your alerts require.

Why does my traffic drop alert not fire when requests stop completely?

When traffic drops to zero, Prometheus stops emitting the time series, so rate(...) == 0 evaluates to an empty vector and never fires. Use sum(rate(...[5m])) default 0 == 0 or absent(...) == 1 to reliably detect total traffic loss.

Can I use this skill for Cloud Run or Compute Engine monitoring?

No, it is strictly scoped to GKE workloads using PromQL and Managed Service for Prometheus. For standalone Compute Engine VMs or Cloud Run services, use standard google_monitoring_alert_policy with condition_threshold and metrics like compute.googleapis.com/instance/cpu/utilization.

Why should I set duration to 0s on PromQL alerts with lookback windows?

Queries with aggregated lookback windows like increase(...[15m]) already smooth transient spikes, so adding duration = "300s" only increases mean time to detect. Reserve longer durations for instantaneous gauge conditions such as kube_node_status_condition == 0.