From b3742472bd2166a4f7dd722d00fd698cf56cf7dc Mon Sep 17 00:00:00 2001 From: Alexandre Gaillet Date: Mon, 31 Dec 2018 14:47:40 +0100 Subject: [PATCH 1/3] MON-383 - compute_consumption_percent monitors removed --- cloud/azure/mysql/monitors-mysql.tf | 33 ------------------- .../azure/postgresql/monitors-postegresql.tf | 33 ------------------- 2 files changed, 66 deletions(-) diff --git a/cloud/azure/mysql/monitors-mysql.tf b/cloud/azure/mysql/monitors-mysql.tf index 4b0214f..b8554e2 100644 --- a/cloud/azure/mysql/monitors-mysql.tf +++ b/cloud/azure/mysql/monitors-mysql.tf @@ -125,39 +125,6 @@ resource "datadog_monitor" "mysql_io_consumption" { tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform", "${var.io_consumption_extra_tags}"] } -resource "datadog_monitor" "mysql_compute_consumption" { - count = "${var.compute_consumption_enabled ? 1 : 0}" - name = "[${var.environment}] Mysql Server compute consumption {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.compute_consumption_message, var.message)}" - - query = < ${var.compute_consumption_threshold_critical} - EOF - - type = "metric alert" - - thresholds { - critical = "${var.compute_consumption_threshold_critical}" - warning = "${var.compute_consumption_threshold_warning}" - } - - silenced = "${var.compute_consumption_silenced}" - - notify_no_data = false - 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.compute_consumption_extra_tags}"] -} - resource "datadog_monitor" "mysql_memory_usage" { count = "${var.memory_usage_enabled ? 1 : 0}" name = "[${var.environment}] Mysql Server memory usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" diff --git a/cloud/azure/postgresql/monitors-postegresql.tf b/cloud/azure/postgresql/monitors-postegresql.tf index 9528fdd..b4251a9 100644 --- a/cloud/azure/postgresql/monitors-postegresql.tf +++ b/cloud/azure/postgresql/monitors-postegresql.tf @@ -157,36 +157,3 @@ resource "datadog_monitor" "postgresql_memory_usage" { tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:postgresql", "team:claranet", "created-by:terraform", "${var.memory_usage_extra_tags}"] } - -resource "datadog_monitor" "postgresql_compute_consumption" { - count = "${var.compute_consumption_enabled ? 1 : 0}" - name = "[${var.environment}] Postgresql Server compute consumption {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.compute_consumption_message, var.message)}" - - query = < ${var.compute_consumption_threshold_critical} - EOF - - type = "metric alert" - - thresholds { - critical = "${var.compute_consumption_threshold_critical}" - warning = "${var.compute_consumption_threshold_warning}" - } - - silenced = "${var.compute_consumption_silenced}" - - notify_no_data = false - 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:postgresql", "team:claranet", "created-by:terraform", "${var.compute_consumption_extra_tags}"] -} From 3e8fe23a14d35d86e2d21aea7ac797e59186739e Mon Sep 17 00:00:00 2001 From: Alexandre Gaillet Date: Mon, 31 Dec 2018 14:51:31 +0100 Subject: [PATCH 2/3] MON-383 - autoupdate applied --- cloud/azure/mysql/README.md | 2 -- cloud/azure/mysql/outputs.tf | 5 ----- cloud/azure/postgresql/README.md | 2 -- cloud/azure/postgresql/outputs.tf | 5 ----- 4 files changed, 14 deletions(-) diff --git a/cloud/azure/mysql/README.md b/cloud/azure/mysql/README.md index c1ec5be..4927f8d 100644 --- a/cloud/azure/mysql/README.md +++ b/cloud/azure/mysql/README.md @@ -16,7 +16,6 @@ module "datadog-monitors-cloud-azure-mysql" { Creates DataDog monitors with the following checks: -- Mysql Server compute consumption - Mysql Server CPU usage - Mysql Server has no connection - Mysql Server IO consumption @@ -84,7 +83,6 @@ Creates DataDog monitors with the following checks: | Name | Description | |------|-------------| -| mysql_compute_consumption_id | id for monitor mysql_compute_consumption | | mysql_cpu_usage_id | id for monitor mysql_cpu_usage | | mysql_free_storage_id | id for monitor mysql_free_storage | | mysql_io_consumption_id | id for monitor mysql_io_consumption | diff --git a/cloud/azure/mysql/outputs.tf b/cloud/azure/mysql/outputs.tf index b064939..f037a3f 100644 --- a/cloud/azure/mysql/outputs.tf +++ b/cloud/azure/mysql/outputs.tf @@ -18,11 +18,6 @@ output "mysql_io_consumption_id" { value = "${datadog_monitor.mysql_io_consumption.*.id}" } -output "mysql_compute_consumption_id" { - description = "id for monitor mysql_compute_consumption" - value = "${datadog_monitor.mysql_compute_consumption.*.id}" -} - output "mysql_memory_usage_id" { description = "id for monitor mysql_memory_usage" value = "${datadog_monitor.mysql_memory_usage.*.id}" diff --git a/cloud/azure/postgresql/README.md b/cloud/azure/postgresql/README.md index f7942a4..0b96275 100644 --- a/cloud/azure/postgresql/README.md +++ b/cloud/azure/postgresql/README.md @@ -16,7 +16,6 @@ module "datadog-monitors-cloud-azure-postgresql" { Creates DataDog monitors with the following checks: -- Postgresql Server compute consumption - Postgresql Server CPU usage - Postgresql Server has no connection - Postgresql Server IO consumption @@ -84,7 +83,6 @@ Creates DataDog monitors with the following checks: | Name | Description | |------|-------------| -| postgresql_compute_consumption_id | id for monitor postgresql_compute_consumption | | postgresql_cpu_usage_id | id for monitor postgresql_cpu_usage | | postgresql_free_storage_id | id for monitor postgresql_free_storage | | postgresql_io_consumption_id | id for monitor postgresql_io_consumption | diff --git a/cloud/azure/postgresql/outputs.tf b/cloud/azure/postgresql/outputs.tf index b1eeb0a..52b8398 100644 --- a/cloud/azure/postgresql/outputs.tf +++ b/cloud/azure/postgresql/outputs.tf @@ -22,8 +22,3 @@ output "postgresql_memory_usage_id" { description = "id for monitor postgresql_memory_usage" value = "${datadog_monitor.postgresql_memory_usage.*.id}" } - -output "postgresql_compute_consumption_id" { - description = "id for monitor postgresql_compute_consumption" - value = "${datadog_monitor.postgresql_compute_consumption.*.id}" -} From 67adeabbd8584ab5710ca3aba356ed36665a3ac9 Mon Sep 17 00:00:00 2001 From: Alexandre Gaillet Date: Mon, 31 Dec 2018 14:56:05 +0100 Subject: [PATCH 3/3] MON-383 - Inputs removed --- cloud/azure/mysql/README.md | 8 ------ cloud/azure/mysql/inputs.tf | 46 -------------------------------- cloud/azure/postgresql/README.md | 8 ------ cloud/azure/postgresql/inputs.tf | 46 -------------------------------- 4 files changed, 108 deletions(-) diff --git a/cloud/azure/mysql/README.md b/cloud/azure/mysql/README.md index 4927f8d..dbaf50b 100644 --- a/cloud/azure/mysql/README.md +++ b/cloud/azure/mysql/README.md @@ -26,14 +26,6 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| -| compute_consumption_enabled | Flag to enable Mysql status monitor | string | `true` | no | -| compute_consumption_extra_tags | Extra tags for Mysql status monitor | list | `[]` | no | -| compute_consumption_message | Custom message for Mysql compute consumption monitor | string | `` | no | -| compute_consumption_silenced | Groups to mute for Mysql compute consumption monitor | map | `{}` | no | -| compute_consumption_threshold_critical | Mysql compute consumption in percent (critical threshold) | string | `90` | no | -| compute_consumption_threshold_warning | Mysql compute consumption in percent (warning threshold) | string | `80` | no | -| compute_consumption_time_aggregator | Monitor aggregator for Mysql compute consumption [available values: min, max or avg] | string | `min` | no | -| compute_consumption_timeframe | Monitor timeframe for Mysql compute consumption [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | | cpu_usage_enabled | Flag to enable Mysql status monitor | string | `true` | no | | cpu_usage_extra_tags | Extra tags for Mysql status monitor | list | `[]` | no | | cpu_usage_message | Custom message for Mysql CPU monitor | string | `` | no | diff --git a/cloud/azure/mysql/inputs.tf b/cloud/azure/mysql/inputs.tf index 6a37a24..403ab71 100644 --- a/cloud/azure/mysql/inputs.tf +++ b/cloud/azure/mysql/inputs.tf @@ -204,52 +204,6 @@ variable "io_consumption_threshold_critical" { default = "90" } -variable "compute_consumption_silenced" { - description = "Groups to mute for Mysql compute consumption monitor" - type = "map" - default = {} -} - -variable "compute_consumption_enabled" { - description = "Flag to enable Mysql status monitor" - type = "string" - default = "true" -} - -variable "compute_consumption_extra_tags" { - description = "Extra tags for Mysql status monitor" - type = "list" - default = [] -} - -variable "compute_consumption_message" { - description = "Custom message for Mysql compute consumption monitor" - type = "string" - default = "" -} - -variable "compute_consumption_time_aggregator" { - description = "Monitor aggregator for Mysql compute consumption [available values: min, max or avg]" - type = "string" - default = "min" -} - -variable "compute_consumption_timeframe" { - description = "Monitor timeframe for Mysql compute consumption [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = "string" - default = "last_15m" -} - -variable "compute_consumption_threshold_warning" { - description = "Mysql compute consumption in percent (warning threshold)" - default = "80" -} - -variable "compute_consumption_threshold_critical" { - description = "Mysql compute consumption in percent (critical threshold)" - default = "90" -} - variable "memory_usage_silenced" { description = "Groups to mute for Mysql memory monitor" type = "map" diff --git a/cloud/azure/postgresql/README.md b/cloud/azure/postgresql/README.md index 0b96275..ec6bd94 100644 --- a/cloud/azure/postgresql/README.md +++ b/cloud/azure/postgresql/README.md @@ -26,14 +26,6 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| -| compute_consumption_enabled | Flag to enable PostgreSQL status monitor | string | `true` | no | -| compute_consumption_extra_tags | Extra tags for PostgreSQL status monitor | list | `[]` | no | -| compute_consumption_message | Custom message for PostgreSQL compute consumption monitor | string | `` | no | -| compute_consumption_silenced | Groups to mute for PostgreSQL compute consumption monitor | map | `{}` | no | -| compute_consumption_threshold_critical | PostgreSQL compute consumption in percent (critical threshold) | string | `90` | no | -| compute_consumption_threshold_warning | PostgreSQL compute consumption in percent (warning threshold) | string | `80` | no | -| compute_consumption_time_aggregator | Monitor aggregator for PostgreSQL compute consumption [available values: min, max or avg] | string | `min` | no | -| compute_consumption_timeframe | Monitor timeframe for PostgreSQL compute consumption [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | | cpu_usage_enabled | Flag to enable PostgreSQL status monitor | string | `true` | no | | cpu_usage_extra_tags | Extra tags for PostgreSQL status monitor | list | `[]` | no | | cpu_usage_message | Custom message for PostgreSQL CPU monitor | string | `` | no | diff --git a/cloud/azure/postgresql/inputs.tf b/cloud/azure/postgresql/inputs.tf index fa3411a..9e24b6e 100644 --- a/cloud/azure/postgresql/inputs.tf +++ b/cloud/azure/postgresql/inputs.tf @@ -204,52 +204,6 @@ variable "io_consumption_threshold_critical" { default = "90" } -variable "compute_consumption_silenced" { - description = "Groups to mute for PostgreSQL compute consumption monitor" - type = "map" - default = {} -} - -variable "compute_consumption_enabled" { - description = "Flag to enable PostgreSQL status monitor" - type = "string" - default = "true" -} - -variable "compute_consumption_extra_tags" { - description = "Extra tags for PostgreSQL status monitor" - type = "list" - default = [] -} - -variable "compute_consumption_message" { - description = "Custom message for PostgreSQL compute consumption monitor" - type = "string" - default = "" -} - -variable "compute_consumption_time_aggregator" { - description = "Monitor aggregator for PostgreSQL compute consumption [available values: min, max or avg]" - type = "string" - default = "min" -} - -variable "compute_consumption_timeframe" { - description = "Monitor timeframe for PostgreSQL compute consumption [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = "string" - default = "last_15m" -} - -variable "compute_consumption_threshold_warning" { - description = "PostgreSQL compute consumption in percent (warning threshold)" - default = "80" -} - -variable "compute_consumption_threshold_critical" { - description = "PostgreSQL compute consumption in percent (critical threshold)" - default = "90" -} - variable "memory_usage_silenced" { description = "Groups to mute for PostgreSQL memory monitor" type = "map"