Configures best-practice, high-signal alerting policies for Google Cloud Run resources (services, jobs, and worker pools) based on seasoned SRE practices. Use w
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-cloud-run-alert-configuration-2bf9022cf312 ,按照其中的说明把「cloud-run-alert-configuration」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Production-grade observability for Google Cloud Run using Terraform and PromQL (Cloud Monitoring). Grounded in SRE practices, this skill focuses strictly on actionable user impact and scaling bounds.
'video-encoder', 'nightly-reconciliation', 'web-frontend', 'catalog-service', 'api-gateway', 'order-processor'), SKIP all workspace .tf file scanning (find_by_name, code_search, list_dir) and gcloud CLI discovery commands entirely.gcloud, terraform, or file search tools when the target name is already provided in the prompt. Instead, parameterize the project ID (variable "scoping_project_id" { default = "my-gcp-project" }) and target resource name in Terraform variables and proceed immediately to Step 2 (Configure Alerts).find_by_name or ls across root workspace directories..tf files in the immediate working directory for google_cloud_run_v2_service, google_cloud_run_service, or google_cloud_run_v2_job..tf files, attempt gcloud config get-value project and gcloud run services list. If any gcloud command fails (e.g., auth or metadata errors) or terraform is missing, immediately stop running CLI commands and output parameterized HCL using explicit variable defaults.project = var.scoping_project_id in all Terraform google_monitoring_alert_policy resources so the policy can target either a single project or a centralized Cloud Monitoring Metrics Scope.duration (Retest Window) Rules:
duration = "300s" (5m buffer) to absorb
transient blips and scale-up lag (except immediate job failure alerts
which use duration = "0s").duration
entirely (or set to 0s). Cloud Monitoring rejects PromQL queries
with duration set on lookbacks >25h (INVALID_ARGUMENT)..tf configurations using google_monitoring_alert_policy and condition_prometheus_query_language directly in your response.google_monitoring_alert_policy resource MUST include a user_labels block containing:
user_labels = {
created-with-google-skill = "cloud-run-alert-configuration"
}
alert_strategy { auto_close = "604800s" } and parameterize notification_channels = var.notification_channels..tf files or run gcloud to identify the target workload type and name. If gcloud auth fails, fall back immediately to default Terraform variables (var.scoping_project_id).duration = "0s").user_labels block (created-with-google-skill = "cloud-run-alert-configuration").