diff --git a/database/postgresql/inputs.tf b/database/postgresql/inputs.tf index a6eecbb..8b44746 100644 --- a/database/postgresql/inputs.tf +++ b/database/postgresql/inputs.tf @@ -4,11 +4,16 @@ variable "environment" { } # Global DataDog -variable "delay" { +variable "evaluation_delay" { description = "Delay in seconds for the metric evaluation" default = 15 } +variable "new_host_delay" { + description = "Delay in seconds for the metric evaluation" + default = 300 +} + variable "message" { description = "Message sent when an alert is triggered" } diff --git a/database/postgresql/monitors-postgresql.tf b/database/postgresql/monitors-postgresql.tf index 090edfa..515c695 100644 --- a/database/postgresql/monitors-postgresql.tf +++ b/database/postgresql/monitors-postgresql.tf @@ -18,8 +18,8 @@ resource "datadog_monitor" "postgresql_connection_too_high" { ) * 100 > ${var.postgresql_connection_threshold_critical} EOF - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" thresholds { warning = "${var.postgresql_connection_threshold_warning}" @@ -49,8 +49,8 @@ resource "datadog_monitor" "postgresql_too_many_locks" { ) > ${var.postgresql_lock_threshold_critical} EOF - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" thresholds { warning = "${var.postgresql_lock_threshold_warning}"