본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)22k · #10247

cloud-run-alert-configuration

하는 일

이 스킬은 사용자에게 영향을 주는 문제를 팀이 알 수 있도록 Cloud Run용 Terraform 알림 규칙을 만듭니다. 불필요한 알림 없이 유용한 알림을 원하는 엔지니어를 위한 스킬입니다.

사용하는 경우

  • ✓Cloud Run의 오류율, 지연 시간, 컨테이너 포화에 대한 알림을 원할 때.
  • ✓이름이 있는 Cloud Run 서비스, 작업 또는 워커 풀의 Terraform 알림 정책이 필요할 때.
  • ✓Cloud Run에 이미 있는 알림을 검토하거나 개선하고 싶을 때.

스킬 링크

https://github.com/google/skills/blob/main/skills/cloud/cloud-run-alert-configuration/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/google/skills/blob/main/skills/cloud/cloud-run-alert-configuration/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“내 video-encoder Cloud Run 서비스의 오류나 느린 요청이 사용자에게 닿을 때 알 수 있도록 Terraform 알림을 작성해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

SRE 실무를 바탕으로 PromQL 알림 규칙을 사용하며, 사용자 영향과 확장 한도에 초점을 둡니다. 서비스 이름을 말하면 파일 검색을 건너뛰고 바로 Terraform을 작성합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Cloud Run Alert Configuration

Production-grade observability for Cloud Run using Terraform and PromQL (Cloud Monitoring). Grounded in SRE practices, this skill focuses strictly on actionable user impact and scaling bounds.


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:cloud-run-alert-configuration)" and append agent-skills/1.0 (skill:cloud-run-alert-configuration) to User-Agent headers.

CRITICAL RULES

  • Prompt-First Fast Path (Skip Discovery When Named):
    • If the user prompt explicitly specifies the target Cloud Run service, job, or worker pool name (e.g., '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.
    • Do NOT run 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).
  • Autonomous Discovery (Only When Target Name is Omitted):
    • Never Scan Root Monorepo or Unbounded Directories: Never run find_by_name or ls across root workspace directories.
    • Config First: Only if the prompt omits the resource name, check .tf files in the immediate working directory for google_cloud_run_v2_service, google_cloud_run_service, or google_cloud_run_v2_job.
    • CLI Second (Graceful Fallback): Only if unconfigured in prompt or local .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.
  • Workload Routing: Always classify the workload target and follow its specific reference guide:
  • Explicit Defaults & User Overrides:
    • Always use explicit defaults for all constants specified in the target workload's reference file (SLO targets, latency thresholds, SLAs, saturation ceilings, rate guards).
    • State the defaults being applied in the final summary output and clearly notify the user that any default constant can be customized or overridden via Terraform variables or prompt input.
  • Metric Scope Centralization: Parameterize 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.
  • PromQL duration (Retest Window) Rules:
    • Lookbacks $\le$ 25h: Set duration = "300s" (5m buffer) to absorb transient blips and scale-up lag (except immediate job failure alerts which use duration = "0s").
    • Lookbacks $> 25$h (e.g. 3d/7d Slow Burn): Omit duration entirely (or set to 0s). Cloud Monitoring rejects PromQL queries with duration set on lookbacks >25h (INVALID_ARGUMENT).
  • Terraform Standards & Mandatory Labels:
    • Output clean, complete .tf configurations using google_monitoring_alert_policy and condition_prometheus_query_language directly in your response.
    • Mandatory User Labels: Every google_monitoring_alert_policy resource MUST include a user_labels block containing:
      user_labels = {
        created-with-google-skill = "cloud-run-alert-configuration"
      }
      
    • Include alert_strategy { auto_close = "604800s" } and parameterize notification_channels = var.notification_channels.

WORKFLOW STEPS

1. Discovery & Target Identification

  • **Fast Path (Target Named in Prompt)
자주 묻는 질문

서비스 이름을 말하면 코드를 검색하나요?

아닙니다. 요청에 이름이 없을 때만 서비스를 찾습니다.

어떤 Cloud Run 리소스를 다루나요?

서비스, 작업, 워커 풀을 다룹니다.

알림을 배포하나요?

검토하고 배포할 수 있도록 Terraform 정책을 작성해 줍니다.

상세 정보

작성자의 원본 설명

Configures best-practice, high-signal alerting policies for Cloud Run resources on Google Cloud (services, jobs, and worker pools) based on seasoned SRE practices. Use when analyzing, recommending, writing, or deploying Terraform PromQL alerting policies to monitor Cloud Run error rates (4xx/5xx), request latency, container instance saturation (warning/critical), container CPU/memory utilization and allocation, billable instance time, job execution status, and worker pool queue backlog. Don't use for GKE workloads (use gke-alert-configuration) or Compute Engine VMs.

repo: google/skills

인기도

GitHub 스타
22k
순위
#10247
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬