Skip to content

Commit 77f325d

Browse files
committed
fix(baseline): remove generic CPU alert — workload alerts belong per-project
1 parent df238cb commit 77f325d

2 files changed

Lines changed: 4 additions & 31 deletions

File tree

providers/gcp/modules/baseline/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ No modules.
2525
| [google_billing_budget.project](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/billing_budget) | resource |
2626
| [google_iam_workload_identity_pool.github](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/iam_workload_identity_pool) | resource |
2727
| [google_iam_workload_identity_pool_provider.github](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/iam_workload_identity_pool_provider) | resource |
28-
| [google_monitoring_alert_policy.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/monitoring_alert_policy) | resource |
2928
| [google_monitoring_notification_channel.budget_email](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/monitoring_notification_channel) | resource |
3029
| [google_monitoring_notification_channel.pagerduty](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/monitoring_notification_channel) | resource |
3130
| [google_project.this](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/project) | resource |
Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,4 @@
1-
resource "google_monitoring_alert_policy" "default" {
2-
project = google_project.this.project_id
3-
display_name = "${var.project_id} — CPU Utilization > 80%"
4-
combiner = "OR"
5-
enabled = true
6-
7-
conditions {
8-
display_name = "GCE instance CPU utilization > 80%"
9-
condition_threshold {
10-
filter = "resource.type=\"gce_instance\" AND metric.type=\"compute.googleapis.com/instance/cpu/utilization\""
11-
comparison = "COMPARISON_GT"
12-
threshold_value = 0.8
13-
duration = "300s"
14-
15-
aggregations {
16-
alignment_period = "60s"
17-
per_series_aligner = "ALIGN_MEAN"
18-
}
19-
}
20-
}
21-
22-
notification_channels = compact([
23-
google_monitoring_notification_channel.budget_email.id,
24-
length(google_monitoring_notification_channel.pagerduty) > 0
25-
? google_monitoring_notification_channel.pagerduty[0].id
26-
: null
27-
])
28-
29-
depends_on = [google_project_service.apis]
30-
}
1+
# No baseline-level alert policies — workload alerts belong in each project's
2+
# own Terraform config, since the right metrics depend on what's running there
3+
# (Cloud Run, GKE, GCE, etc.). Notification channels are defined above and can
4+
# be referenced by project-level alert policies via terraform_remote_state.

0 commit comments

Comments
 (0)