diff --git a/modules/prober/README.md b/modules/prober/README.md index fcf05cbe..5cdf80fc 100644 --- a/modules/prober/README.md +++ b/modules/prober/README.md @@ -127,6 +127,7 @@ No requirements. | [slo\_threshold](#input\_slo\_threshold) | The uptime percent required to meet the SLO for the service, expressed as a decimal in {0, 1} | `number` | `0.999` | no | | [squad](#input\_squad) | squad label to apply to the service. | `string` | `""` | no | | [timeout](#input\_timeout) | The timeout for the prober in seconds. | `string` | `"60s"` | no | +| [uptime\_alert\_duration](#input\_uptime\_alert\_duration) | duration for uptime alert policy. | `string` | `"600s"` | no | | [working\_dir](#input\_working\_dir) | The working directory that contains the importpath. | `string` | n/a | yes | ## Outputs diff --git a/modules/prober/alert.tf b/modules/prober/alert.tf index aab51b05..c843819f 100644 --- a/modules/prober/alert.tf +++ b/modules/prober/alert.tf @@ -17,14 +17,14 @@ resource "google_monitoring_alert_policy" "uptime_alert" { conditions { condition_threshold { aggregations { - alignment_period = "300s" + alignment_period = "60s" cross_series_reducer = "REDUCE_COUNT_FALSE" group_by_fields = ["resource.*"] per_series_aligner = "ALIGN_NEXT_OLDER" } comparison = "COMPARISON_GT" - duration = "60s" + duration = var.uptime_alert_duration filter = <<-EOT metric.type="monitoring.googleapis.com/uptime_check/check_passed" resource.type="uptime_url" diff --git a/modules/prober/main.tf b/modules/prober/main.tf index 1e54dbe5..ea7825fe 100644 --- a/modules/prober/main.tf +++ b/modules/prober/main.tf @@ -25,8 +25,8 @@ module "this" { regions = var.regions scaling = var.scaling - squad = var.squad - require_squad = var.require_squad + squad = var.squad + require_squad = var.require_squad // If we're using GCLB then disallow external traffic, // otherwise allow the prober URI to be used directly. diff --git a/modules/prober/variables.tf b/modules/prober/variables.tf index 17eec9da..6634fcf8 100644 --- a/modules/prober/variables.tf +++ b/modules/prober/variables.tf @@ -115,6 +115,12 @@ variable "alert_description" { description = "Alert documentation. Use this to link to playbooks or give additional context." } +variable "uptime_alert_duration" { + type = string + default = "600s" + description = "duration for uptime alert policy." +} + variable "notification_channels" { description = "A list of notification channels to send alerts to." type = list(string)