gke-alert-configuration
它能做什么
这项技能帮助 AI 智能体使用 Terraform 和 Google Cloud Managed Service for Prometheus,为 Google Kubernetes Engine 设置告警策略。适合希望获得有用告警、同时又不想要太多噪音的团队。
适用场景
- ✓当你希望为 GKE 服务的延迟、流量或错误率设置 Terraform 告警时。
- ✓当你需要为内存饱和或 GKE 集群整体健康状况设置告警时。
- ✓当你想检查现有告警策略是否有噪音或遗漏时。
技能链接
https://github.com/google/skills/blob/main/skills/cloud/gke-alert-configuration/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我为 GKE 服务的错误率和响应时间编写 Terraform 告警。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会用 Terraform 编写基于 PromQL 的告警策略,对主要服务信号采用燃烧率风格的规则,并在部署前进行检查。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
GKE Alert Configuration
This skill provides guidelines and best practices for creating robust, high-signal alerting policies for Google Kubernetes Engine workloads using Google Cloud Managed Service for Prometheus and Terraform. It ensures comprehensive coverage of the 4 Golden Signals and key cluster health metrics while minimizing alert noise.
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-alert-configuration)"
and append agent-skills/1.0 (skill:gke-alert-configuration) to User-Agent headers.
Critical Rules
- Negative Triggers and Scope Redirection for Non-GKE Standalone Runtimes:
- This skill is strictly scoped to Google Kubernetes Engine (GKE) workloads, clusters, and services using PromQL and Google Cloud Managed Service for Prometheus.
- Do not use for non-GKE compute runtimes, such as standalone Compute Engine virtual machines or standalone Cloud Run services without GKE.
- STOP AND RESPOND DIRECTLY (Do Not Edit Files): When the user
requests alert configuration for non-GKE compute infrastructure:
- Do not write, create, edit, or validate any Terraform files on disk.
- Immediately stop and respond directly to the user in chat:
- Explicitly Clarify Out-of-Scope: State clearly that standalone Compute Engine virtual machine monitoring or standalone Cloud Run monitoring is out of scope for this GKE-specific PromQL alerting skill, which is designed specifically for GKE workloads using Google Cloud Managed Service for Prometheus and PromQL.
- Do Not Generate GKE PromQL Alerts: Do not create or generate Kubernetes PromQL alert policies or fabricate Kubernetes container, pod, or node resources for non-GKE infrastructure.
- Redirect the User: Guide and redirect the user to standard
Google Cloud Monitoring metrics, such as
compute.googleapis.com/instance/cpu/utilizationorrun.googleapis.com/request_latencies, using standardgoogle_monitoring_alert_policywithcondition_thresholdor MQL, or recommend the relevant specialized Cloud observability skill.
- Mandatory
kube-state-metrics(KSM) Cost Guardrail:- Deploying open-source
kube-state-metricsin Google Cloud Managed Service for Prometheus incurs billable metric ingestion costs. - STOP AND ASK PERMISSION FIRST (Do Not Edit Files): When a requested
alert rule relies on Tier 2 KSM metrics (such as
kube_cronjob_*,kube_pod_status_phase,kube_persistentvolume_*,kube_deployment_*,kube_statefulset_*,kube_job_*, orkube_daemonset_*), do not write, create, edit, or validate any Terraform files or generate alert policies before obtaining user approval. - Instead, you must immediately stop and respond directly to the user
to:
- Alert the user that the requested alert requires
kube-state-metrics. - Explain the cost impact: Detail that
kube-state-metricsincurs billable sample ingestion costs in Google Cloud Managed Service for Prometheus. - Ask for explicit permission: Ask the user for explicit permission before assuming, enabling, or generating KSM-dependent alert configurations.
- Recommend filtering or allowlisting: Suggest and recommend
filtering or allowlisting only the specific required metrics, such
as using a
PodMonitoringresource withmetricRelabeling(action: keep) or KSM--metric-allowlistto minimize ingestion costs. Provide a concrete allowlist example.
- Alert the user that the requested alert requires
- Always prefer Non-KSM Native Alternatives (Tier 1 cAdvisor or native GKE metrics documented in [metrics_and_alerts_catalog.md](references/metrics_a
- Deploying open-source
常见问题
它适用于 Compute Engine 虚拟机或 Cloud Run 吗?
不适用。它用于 GKE 工作负载和集群,因此独立的 Compute Engine 虚拟机以及不在 GKE 中的 Cloud Run 不在范围之内。
它会自己编写告警吗?
会。它会编写 Terraform 告警策略,你可以审阅后再部署。
它也涵盖集群健康吗?
涵盖。它涵盖集群健康和内存饱和,以及服务延迟和错误。
详情
作者的原始描述
Configures alerting policies in Terraform for Google Kubernetes Engine (GKE) clusters, workloads, and services using PromQL and Google Cloud Managed Service for Prometheus. Use when writing, analyzing, validating, or deploying Terraform alerting policies to monitor GKE service latency, traffic, error rates using Multi-Window Multi-Burn-Rate SLO alerts, memory saturation, and cluster health such as CrashLoopBackOff and Node NotReady conditions. Don't use for non-GKE compute runtimes such as standalone Compute Engine VMs or standalone Cloud Run services without GKE.
repo: google/skills
热度
- GitHub 星标
- 22k
- 排名
- #10276
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
finding-google-skills
22k帮你的智能体为某项设置任务找到合适的 Google 指南,例如托管、数据库、存储、登录或 AI 模型服务。
gcloud
22k帮你的智能体编写并检查 Google Cloud gcloud 命令,在运行任何内容之前查阅准确的语法,避免猜测参数。
google-cloud-recipe-auth
22k引导你的智能体了解 Google Cloud 的身份与访问管理,包括人员和服务如何登录,以及它们各自获得哪些权限。
google-cloud-recipe-onboarding
22k带领新开发者完成在 Google Cloud 上的第一步,包括选择项目、关联计费,以及部署第一个资源。