diff --git a/database/mysql/README.md b/database/mysql/README.md index d56cd43..05d8d16 100644 --- a/database/mysql/README.md +++ b/database/mysql/README.md @@ -23,8 +23,8 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| -| delay | Delay in seconds for the metric evaluation | string | `15` | no | | environment | Environment | string | - | yes | +| evaluation_delay | Delay in seconds for the metric evaluation | string | `15` | no | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | | message | Message sent when an alert is triggered | string | - | yes | @@ -36,6 +36,7 @@ Creates DataDog monitors with the following checks: | mysql_thread_silenced | Groups to mute mysql threads monitor | map | `` | no | | mysql_thread_threshold_critical | Maximum critical acceptable number of threads | string | `500` | no | | mysql_thread_threshold_warning | Maximum warning acceptable number of threads | string | `400` | no | +| new_host_delay | Delay in seconds for the metric evaluation | string | `300` | no | ## Outputs diff --git a/database/mysql/inputs.tf b/database/mysql/inputs.tf index b3f8a08..9a417c3 100644 --- a/database/mysql/inputs.tf +++ b/database/mysql/inputs.tf @@ -3,12 +3,16 @@ variable "environment" { type = "string" } -# 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/mysql/monitors-mysql.tf b/database/mysql/monitors-mysql.tf index c5c3aac..4ba9196 100644 --- a/database/mysql/monitors-mysql.tf +++ b/database/mysql/monitors-mysql.tf @@ -10,8 +10,8 @@ resource "datadog_monitor" "mysql_connection_too_high" { ) * 100 > ${var.mysql_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.mysql_connection_threshold_warning}" @@ -40,8 +40,8 @@ resource "datadog_monitor" "mysql_thread_too_high" { ) > ${var.mysql_thread_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.mysql_thread_threshold_warning}"