diff --git a/cloud/azure/mysql/README.md b/cloud/azure/mysql/README.md index 4f65eb9..3cb576c 100644 --- a/cloud/azure/mysql/README.md +++ b/cloud/azure/mysql/README.md @@ -22,7 +22,6 @@ Creates DataDog monitors with the following checks: - Mysql Server IO consumption - Mysql Server memory usage - Mysql Server storage -- Mysql Server total connection reach ## Inputs @@ -66,15 +65,6 @@ Creates DataDog monitors with the following checks: | memory\_usage\_timeframe | Monitor timeframe for Mysql memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_15m"` | no | | message | Message sent when an alert is triggered | string | n/a | yes | | new\_host\_delay | Delay in seconds before monitor new resource | string | `"300"` | no | -| total\_connection\_enabled | Flag to enable Mysql status monitor | string | `"true"` | no | -| total\_connection\_extra\_tags | Extra tags for Mysql status monitor | list | `[]` | no | -| total\_connection\_limit | Limit for Mysql total connection [See details : https://docs.microsoft.com/en-us/azure/mysql/concepts-limits] | string | n/a | yes | -| total\_connection\_message | Custom message for Mysql total connection monitor | string | `""` | no | -| total\_connection\_silenced | Groups to mute for Mysql total connection monitor | map | `{}` | no | -| total\_connection\_threshold\_critical | Mysql total connection threshold in percent (critical threshold) | string | `"80"` | no | -| total\_connection\_threshold\_warning | Mysql total connection threshold in percent (warning threshold) | string | `"70"` | no | -| total\_connection\_time\_aggregator | Monitor aggregator for Mysql total connection [available values: min, max or avg] | string | `"min"` | no | -| total\_connection\_timeframe | Monitor timeframe for Mysql total connection [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | ## Outputs @@ -84,7 +74,6 @@ Creates DataDog monitors with the following checks: | mysql\_free\_storage\_id | id for monitor mysql_free_storage | | mysql\_io\_consumption\_id | id for monitor mysql_io_consumption | | mysql\_memory\_usage\_id | id for monitor mysql_memory_usage | -| mysql\_total\_connection\_id | id for monitor mysql_total_connection | ## Related documentation diff --git a/cloud/azure/mysql/inputs.tf b/cloud/azure/mysql/inputs.tf index 5dfd1c3..89d0c87 100644 --- a/cloud/azure/mysql/inputs.tf +++ b/cloud/azure/mysql/inputs.tf @@ -76,57 +76,6 @@ variable "cpu_usage_threshold_critical" { default = "90" } -variable "total_connection_silenced" { - description = "Groups to mute for Mysql total connection monitor" - type = "map" - default = {} -} - -variable "total_connection_enabled" { - description = "Flag to enable Mysql status monitor" - type = "string" - default = "true" -} - -variable "total_connection_extra_tags" { - description = "Extra tags for Mysql status monitor" - type = "list" - default = [] -} - -variable "total_connection_message" { - description = "Custom message for Mysql total connection monitor" - type = "string" - default = "" -} - -variable "total_connection_time_aggregator" { - description = "Monitor aggregator for Mysql total connection [available values: min, max or avg]" - type = "string" - default = "min" -} - -variable "total_connection_timeframe" { - description = "Monitor timeframe for Mysql total connection [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = "string" - default = "last_5m" -} - -variable "total_connection_limit" { - description = "Limit for Mysql total connection [See details : https://docs.microsoft.com/en-us/azure/mysql/concepts-limits]" - type = "string" -} - -variable "total_connection_threshold_warning" { - description = "Mysql total connection threshold in percent (warning threshold)" - default = "70" -} - -variable "total_connection_threshold_critical" { - description = "Mysql total connection threshold in percent (critical threshold)" - default = "80" -} - variable "free_storage_silenced" { description = "Groups to mute for Mysql Free Storage monitor" type = "map" diff --git a/cloud/azure/mysql/monitors-mysql.tf b/cloud/azure/mysql/monitors-mysql.tf index 1e412c0..df54014 100644 --- a/cloud/azure/mysql/monitors-mysql.tf +++ b/cloud/azure/mysql/monitors-mysql.tf @@ -31,39 +31,6 @@ resource "datadog_monitor" "mysql_cpu_usage" { tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform", "${var.cpu_usage_extra_tags}"] } -resource "datadog_monitor" "mysql_total_connection" { - count = "${var.total_connection_enabled ? 1 : 0}" - name = "[${var.environment}] Mysql Server total connection reach {{#is_alert}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}} {{warn_threshold}}% ({{value}}%){{/is_warning}} of the total limit" - message = "${coalesce(var.total_connection_message, var.message)}" - - query = < "${var.total_connection_threshold_critical}" - EOF - - type = "metric alert" - - thresholds { - critical = "${var.total_connection_threshold_critical}" - warning = "${var.total_connection_threshold_warning}" - } - - silenced = "${var.total_connection_silenced}" - - notify_no_data = true - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform", "${var.total_connection_extra_tags}"] -} - resource "datadog_monitor" "mysql_free_storage" { count = "${var.free_storage_enabled ? 1 : 0}" name = "[${var.environment}] Mysql Server storage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" diff --git a/cloud/azure/mysql/outputs.tf b/cloud/azure/mysql/outputs.tf index be09ef9..3b22ff3 100644 --- a/cloud/azure/mysql/outputs.tf +++ b/cloud/azure/mysql/outputs.tf @@ -3,11 +3,6 @@ output "mysql_cpu_usage_id" { value = "${datadog_monitor.mysql_cpu_usage.*.id}" } -output "mysql_total_connection_id" { - description = "id for monitor mysql_total_connection" - value = "${datadog_monitor.mysql_total_connection.*.id}" -} - output "mysql_free_storage_id" { description = "id for monitor mysql_free_storage" value = "${datadog_monitor.mysql_free_storage.*.id}"