Skip to content

Commit

Permalink
Merge pull request #3088 from yuvipanda/fix-check-name
Browse files Browse the repository at this point in the history
Switch filestore alerts back to % based alerts
  • Loading branch information
yuvipanda authored Sep 7, 2023
2 parents 3541a1a + f551e75 commit 21218eb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 4 additions & 4 deletions terraform/gcp/pagerduty.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "google_monitoring_notification_channel" "pagerduty_disk_space" {

resource "google_monitoring_alert_policy" "disk_space_full_alert" {

display_name = "Disk Space 80% full on ${var.project_id}"
display_name = "Available disk space < ${var.filestore_alert_available_percent}% on ${var.project_id}"
combiner = "OR"

conditions {
Expand All @@ -35,12 +35,12 @@ resource "google_monitoring_alert_policy" "disk_space_full_alert" {
# Alert based on free bytes left on the filesystem
filter = <<-EOT
resource.type = "filestore_instance"
AND metric.type = "file.googleapis.com/nfs/server/free_bytes"
AND metric.type = "file.googleapis.com/nfs/server/free_bytes_percent"
EOT
duration = "300s"

# Trigger if free space is < 512GB
threshold_value = 549755813888
# Trigger if free space is < 10%
threshold_value = var.filestore_alert_available_percent
comparison = "COMPARISON_LT"

aggregations {
Expand Down
9 changes: 9 additions & 0 deletions terraform/gcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,15 @@ variable "filestore_tier" {
EOT
}

variable "filestore_alert_available_percent" {
type = number
default = 10
description = <<-EOT
% of free space in filestore available under which to fire an alert to pagerduty.
EOT
}


variable "enable_node_autoprovisioning" {
type = bool
default = false
Expand Down

0 comments on commit 21218eb

Please sign in to comment.