Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alert for cloud-sql-proxy connection failures #1162

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions terraform/gcp/modules/monitoring/infra/alerts.tf
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,52 @@ resource "google_monitoring_alert_policy" "cloud_sql_disk_utilization" {
}


### Cloud SQL Proxy Alerts

# Cloud SQL Proxy Connection Failures
resource "google_monitoring_alert_policy" "cloudsqlconn_connection_failure" {
# In the absence of data, incident will auto-close in 7 days
alert_strategy {
auto_close = "604800s"
}

combiner = "OR"

# Connection failures are greater than 0
conditions {
condition_threshold {
aggregations {
alignment_period = "60s"
per_series_aligner = "ALIGN_RATE"
}

comparison = "COMPARISON_GT"
duration = "300s"
filter = "metric.type=\"prometheus.googleapis.com/cloudsqlconn_dial_failure_count/counter\" resource.type=\"prometheus_target\""
threshold_value = "0"

trigger {
count = "1"
percent = "0"
}
}

display_name = "Cloud SQL Proxy connections failing"
}

display_name = "Cloud SQL Proxy connections failing"

documentation {
content = "Cloud SQL Proxy connections have been failing for at least 5 minutes.\n"
mime_type = "text/markdown"
}

enabled = "true"
notification_channels = local.notification_channels
project = var.project_id
}


### KMS Alerts

resource "google_monitoring_alert_policy" "kms_read_request_alert" {
Expand Down