Manusで任意のスキルを実行
ワンクリックで
ワンクリックで
ワンクリックでManusで任意のスキルを実行
始めるgcp-alerts
スター10
フォーク4
更新日2026年2月1日 08:28
GCP 알림 정책 설정 (비용/에러/성능)
インストール
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SKILL.md
readonlyメニュー
GCP 알림 정책 설정 (비용/에러/성능)
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
GCP 결제 계정 목록
GCP 결제 계정 프로젝트 목록
GCP Billing 조회
GCP 리소스 정리 (Read-Only 스캔)
GCP Cloud Run 서비스 배포/관리
GCP 방화벽 규칙 관리
| name | gcp-alerts |
| description | GCP 알림 정책 설정 (비용/에러/성능) |
Cloud Monitoring 알림 정책을 설정하고 관리합니다.
/gcp-alerts # 알림 정책 목록
/gcp-alerts create budget # 예산 알림 생성
/gcp-alerts create vm-cpu # VM CPU 알림 생성
/gcp-alerts create error-rate # 에러율 알림 생성
gcloud services enable monitoring.googleapis.com --project=$PROJECT_ID
PROJECT_ID=$(gcloud config get-value project)
gcloud alpha monitoring policies list --project=$PROJECT_ID \
--format="table(displayName,enabled,conditions[0].displayName)"
# 이메일 채널 생성
cat > /tmp/email-channel.json << 'EOF'
{
"type": "email",
"displayName": "Admin Email",
"labels": {
"email_address": "admin@example.com"
}
}
EOF
gcloud alpha monitoring channels create \
--channel-content-from-file=/tmp/email-channel.json \
--project=$PROJECT_ID
cat > /tmp/cpu-alert.json << 'EOF'
{
"displayName": "High CPU Usage",
"conditions": [{
"displayName": "CPU > 80%",
"conditionThreshold": {
"filter": "resource.type = \"gce_instance\" AND metric.type = \"compute.googleapis.com/instance/cpu/utilization\"",
"comparison": "COMPARISON_GT",
"thresholdValue": 0.8,
"duration": "300s",
"aggregations": [{
"alignmentPeriod": "60s",
"perSeriesAligner": "ALIGN_MEAN"
}]
}
}],
"combiner": "OR",
"enabled": true,
"notificationChannels": ["CHANNEL_ID"]
}
EOF
gcloud alpha monitoring policies create \
--policy-from-file=/tmp/cpu-alert.json \
--project=$PROJECT_ID
# 예산 API 활성화
gcloud services enable billingbudgets.googleapis.com
# 예산 생성 (월 $100, 80% 도달 시 알림)
gcloud billing budgets create \
--billing-account=BILLING_ACCOUNT_ID \
--display-name="Monthly Budget" \
--budget-amount=100USD \
--threshold-rules=threshold-percent=0.8,spend-basis=current-spend \
--threshold-rules=threshold-percent=1.0,spend-basis=current-spend \
--all-updates-rule-pubsub-topic=projects/$PROJECT_ID/topics/budget-alerts
cat > /tmp/error-alert.json << 'EOF'
{
"displayName": "Cloud Run Error Rate > 5%",
"conditions": [{
"displayName": "Error rate",
"conditionThreshold": {
"filter": "resource.type = \"cloud_run_revision\" AND metric.type = \"run.googleapis.com/request_count\" AND metric.labels.response_code_class = \"5xx\"",
"comparison": "COMPARISON_GT",
"thresholdValue": 0.05,
"duration": "60s",
"aggregations": [{
"alignmentPeriod": "60s",
"perSeriesAligner": "ALIGN_RATE"
}]
}
}],
"combiner": "OR",
"enabled": true
}
EOF
gcloud alpha monitoring policies create \
--policy-from-file=/tmp/error-alert.json \
--project=$PROJECT_ID
# 비활성화
gcloud alpha monitoring policies update POLICY_ID \
--no-enabled \
--project=$PROJECT_ID
# 활성화
gcloud alpha monitoring policies update POLICY_ID \
--enabled \
--project=$PROJECT_ID
gcloud alpha monitoring policies delete POLICY_ID --project=$PROJECT_ID
| 알림 | 메트릭 | 임계값 |
|---|---|---|
| 높은 CPU | compute.googleapis.com/instance/cpu/utilization | > 80% |
| 높은 메모리 | agent.googleapis.com/memory/percent_used | > 90% |
| 디스크 부족 | agent.googleapis.com/disk/percent_used | > 85% |
| VM 다운 | Uptime Check 실패 | 2회 연속 |
| 알림 | 메트릭 | 임계값 |
|---|---|---|
| 에러율 | 5xx / total | > 5% |
| 지연 시간 | request_latencies | p99 > 2s |
| 인스턴스 급증 | instance_count | > 50 |
| 알림 | 설정 |
|---|---|
| 일일 예산 | threshold 80%, 100% |
| 이상 비용 | 전일 대비 200% 초과 |
## 알림 정책 목록
| 정책 이름 | 상태 | 조건 |
|-----------|------|------|
| High CPU Usage | 활성 | CPU > 80% for 5분 |
| Error Rate Alert | 활성 | 5xx > 5% for 1분 |
| Monthly Budget | 활성 | $100의 80%, 100% |
---
### 알림 채널
| 채널 | 유형 | 대상 |
|------|------|------|
| Admin Email | email | admin@example.com |
| Slack Webhook | webhook | #alerts |
| 유형 | 설정 |
|---|---|
email_address | |
| Slack | Webhook URL |
| PagerDuty | Integration Key |
| SMS | 전화번호 |
| Pub/Sub | Topic 이름 |