diff --git a/databases/mysql/README.md b/databases/mysql/README.md index a111f3c..b988d29 100644 --- a/databases/mysql/README.md +++ b/databases/mysql/README.md @@ -1,5 +1,5 @@ MySQL DataDog monitors -========================================== +====================== How to use this module ---------------------- @@ -26,7 +26,7 @@ Inputs | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| -| evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | +| delay | Delay in seconds for the metric evaluation | string | `900` | no | | environment | Environment | string | - | yes | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | diff --git a/databases/mysql/inputs.tf b/databases/mysql/inputs.tf index b238bd3..3f1de5c 100644 --- a/databases/mysql/inputs.tf +++ b/databases/mysql/inputs.tf @@ -4,7 +4,7 @@ variable "environment" { } # Global DataDog -variable "evaluation_delay" { +variable "delay" { description = "Delay in seconds for the metric evaluation" default = 900 } diff --git a/databases/mysql/mon-mysql.tf b/databases/mysql/mon-mysql.tf index 0c8b752..17900ed 100644 --- a/databases/mysql/mon-mysql.tf +++ b/databases/mysql/mon-mysql.tf @@ -7,7 +7,7 @@ data "template_file" "filter" { } resource "datadog_monitor" "mysql_connection_too_high" { - name = "[${var.environment}] Mysql Connections {{comparator}} {{#is_alert}}{{threshold}}%{{/is_alert}}{{#is_warning}}{{warn_threshold}}%{{/is_warning}} ({{value}}%)" + name = "[${var.environment}] Mysql Connections {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.mysql_connection_message, var.message)}" type = "metric alert" @@ -18,8 +18,8 @@ resource "datadog_monitor" "mysql_connection_too_high" { ) * 100 > ${var.mysql_connection_threshold_critical} EOF - evaluation_delay = "${var.evaluation_delay}" - new_host_delay = "${var.evaluation_delay}" + evaluation_delay = "${var.delay}" + new_host_delay = "${var.delay}" thresholds { warning = "${var.mysql_connection_threshold_warning}" @@ -38,7 +38,7 @@ resource "datadog_monitor" "mysql_connection_too_high" { } resource "datadog_monitor" "mysql_thread_too_high" { - name = "[${var.environment}] Mysql threads {{comparator}} {{#is_alert}}{{threshold}}%{{/is_alert}}{{#is_warning}}{{warn_threshold}}%{{/is_warning}} ({{value}}%)" + name = "[${var.environment}] Mysql threads {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.mysql_thread_message, var.message)}" type = "metric alert" @@ -48,8 +48,8 @@ resource "datadog_monitor" "mysql_thread_too_high" { ) > ${var.mysql_thread_threshold_critical} EOF - evaluation_delay = "${var.evaluation_delay}" - new_host_delay = "${var.evaluation_delay}" + evaluation_delay = "${var.delay}" + new_host_delay = "${var.delay}" thresholds { warning = "${var.mysql_thread_threshold_warning}"