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

make uptime alert duration configurable #710

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions modules/prober/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ No requirements.
| <a name="input_slo_threshold"></a> [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 |
| <a name="input_squad"></a> [squad](#input\_squad) | squad label to apply to the service. | `string` | `""` | no |
| <a name="input_timeout"></a> [timeout](#input\_timeout) | The timeout for the prober in seconds. | `string` | `"60s"` | no |
| <a name="input_uptime_alert_duration"></a> [uptime\_alert\_duration](#input\_uptime\_alert\_duration) | duration for uptime alert policy. | `string` | `"600s"` | no |
| <a name="input_working_dir"></a> [working\_dir](#input\_working\_dir) | The working directory that contains the importpath. | `string` | n/a | yes |

## Outputs
Expand Down
4 changes: 2 additions & 2 deletions modules/prober/alert.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions modules/prober/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions modules/prober/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading