From f24782e4063514ce78f4f0b2a121ee21b03b66b2 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Fri, 14 Sep 2018 13:25:32 +0200 Subject: [PATCH] MON-162 add missing enabled feature --- cloud/gcp/big-query/README.md | 23 +- cloud/gcp/big-query/inputs.tf | 75 +++++-- cloud/gcp/big-query/monitors-big-query.tf | 9 + cloud/gcp/cloud-sql/common/README.md | 6 + cloud/gcp/cloud-sql/common/inputs.tf | 36 ++++ .../common/monitors-cloud-sql-common.tf | 6 + cloud/gcp/cloud-sql/mysql/README.md | 1 + cloud/gcp/cloud-sql/mysql/inputs.tf | 6 + .../mysql/monitors-cloudsql-mysql.tf | 1 + cloud/gcp/lb/README.md | 5 + cloud/gcp/lb/inputs.tf | 30 +++ cloud/gcp/lb/monitors-lb.tf | 5 + cloud/gcp/pubsub/README.md | 2 + cloud/gcp/pubsub/inputs.tf | 12 ++ cloud/gcp/pubsub/monitors-pubsub.tf | 2 + database/elasticsearch/README.md | 22 ++ database/elasticsearch/inputs.tf | 132 ++++++++++++ .../elasticsearch/monitors-elasticsearch.tf | 22 ++ database/mysql/README.md | 22 +- database/mysql/inputs.tf | 204 +++++++++++------- database/mysql/monitors-mysql.tf | 8 + middleware/nginx/README.md | 1 + middleware/nginx/inputs.tf | 6 + middleware/nginx/monitors-nginx.tf | 1 + 24 files changed, 531 insertions(+), 106 deletions(-) diff --git a/cloud/gcp/big-query/README.md b/cloud/gcp/big-query/README.md index 1d1c088..ee3a59a 100644 --- a/cloud/gcp/big-query/README.md +++ b/cloud/gcp/big-query/README.md @@ -30,12 +30,14 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| available_slots_enabled | Flag to enable GCP Big Query Available Slots monitor | string | `true` | no | | available_slots_extra_tags | Extra tags for GCP Big Query Available Slots monitor | list | `` | no | | available_slots_message | Custom message for the Available Slots monitor | string | `` | no | | available_slots_silenced | Groups to mute for GCP Big Query Available Slots monitor. | map | `` | no | | available_slots_threshold_critical | Available Slots (critical threshold) | string | `200` | no | | available_slots_threshold_warning | Available Slots (warning threshold) | string | `300` | no | | available_slots_timeframe | Timeframe for the Available Slots monitor | string | `last_5m` | no | +| concurrent_queries_enabled | Flag to enable GCP Big Query Concurrent Queries monitor | string | `true` | no | | concurrent_queries_extra_tags | Extra tags for GCP Big Query Concurrent Queries monitor | list | `` | no | | concurrent_queries_message | Custom message for the Concurrent Queries monitor | string | `` | no | | concurrent_queries_silenced | Groups to mute for GCP Big Query Concurrent Queries monitor | map | `` | no | @@ -44,48 +46,55 @@ Creates DataDog monitors with the following checks: | concurrent_queries_timeframe | Timeframe for the Concurrent Queries monitor | string | `last_5m` | no | | environment | Architecture environment | string | - | yes | | evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | +| execution_time_enabled | Flag to enable GCP Big Query Execution Time monitor | string | `true` | no | | execution_time_extra_tags | Extra tags for GCP Big Query Execution Time monitor | list | `` | no | | execution_time_message | Custom message for the Execution Time monitor | string | `` | no | -| execution_time_silenced | Groups to mute for GCP Big Query Execution Time monitor. Muted by default. | map | `` | no | +| execution_time_silenced | Groups to mute for GCP Big Query Execution Time monitor. | map | `` | no | | execution_time_threshold_critical | Average Execution Time in seconds (critical threshold) | string | `150` | no | | execution_time_threshold_warning | Average Execution Time in seconds (warning threshold) | string | `100` | no | | execution_time_timeframe | Timeframe for the Execution Time monitor | string | `last_5m` | no | | filter_tags | Tags used for filtering | string | `*` | no | | message | Message sent when a monitor is triggered | string | - | yes | | new_host_delay | Delay in seconds for the new host evaluation | string | `300` | no | +| scanned_bytes_billed_enabled | Flag to enable GCP Big Query Scanned Bytes Billed monitor | string | `true` | no | | scanned_bytes_billed_extra_tags | Extra tags for GCP Big Query Scanned Bytes Billed monitor | list | `` | no | | scanned_bytes_billed_message | Custom message for the Scanned Bytes Billed monitor | string | `` | no | -| scanned_bytes_billed_silenced | Groups to mute for GCP Big Query Scanned Bytes Billed monitor. Muted by default. | map | `` | no | +| scanned_bytes_billed_silenced | Groups to mute for GCP Big Query Scanned Bytes Billed monitor. | map | `` | no | | scanned_bytes_billed_threshold_critical | Scanned Bytes Billed (critical threshold) | string | `1` | no | | scanned_bytes_billed_threshold_warning | Scanned Bytes Billed (warning threshold) | string | `0` | no | | scanned_bytes_billed_timeframe | Timeframe for the Scanned Bytes Billed monitor | string | `last_4h` | no | +| scanned_bytes_enabled | Flag to enable GCP Big Query Scanned Bytes monitor | string | `true` | no | | scanned_bytes_extra_tags | Extra tags for GCP Big Query Scanned Bytes monitor | list | `` | no | | scanned_bytes_message | Custom message for the Scanned Bytes monitor | string | `` | no | -| scanned_bytes_silenced | Groups to mute for GCP Big Query Scanned Bytes monitor. Muted by default. | map | `` | no | +| scanned_bytes_silenced | Groups to mute for GCP Big Query Scanned Bytes monitor. | map | `` | no | | scanned_bytes_threshold_critical | Scanned Bytes (critical threshold) | string | `1` | no | | scanned_bytes_threshold_warning | Scanned Bytes (warning threshold) | string | `0` | no | | scanned_bytes_timeframe | Timeframe for the Scanned Bytes monitor | string | `last_4h` | no | +| stored_bytes_enabled | Flag to enable GCP Big Query Stored Bytes monitor | string | `true` | no | | stored_bytes_extra_tags | Extra tags for GCP Big Query Stored Bytes monitor | list | `` | no | | stored_bytes_message | Custom message for the Stored Bytes monitor | string | `` | no | -| stored_bytes_silenced | Groups to mute for GCP Big Query Stored Bytes monitor. Muted by default. | map | `` | no | +| stored_bytes_silenced | Groups to mute for GCP Big Query Stored Bytes monitor. | map | `` | no | | stored_bytes_threshold_critical | Stored Bytes in fraction (critical threshold) | string | `1` | no | | stored_bytes_threshold_warning | Stored Bytes in fraction (warning threshold) | string | `0` | no | | stored_bytes_timeframe | Timeframe for the Stored Bytes monitor | string | `last_5m` | no | +| table_count_enabled | Flag to enable GCP Big Query Table Count monitor | string | `true` | no | | table_count_extra_tags | Extra tags for GCP Big Query Table Count monitor | list | `` | no | | table_count_message | Custom message for the Table Count monitor | string | `` | no | -| table_count_silenced | Groups to mute for GCP Big Query Table Count monitor. Muted by default. | map | `` | no | +| table_count_silenced | Groups to mute for GCP Big Query Table Count monitor. | map | `` | no | | table_count_threshold_critical | Table Count (critical threshold) | string | `1` | no | | table_count_threshold_warning | Table Count (warning threshold) | string | `0` | no | | table_count_timeframe | Timeframe for the Table Count monitor | string | `last_4h` | no | +| uploaded_bytes_billed_enabled | Flag to enable GCP Big Query Uploaded Bytes Billed monitor | string | `true` | no | | uploaded_bytes_billed_extra_tags | Extra tags for GCP Big Query Scanned Bytes monitor | list | `` | no | | uploaded_bytes_billed_message | Custom message for the Uploaded Bytes Billed monitor | string | `` | no | -| uploaded_bytes_billed_silenced | Groups to mute for GCP Big Query Uploaded Bytes Billed monitor. Muted by default. | map | `` | no | +| uploaded_bytes_billed_silenced | Groups to mute for GCP Big Query Uploaded Bytes Billed monitor. | map | `` | no | | uploaded_bytes_billed_threshold_critical | Uploaded Bytes Billed (critical threshold) | string | `1` | no | | uploaded_bytes_billed_threshold_warning | Uploaded Bytes Billed (warning threshold) | string | `0` | no | | uploaded_bytes_billed_timeframe | Timeframe for the Uploaded Bytes Billed monitor | string | `last_4h` | no | +| uploaded_bytes_enabled | Flag to enable GCP Big Query Uploaded Bytes monitor | string | `true` | no | | uploaded_bytes_extra_tags | Extra tags for GCP Big Query Uploaded Bytes monitor | list | `` | no | | uploaded_bytes_message | Custom message for the Uploaded Bytes monitor | string | `` | no | -| uploaded_bytes_silenced | Groups to mute for GCP Big Query Uploaded Bytes monitor. Muted by default. | map | `` | no | +| uploaded_bytes_silenced | Groups to mute for GCP Big Query Uploaded Bytes monitor. | map | `` | no | | uploaded_bytes_threshold_critical | Uploaded Bytes (critical threshold) | string | `1` | no | | uploaded_bytes_threshold_warning | Uploaded Bytes (warning threshold) | string | `0` | no | | uploaded_bytes_timeframe | Timeframe for the Uploaded Bytes monitor | string | `last_4h` | no | diff --git a/cloud/gcp/big-query/inputs.tf b/cloud/gcp/big-query/inputs.tf index e6ad0bb..c12537c 100644 --- a/cloud/gcp/big-query/inputs.tf +++ b/cloud/gcp/big-query/inputs.tf @@ -60,6 +60,12 @@ variable "concurrent_queries_silenced" { default = {} } +variable "concurrent_queries_enabled" { + description = "Flag to enable GCP Big Query Concurrent Queries monitor" + type = "string" + default = "true" +} + variable "concurrent_queries_extra_tags" { description = "Extra tags for GCP Big Query Concurrent Queries monitor" type = "list" @@ -95,10 +101,15 @@ variable "execution_time_threshold_critical" { } variable "execution_time_silenced" { - description = "Groups to mute for GCP Big Query Execution Time monitor. Muted by default." + description = "Groups to mute for GCP Big Query Execution Time monitor." type = "map" + default = {} +} - default = {} +variable "execution_time_enabled" { + description = "Flag to enable GCP Big Query Execution Time monitor" + type = "string" + default = "true" } variable "execution_time_extra_tags" { @@ -136,10 +147,15 @@ variable "scanned_bytes_threshold_critical" { } variable "scanned_bytes_silenced" { - description = "Groups to mute for GCP Big Query Scanned Bytes monitor. Muted by default." + description = "Groups to mute for GCP Big Query Scanned Bytes monitor." type = "map" + default = {} +} - default = {} +variable "scanned_bytes_enabled" { + description = "Flag to enable GCP Big Query Scanned Bytes monitor" + type = "string" + default = "true" } variable "scanned_bytes_extra_tags" { @@ -177,10 +193,15 @@ variable "scanned_bytes_billed_threshold_critical" { } variable "scanned_bytes_billed_silenced" { - description = "Groups to mute for GCP Big Query Scanned Bytes Billed monitor. Muted by default." + description = "Groups to mute for GCP Big Query Scanned Bytes Billed monitor." type = "map" + default = {} +} - default = {} +variable "scanned_bytes_billed_enabled" { + description = "Flag to enable GCP Big Query Scanned Bytes Billed monitor" + type = "string" + default = "true" } variable "scanned_bytes_billed_extra_tags" { @@ -223,6 +244,12 @@ variable "available_slots_silenced" { default = {} } +variable "available_slots_enabled" { + description = "Flag to enable GCP Big Query Available Slots monitor" + type = "string" + default = "true" +} + variable "available_slots_extra_tags" { description = "Extra tags for GCP Big Query Available Slots monitor" type = "list" @@ -258,10 +285,15 @@ variable "stored_bytes_threshold_critical" { } variable "stored_bytes_silenced" { - description = "Groups to mute for GCP Big Query Stored Bytes monitor. Muted by default." + description = "Groups to mute for GCP Big Query Stored Bytes monitor." type = "map" + default = {} +} - default = {} +variable "stored_bytes_enabled" { + description = "Flag to enable GCP Big Query Stored Bytes monitor" + type = "string" + default = "true" } variable "stored_bytes_extra_tags" { @@ -299,10 +331,15 @@ variable "table_count_threshold_critical" { } variable "table_count_silenced" { - description = "Groups to mute for GCP Big Query Table Count monitor. Muted by default." + description = "Groups to mute for GCP Big Query Table Count monitor." type = "map" + default = {} +} - default = {} +variable "table_count_enabled" { + description = "Flag to enable GCP Big Query Table Count monitor" + type = "string" + default = "true" } variable "table_count_extra_tags" { @@ -340,10 +377,15 @@ variable "uploaded_bytes_threshold_critical" { } variable "uploaded_bytes_silenced" { - description = "Groups to mute for GCP Big Query Uploaded Bytes monitor. Muted by default." + description = "Groups to mute for GCP Big Query Uploaded Bytes monitor." type = "map" + default = {} +} - default = {} +variable "uploaded_bytes_enabled" { + description = "Flag to enable GCP Big Query Uploaded Bytes monitor" + type = "string" + default = "true" } variable "uploaded_bytes_extra_tags" { @@ -381,10 +423,15 @@ variable "uploaded_bytes_billed_threshold_critical" { } variable "uploaded_bytes_billed_silenced" { - description = "Groups to mute for GCP Big Query Uploaded Bytes Billed monitor. Muted by default." + description = "Groups to mute for GCP Big Query Uploaded Bytes Billed monitor." type = "map" + default = {} +} - default = {} +variable "uploaded_bytes_billed_enabled" { + description = "Flag to enable GCP Big Query Uploaded Bytes Billed monitor" + type = "string" + default = "true" } variable "uploaded_bytes_billed_extra_tags" { diff --git a/cloud/gcp/big-query/monitors-big-query.tf b/cloud/gcp/big-query/monitors-big-query.tf index 5c0afbd..91d92be 100644 --- a/cloud/gcp/big-query/monitors-big-query.tf +++ b/cloud/gcp/big-query/monitors-big-query.tf @@ -2,6 +2,7 @@ # Concurrent queries # resource "datadog_monitor" "concurrent_queries" { + count = "${var.concurrent_queries_enabled ? 1 : 0}" name = "[${var.environment}] GCP Big Query Concurrent Queries {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.concurrent_queries_message, var.message)}" @@ -37,6 +38,7 @@ EOF # Execution Time # resource "datadog_monitor" "execution_time" { + count = "${var.execution_time_enabled ? 1 : 0}" name = "[${var.environment}] GCP Big Query Execution Time {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" message = "${coalesce(var.execution_time_message, var.message)}" @@ -72,6 +74,7 @@ EOF # Scanned Bytes # resource "datadog_monitor" "scanned_bytes" { + count = "${var.scanned_bytes_enabled ? 1 : 0}" name = "[${var.environment}] GCP Big Query Scanned Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = "${coalesce(var.scanned_bytes_message, var.message)}" @@ -107,6 +110,7 @@ EOF # Scanned Bytes Billed # resource "datadog_monitor" "scanned_bytes_billed" { + count = "${var.scanned_bytes_billed_enabled ? 1 : 0}" name = "[${var.environment}] GCP Big Query Scanned Bytes Billed {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = "${coalesce(var.scanned_bytes_billed_message, var.message)}" @@ -142,6 +146,7 @@ EOF # Available Slots # resource "datadog_monitor" "available_slots" { + count = "${var.available_slots_enabled ? 1 : 0}" name = "[${var.environment}] GCP Big Query Available Slots {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.available_slots_message, var.message)}" @@ -177,6 +182,7 @@ EOF # Stored Bytes # resource "datadog_monitor" "stored_bytes" { + count = "${var.stored_bytes_enabled ? 1 : 0}" name = "[${var.environment}] GCP Big Query Stored Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B ({{value}}B){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B ({{value}}B){{/is_warning}}" message = "${coalesce(var.stored_bytes_message, var.message)}" @@ -212,6 +218,7 @@ EOF # Table Count # resource "datadog_monitor" "table_count" { + count = "${var.table_count_enabled ? 1 : 0}" name = "[${var.environment}] GCP Big Query Table Count {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.table_count_message, var.message)}" @@ -247,6 +254,7 @@ EOF # Uploaded Bytes # resource "datadog_monitor" "uploaded_bytes" { + count = "${var.uploaded_bytes_enabled ? 1 : 0}" name = "[${var.environment}] GCP Big Query Uploaded Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = "${coalesce(var.uploaded_bytes_message, var.message)}" @@ -282,6 +290,7 @@ EOF # Uploaded Bytes Billed # resource "datadog_monitor" "uploaded_bytes_billed" { + count = "${var.uploaded_bytes_billed_enabled ? 1 : 0}" name = "[${var.environment}] GCP Big Query Uploaded Bytes Billed {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = "${coalesce(var.uploaded_bytes_billed_message, var.message)}" diff --git a/cloud/gcp/cloud-sql/common/README.md b/cloud/gcp/cloud-sql/common/README.md index 879b1b8..5b88825 100644 --- a/cloud/gcp/cloud-sql/common/README.md +++ b/cloud/gcp/cloud-sql/common/README.md @@ -27,6 +27,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| cpu_utilization_enabled | Flag to enable GCP Cloud SQL CPU Utilization monitor | string | `true` | no | | cpu_utilization_extra_tags | Extra tags for GCP Cloud SQL CPU Utilization monitor | list | `` | no | | cpu_utilization_message | Custom message for the CPU Utilization monitor | string | `` | no | | cpu_utilization_silenced | Groups to mute for GCP Cloud SQL CPU Utilization monitor | map | `` | no | @@ -34,9 +35,11 @@ Creates DataDog monitors with the following checks: | cpu_utilization_threshold_warning | CPU Utilization in percentage (warning threshold) | string | `80` | no | | cpu_utilization_time_aggregator | Time aggregator for the CPU Utilization monitor | string | `avg` | no | | cpu_utilization_timeframe | Timeframe for the CPU Utilization monitor | string | `last_15m` | no | +| disk_utilization_enabled | Flag to enable GCP Cloud SQL Disk Utilization monitor | string | `true` | no | | disk_utilization_extra_tags | Extra tags for GCP Cloud SQL CPU Utilization monitor | list | `` | no | | disk_utilization_forecast_algorithm | Algorithm for the Disk Utilization Forecast monitor | string | `linear` | no | | disk_utilization_forecast_deviations | Deviations for the Disk Utilization Forecast monitor | string | `1` | no | +| disk_utilization_forecast_enabled | Flag to enable GCP Cloud SQL Disk Utilization Forecast monitor | string | `true` | no | | disk_utilization_forecast_extra_tags | Extra tags for GCP Cloud SQL Disk Utilization Forecast monitor | list | `` | no | | disk_utilization_forecast_interval | Interval for the Disk Utilization Forecast monitor | string | `60m` | no | | disk_utilization_forecast_linear_history | History for the Disk Utilization Forecast monitor | string | `3d` | no | @@ -56,6 +59,7 @@ Creates DataDog monitors with the following checks: | disk_utilization_timeframe | Timeframe for the Disk Utilization monitor | string | `last_5m` | no | | environment | Architecture environment | string | - | yes | | evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | +| failover_unavailable_enabled | Flag to enable GCP Cloud SQL Failover Unavailable monitor | string | `true` | no | | failover_unavailable_extra_tags | Extra tags for GCP Cloud SQL Failover Unavailable monitor | list | `` | no | | failover_unavailable_message | Custom message for the Failover Unavailable monitor | string | `` | no | | failover_unavailable_silenced | Groups to mute for GCP Cloud SQL Failover Unavailable monitor | map | `` | no | @@ -63,9 +67,11 @@ Creates DataDog monitors with the following checks: | failover_unavailable_time_aggregator | Time aggreggator for the Failover Unavailable monitor | string | `max` | no | | failover_unavailable_timeframe | Timeframe for the Failover Unavailable monitor | string | `last_5m` | no | | filter_tags | Tags used for filtering | string | `*` | no | +| memory_utilization_enabled | Flag to enable GCP Cloud SQL Memory Utilization monitor | string | `true` | no | | memory_utilization_extra_tags | Extra tags for GCP Cloud SQL Memory Utilization monitor | list | `` | no | | memory_utilization_forecast_algorithm | Algorithm for the Memory Utilization Forecast monitor | string | `linear` | no | | memory_utilization_forecast_deviations | Deviations for the Memory Utilization Forecast monitor | string | `1` | no | +| memory_utilization_forecast_enabled | Flag to enable GCP Cloud SQL Memory Utilization Forecast monitor | string | `true` | no | | memory_utilization_forecast_extra_tags | Extra tags for GCP Cloud SQL Memory Utilization Forecast monitor | list | `` | no | | memory_utilization_forecast_interval | Interval for the Memory Utilization Forecast monitor | string | `30m` | no | | memory_utilization_forecast_linear_history | History for the Memory Utilization Forecast monitor | string | `12h` | no | diff --git a/cloud/gcp/cloud-sql/common/inputs.tf b/cloud/gcp/cloud-sql/common/inputs.tf index e0a2ea8..4845487 100644 --- a/cloud/gcp/cloud-sql/common/inputs.tf +++ b/cloud/gcp/cloud-sql/common/inputs.tf @@ -65,6 +65,12 @@ variable "cpu_utilization_silenced" { default = {} } +variable "cpu_utilization_enabled" { + description = "Flag to enable GCP Cloud SQL CPU Utilization monitor" + type = "string" + default = "true" +} + variable "cpu_utilization_extra_tags" { description = "Extra tags for GCP Cloud SQL CPU Utilization monitor" type = "list" @@ -111,6 +117,12 @@ variable "disk_utilization_silenced" { default = {} } +variable "disk_utilization_enabled" { + description = "Flag to enable GCP Cloud SQL Disk Utilization monitor" + type = "string" + default = "true" +} + variable "disk_utilization_extra_tags" { description = "Extra tags for GCP Cloud SQL CPU Utilization monitor" type = "list" @@ -193,6 +205,12 @@ variable "disk_utilization_forecast_silenced" { default = {} } +variable "disk_utilization_forecast_enabled" { + description = "Flag to enable GCP Cloud SQL Disk Utilization Forecast monitor" + type = "string" + default = "true" +} + variable "disk_utilization_forecast_extra_tags" { description = "Extra tags for GCP Cloud SQL Disk Utilization Forecast monitor" type = "list" @@ -234,6 +252,12 @@ variable "memory_utilization_silenced" { default = {} } +variable "memory_utilization_enabled" { + description = "Flag to enable GCP Cloud SQL Memory Utilization monitor" + type = "string" + default = "true" +} + variable "memory_utilization_extra_tags" { description = "Extra tags for GCP Cloud SQL Memory Utilization monitor" type = "list" @@ -311,6 +335,12 @@ variable "memory_utilization_forecast_silenced" { default = {} } +variable "memory_utilization_forecast_enabled" { + description = "Flag to enable GCP Cloud SQL Memory Utilization Forecast monitor" + type = "string" + default = "true" +} + variable "memory_utilization_forecast_extra_tags" { description = "Extra tags for GCP Cloud SQL Memory Utilization Forecast monitor" type = "list" @@ -351,6 +381,12 @@ variable "failover_unavailable_silenced" { default = {} } +variable "failover_unavailable_enabled" { + description = "Flag to enable GCP Cloud SQL Failover Unavailable monitor" + type = "string" + default = "true" +} + variable "failover_unavailable_extra_tags" { description = "Extra tags for GCP Cloud SQL Failover Unavailable monitor" type = "list" diff --git a/cloud/gcp/cloud-sql/common/monitors-cloud-sql-common.tf b/cloud/gcp/cloud-sql/common/monitors-cloud-sql-common.tf index f4c5c60..541b67c 100644 --- a/cloud/gcp/cloud-sql/common/monitors-cloud-sql-common.tf +++ b/cloud/gcp/cloud-sql/common/monitors-cloud-sql-common.tf @@ -2,6 +2,7 @@ # CPU Utilization # resource "datadog_monitor" "cpu_utilization" { + count = "${var.cpu_utilization_enabled ? 1 : 0}" name = "[${var.environment}] Cloud SQL CPU Utilization {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_utilization_message, var.message)}" @@ -39,6 +40,7 @@ EOF # Disk Utilization # resource "datadog_monitor" "disk_utilization" { + count = "${var.disk_utilization_enabled ? 1 : 0}" name = "[${var.environment}] Cloud SQL Disk Utilization {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.disk_utilization_message, var.message)}" @@ -76,6 +78,7 @@ EOF # Disk Utilization Forecast # resource "datadog_monitor" "disk_utilization_forecast" { + count = "${var.disk_utilization_forecast_enabled ? 1 : 0}" name = "[${var.environment}] Cloud SQL Disk Utilization could reach {{#is_alert}}{{threshold}}%{{/is_alert}} in a near future" message = "${coalesce(var.disk_utilization_forecast_message, var.message)}" @@ -119,6 +122,7 @@ EOF # Memory Utilization # resource "datadog_monitor" "memory_utilization" { + count = "${var.memory_utilization_enabled ? 1 : 0}" name = "[${var.environment}] Cloud SQL Memory Utilization {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.memory_utilization_message, var.message)}" @@ -156,6 +160,7 @@ EOF # Memory Utilization Forecast # resource "datadog_monitor" "memory_utilization_forecast" { + count = "${var.memory_utilization_forecast_enabled ? 1 : 0}" name = "[${var.environment}] Cloud SQL Memory Utilization could reach {{#is_alert}}{{threshold}}%{{/is_alert}} in a near future" message = "${coalesce(var.memory_utilization_forecast_message, var.message)}" @@ -199,6 +204,7 @@ EOF # Failover Unavailable # resource "datadog_monitor" "failover_unavailable" { + count = "${var.failover_unavailable_enabled ? 1 : 0}" name = "[${var.environment}] Cloud SQL Failover Unavailable" message = "${coalesce(var.failover_unavailable_message, var.message)}" diff --git a/cloud/gcp/cloud-sql/mysql/README.md b/cloud/gcp/cloud-sql/mysql/README.md index 9af6c43..499075a 100644 --- a/cloud/gcp/cloud-sql/mysql/README.md +++ b/cloud/gcp/cloud-sql/mysql/README.md @@ -27,6 +27,7 @@ Creates DataDog monitors with the following checks: | filter_tags | Tags used for filtering | string | `*` | no | | message | Message sent when a monitor is triggered | string | - | yes | | new_host_delay | Delay in seconds for the new host evaluation | string | `300` | no | +| replication_lag_enabled | Flag to enable GCP Cloud SQL Replication Lag monitor | string | `true` | no | | replication_lag_extra_tags | Extra tags for GCP Cloud SQL SQL Replication monitor | list | `` | no | | replication_lag_message | Custom message for the Replication Lag monitor | string | `` | no | | replication_lag_silenced | Groups to mute for GCP Cloud SQL Replication Lag monitor | map | `` | no | diff --git a/cloud/gcp/cloud-sql/mysql/inputs.tf b/cloud/gcp/cloud-sql/mysql/inputs.tf index 0b3c567..6305ffd 100644 --- a/cloud/gcp/cloud-sql/mysql/inputs.tf +++ b/cloud/gcp/cloud-sql/mysql/inputs.tf @@ -65,6 +65,12 @@ variable "replication_lag_silenced" { default = {} } +variable "replication_lag_enabled" { + description = "Flag to enable GCP Cloud SQL Replication Lag monitor" + type = "string" + default = "true" +} + variable "replication_lag_extra_tags" { description = "Extra tags for GCP Cloud SQL SQL Replication monitor" type = "list" diff --git a/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf b/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf index 0e0fd1c..b8891b5 100644 --- a/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf +++ b/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf @@ -2,6 +2,7 @@ # Replication Lag # resource "datadog_monitor" "replication_lag" { + count = "${var.replication_lag_enabled ? 1 : 0}" name = "[${var.environment}] Cloud SQL MySQL Replication Lag {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" message = "${coalesce(var.replication_lag_message, var.message)}" diff --git a/cloud/gcp/lb/README.md b/cloud/gcp/lb/README.md index 95b0a91..d2fd4c8 100644 --- a/cloud/gcp/lb/README.md +++ b/cloud/gcp/lb/README.md @@ -26,6 +26,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| backend_latency_bucket_enabled | Flag to enable GCP LB Backend Latency monitor | string | `true` | no | | backend_latency_bucket_extra_tags | Extra tags for GCP LB Backend Latency monitor | list | `` | no | | backend_latency_bucket_message | Custom message for the GCP LB Backend Latency monitor | string | `` | no | | backend_latency_bucket_silenced | Groups to mute for GCP LB Backend Latency monitor | map | `` | no | @@ -33,6 +34,7 @@ Creates DataDog monitors with the following checks: | backend_latency_bucket_threshold_warning | Latency in milliseconds (warning threshold) | string | `4000` | no | | backend_latency_bucket_time_aggregator | Timeframe for the GCP LB Backend Latency monitor | string | `min` | no | | backend_latency_bucket_timeframe | Timeframe for the GCP LB Backend Latency monitor | string | `last_10m` | no | +| backend_latency_service_enabled | Flag to enable GCP LB Backend Latency monitor | string | `true` | no | | backend_latency_service_extra_tags | Extra tags for GCP LB Backend Latency monitor | list | `` | no | | backend_latency_service_message | Custom message for the GCP LB Backend Latency monitor | string | `` | no | | backend_latency_service_silenced | Groups to mute for GCP LB Backend Latency monitor | map | `` | no | @@ -42,6 +44,7 @@ Creates DataDog monitors with the following checks: | backend_latency_service_timeframe | Timeframe for the GCP LB Backend Latency monitor | string | `last_10m` | no | | environment | Architecture environment | string | - | yes | | error_rate_4xx_artificial_request | Divisor Delta for the GCP LB 4XX Errors monitor | string | `5` | no | +| error_rate_4xx_enabled | Flag to enable GCP LB 4XX Errors monitor | string | `true` | no | | error_rate_4xx_extra_tags | Extra tags for GCP LB 4XX Errors monitor | list | `` | no | | error_rate_4xx_message | Custom message for the GCP LB 4XX Errors monitor | string | `` | no | | error_rate_4xx_silenced | Groups to mute for GCP LB 4XX Errors monitor | map | `` | no | @@ -50,6 +53,7 @@ Creates DataDog monitors with the following checks: | error_rate_4xx_time_aggregator | Timeframe for the GCP LB 4XX Errors monitor | string | `sum` | no | | error_rate_4xx_timeframe | Timeframe for the GCP LB 4XX Errors monitor | string | `last_5m` | no | | error_rate_5xx_artificial_request | Divisor Delta for the GCP LB 5XX Errors monitor | string | `5` | no | +| error_rate_5xx_enabled | Flag to enable GCP LB 5XX Errors monitor | string | `true` | no | | error_rate_5xx_extra_tags | Extra tags for GCP LB 5XX Errors monitor | list | `` | no | | error_rate_5xx_message | Custom message for the GCP LB 5XX Errors monitor | string | `` | no | | error_rate_5xx_silenced | Groups to mute for GCP LB 5XX Errors monitor | map | `` | no | @@ -61,6 +65,7 @@ Creates DataDog monitors with the following checks: | filter_tags | Tags used for filtering | string | `*` | no | | message | Message sent when a monitor is triggered | string | - | yes | | new_host_delay | Delay in seconds for the new host evaluation | string | `300` | no | +| request_count_enabled | Flag to enable GCP LB Request Count monitor | string | `true` | no | | request_count_extra_tags | Extra tags for GCP LB Request Count monitor | list | `` | no | | request_count_message | Custom message for the GCP LB Request Count monitor | string | `` | no | | request_count_silenced | Groups to mute for GCP LB Request Count monitor | map | `` | no | diff --git a/cloud/gcp/lb/inputs.tf b/cloud/gcp/lb/inputs.tf index 9d02c17..1080372 100644 --- a/cloud/gcp/lb/inputs.tf +++ b/cloud/gcp/lb/inputs.tf @@ -70,6 +70,12 @@ variable "error_rate_4xx_silenced" { default = {} } +variable "error_rate_4xx_enabled" { + description = "Flag to enable GCP LB 4XX Errors monitor" + type = "string" + default = "true" +} + variable "error_rate_4xx_extra_tags" { description = "Extra tags for GCP LB 4XX Errors monitor" type = "list" @@ -121,6 +127,12 @@ variable "error_rate_5xx_silenced" { default = {} } +variable "error_rate_5xx_enabled" { + description = "Flag to enable GCP LB 5XX Errors monitor" + type = "string" + default = "true" +} + variable "error_rate_5xx_extra_tags" { description = "Extra tags for GCP LB 5XX Errors monitor" type = "list" @@ -166,6 +178,12 @@ variable "backend_latency_service_silenced" { default = {} } +variable "backend_latency_service_enabled" { + description = "Flag to enable GCP LB Backend Latency monitor" + type = "string" + default = "true" +} + variable "backend_latency_service_extra_tags" { description = "Extra tags for GCP LB Backend Latency monitor" type = "list" @@ -211,6 +229,12 @@ variable "backend_latency_bucket_silenced" { default = {} } +variable "backend_latency_bucket_enabled" { + description = "Flag to enable GCP LB Backend Latency monitor" + type = "string" + default = "true" +} + variable "backend_latency_bucket_extra_tags" { description = "Extra tags for GCP LB Backend Latency monitor" type = "list" @@ -262,6 +286,12 @@ variable "request_count_silenced" { default = {} } +variable "request_count_enabled" { + description = "Flag to enable GCP LB Request Count monitor" + type = "string" + default = "true" +} + variable "request_count_extra_tags" { description = "Extra tags for GCP LB Request Count monitor" type = "list" diff --git a/cloud/gcp/lb/monitors-lb.tf b/cloud/gcp/lb/monitors-lb.tf index 11555ae..f67b47a 100644 --- a/cloud/gcp/lb/monitors-lb.tf +++ b/cloud/gcp/lb/monitors-lb.tf @@ -2,6 +2,7 @@ # 4XX Errors # resource "datadog_monitor" "error_rate_4xx" { + count = "${var.error_rate_4xx_enabled ? 1 : 0}" name = "[${var.environment}] GCP LB 4xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.error_rate_4xx_message, var.message)}" @@ -40,6 +41,7 @@ EOF # 5XX Errors # resource "datadog_monitor" "error_rate_5xx" { + count = "${var.error_rate_5xx_enabled ? 1 : 0}" name = "[${var.environment}] GCP LB 5xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.error_rate_5xx_message, var.message)}" @@ -78,6 +80,7 @@ EOF # Backend Latency for service # resource "datadog_monitor" "backend_latency_service" { + count = "${var.backend_latency_service_enabled ? 1 : 0}" name = "[${var.environment}] GCP LB service backend latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.backend_latency_service_message, var.message)}" @@ -114,6 +117,7 @@ EOF # Backend Latency for bucket # resource "datadog_monitor" "backend_latency_bucket" { + count = "${var.backend_latency_bucket_enabled ? 1 : 0}" name = "[${var.environment}] GCP LB bucket backend latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.backend_latency_bucket_message, var.message)}" @@ -150,6 +154,7 @@ EOF # Request Count # resource "datadog_monitor" "request_count" { + count = "${var.request_count_enabled ? 1 : 0}" name = "[${var.environment}] GCP LB Requests count increased abruptly {{#is_alert}}{{value}}%{{/is_alert}}{{#is_warning}}{{value}}%{{/is_warning}}" message = "${coalesce(var.request_count_message, var.message)}" diff --git a/cloud/gcp/pubsub/README.md b/cloud/gcp/pubsub/README.md index 3ca819c..c8b2a68 100644 --- a/cloud/gcp/pubsub/README.md +++ b/cloud/gcp/pubsub/README.md @@ -28,12 +28,14 @@ Creates DataDog monitors with the following checks: | filter_tags | Tags used for filtering | string | `*` | no | | message | Message sent when a monitor is triggered | string | - | yes | | new_host_delay | Delay in seconds for the new host evaluation | string | `300` | no | +| sending_operations_count_enabled | Flag to enable GCP Pub/Sub Unavailable Sending Operations Count monitor | string | `true` | no | | sending_operations_count_extra_tags | Extra tags for GCP Pub/Sub Sending Operations Count monitor | list | `` | no | | sending_operations_count_message | Custom message for the GCP Pub/Sub Sending Operations Count monitor | string | `` | no | | sending_operations_count_silenced | Groups to mute for GCP Pub/Sub Sending Operations Count monitor | map | `` | no | | sending_operations_count_threshold_critical | Critical threshold for the number of sending operations. | string | `0` | no | | sending_operations_count_time_aggregator | Timeframe for the GCP Pub/Sub Sending Operations Count monitor | string | `sum` | no | | sending_operations_count_timeframe | Timeframe for the GCP Pub/Sub Sending Operations Count monitor | string | `last_30m` | no | +| unavailable_sending_operations_count_enabled | Flag to enable GCP Pub/Sub Unavailable Sending Operations Count monitor | string | `true` | no | | unavailable_sending_operations_count_extra_tags | Extra tags for GCP Pub/Sub Unavailable Sending Operations Count monitor | list | `` | no | | unavailable_sending_operations_count_message | Custom message for the GCP Pub/Sub Unavailable Sending Operations Count monitor | string | `` | no | | unavailable_sending_operations_count_silenced | Groups to mute for GCP Pub/Sub Unavailable Sending Operations Count monitor | map | `` | no | diff --git a/cloud/gcp/pubsub/inputs.tf b/cloud/gcp/pubsub/inputs.tf index eb86ff4..3969240 100644 --- a/cloud/gcp/pubsub/inputs.tf +++ b/cloud/gcp/pubsub/inputs.tf @@ -58,6 +58,12 @@ variable "sending_operations_count_silenced" { default = {} } +variable "sending_operations_count_enabled" { + description = "Flag to enable GCP Pub/Sub Unavailable Sending Operations Count monitor" + type = "string" + default = "true" +} + variable "sending_operations_count_extra_tags" { description = "Extra tags for GCP Pub/Sub Sending Operations Count monitor" type = "list" @@ -103,6 +109,12 @@ variable "unavailable_sending_operations_count_silenced" { default = {} } +variable "unavailable_sending_operations_count_enabled" { + description = "Flag to enable GCP Pub/Sub Unavailable Sending Operations Count monitor" + type = "string" + default = "true" +} + variable "unavailable_sending_operations_count_extra_tags" { description = "Extra tags for GCP Pub/Sub Unavailable Sending Operations Count monitor" type = "list" diff --git a/cloud/gcp/pubsub/monitors-pubsub.tf b/cloud/gcp/pubsub/monitors-pubsub.tf index 6189794..5ce6ea3 100644 --- a/cloud/gcp/pubsub/monitors-pubsub.tf +++ b/cloud/gcp/pubsub/monitors-pubsub.tf @@ -2,6 +2,7 @@ # Sending Operations Count # resource "datadog_monitor" "sending_operations_count" { + count = "${var.sending_operations_count_enabled ? 1 : 0}" name = "[${var.environment}] GCP pubsub sending messages operations {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.sending_operations_count_message, var.message)}" @@ -37,6 +38,7 @@ EOF # Unavailable Sending Operations Count # resource "datadog_monitor" "unavailable_sending_operations_count" { + count = "${var.unavailable_sending_operations_count_enabled ? 1 : 0}" name = "[${var.environment}] GCP pubsub sending messages with result unavailable {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.unavailable_sending_operations_count_message, var.message)}" diff --git a/database/elasticsearch/README.md b/database/elasticsearch/README.md index b4c8ad7..d3a152f 100644 --- a/database/elasticsearch/README.md +++ b/database/elasticsearch/README.md @@ -43,6 +43,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| cluster_initializing_shards_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | cluster_initializing_shards_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | cluster_initializing_shards_message | Custom message for the Cluster Status monitor | string | `` | no | | cluster_initializing_shards_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -50,6 +51,7 @@ Creates DataDog monitors with the following checks: | cluster_initializing_shards_threshold_warning | Cluster Status warning threshold | string | `1` | no | | cluster_initializing_shards_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | cluster_initializing_shards_timeframe | Timeframe for the Cluster Status monitor | string | `last_5m` | no | +| cluster_relocating_shards_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | cluster_relocating_shards_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | cluster_relocating_shards_message | Custom message for the Cluster Status monitor | string | `` | no | | cluster_relocating_shards_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -57,6 +59,7 @@ Creates DataDog monitors with the following checks: | cluster_relocating_shards_threshold_warning | Cluster Status warning threshold | string | `1` | no | | cluster_relocating_shards_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | cluster_relocating_shards_timeframe | Timeframe for the Cluster Status monitor | string | `last_5m` | no | +| cluster_status_not_green_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | cluster_status_not_green_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | cluster_status_not_green_message | Custom message for the Cluster Status monitor | string | `` | no | | cluster_status_not_green_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -64,6 +67,7 @@ Creates DataDog monitors with the following checks: | cluster_status_not_green_threshold_warning | Cluster Status warning threshold | string | `1` | no | | cluster_status_not_green_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | cluster_status_not_green_timeframe | Timeframe for the Cluster Status monitor | string | `last_5m` | no | +| cluster_unassigned_shards_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | cluster_unassigned_shards_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | cluster_unassigned_shards_message | Custom message for the Cluster Status monitor | string | `` | no | | cluster_unassigned_shards_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -73,6 +77,7 @@ Creates DataDog monitors with the following checks: | cluster_unassigned_shards_timeframe | Timeframe for the Cluster Status monitor | string | `last_5m` | no | | environment | Architecture environment | string | - | yes | | evaluation_delay | Delay in seconds for the metric evaluation | string | `15` | no | +| fetch_change_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | fetch_change_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | fetch_change_message | Custom message for the Cluster Status monitor | string | `` | no | | fetch_change_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -81,6 +86,7 @@ Creates DataDog monitors with the following checks: | fetch_change_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | fetch_change_timeframe | Timeframe for the Cluster Status monitor | string | `last_10m` | no | | fetch_change_timeshift | Timeshift for the Cluster Status monitor | string | `last_10m` | no | +| fetch_latency_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | fetch_latency_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | fetch_latency_message | Custom message for the Cluster Status monitor | string | `` | no | | fetch_latency_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -88,6 +94,7 @@ Creates DataDog monitors with the following checks: | fetch_latency_threshold_warning | Cluster Status warning threshold | string | `2` | no | | fetch_latency_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | fetch_latency_timeframe | Timeframe for the Cluster Status monitor | string | `last_10m` | no | +| field_data_evictions_change_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | field_data_evictions_change_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | field_data_evictions_change_message | Custom message for the Cluster Status monitor | string | `` | no | | field_data_evictions_change_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -98,6 +105,7 @@ Creates DataDog monitors with the following checks: | field_data_evictions_change_timeshift | Timeframe for the Cluster Status monitor | string | `last_15m` | 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 | +| flush_latency_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | flush_latency_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | flush_latency_message | Custom message for the Cluster Status monitor | string | `` | no | | flush_latency_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -110,6 +118,7 @@ Creates DataDog monitors with the following checks: | http_connections_anomaly_detection_algorithm | Anomaly Detection Algorithm used | string | `agile` | no | | http_connections_anomaly_deviations | Deviations to detect the anomaly | string | `2` | no | | http_connections_anomaly_direction | Direction of the anomaly. It can be both, below or above. | string | `above` | no | +| http_connections_anomaly_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | http_connections_anomaly_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | http_connections_anomaly_interval | Interval. | string | `60` | no | | http_connections_anomaly_message | Custom message for the Cluster Status monitor | string | `` | no | @@ -119,6 +128,7 @@ Creates DataDog monitors with the following checks: | http_connections_anomaly_threshold_warning | Cluster Status warning threshold | string | `0.75` | no | | http_connections_anomaly_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | http_connections_anomaly_timeframe | Timeframe for the Cluster Status monitor | string | `last_4h` | no | +| indexing_latency_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | indexing_latency_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | indexing_latency_message | Custom message for the Cluster Status monitor | string | `` | no | | indexing_latency_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -126,6 +136,7 @@ Creates DataDog monitors with the following checks: | indexing_latency_threshold_warning | Cluster Status warning threshold | string | `10` | no | | indexing_latency_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | indexing_latency_timeframe | Timeframe for the Cluster Status monitor | string | `last_10m` | no | +| jvm_gc_old_collection_latency_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | jvm_gc_old_collection_latency_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | jvm_gc_old_collection_latency_message | Custom message for the Cluster Status monitor | string | `` | no | | jvm_gc_old_collection_latency_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -133,6 +144,7 @@ Creates DataDog monitors with the following checks: | jvm_gc_old_collection_latency_threshold_warning | Cluster Status warning threshold | string | `160` | no | | jvm_gc_old_collection_latency_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | jvm_gc_old_collection_latency_timeframe | Timeframe for the Cluster Status monitor | string | `last_10m` | no | +| jvm_gc_young_collection_latency_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | jvm_gc_young_collection_latency_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | jvm_gc_young_collection_latency_message | Custom message for the Cluster Status monitor | string | `` | no | | jvm_gc_young_collection_latency_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -140,6 +152,7 @@ Creates DataDog monitors with the following checks: | jvm_gc_young_collection_latency_threshold_warning | Cluster Status warning threshold | string | `20` | no | | jvm_gc_young_collection_latency_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | jvm_gc_young_collection_latency_timeframe | Timeframe for the Cluster Status monitor | string | `last_10m` | no | +| jvm_heap_memory_usage_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | jvm_heap_memory_usage_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | jvm_heap_memory_usage_message | Custom message for the Cluster Status monitor | string | `` | no | | jvm_heap_memory_usage_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -147,6 +160,7 @@ Creates DataDog monitors with the following checks: | jvm_heap_memory_usage_threshold_warning | Cluster Status warning threshold | string | `80` | no | | jvm_heap_memory_usage_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | jvm_heap_memory_usage_timeframe | Timeframe for the Cluster Status monitor | string | `last_5m` | no | +| jvm_memory_old_usage_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | jvm_memory_old_usage_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | jvm_memory_old_usage_message | Custom message for the Cluster Status monitor | string | `` | no | | jvm_memory_old_usage_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -154,6 +168,7 @@ Creates DataDog monitors with the following checks: | jvm_memory_old_usage_threshold_warning | Cluster Status warning threshold | string | `80` | no | | jvm_memory_old_usage_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | jvm_memory_old_usage_timeframe | Timeframe for the Cluster Status monitor | string | `last_10m` | no | +| jvm_memory_young_usage_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | jvm_memory_young_usage_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | jvm_memory_young_usage_message | Custom message for the Cluster Status monitor | string | `` | no | | jvm_memory_young_usage_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -163,6 +178,7 @@ Creates DataDog monitors with the following checks: | jvm_memory_young_usage_timeframe | Timeframe for the Cluster Status monitor | string | `last_10m` | no | | message | Message sent when a monitor is triggered | string | - | yes | | new_host_delay | Delay in seconds before begin to monitor new host | string | `300` | no | +| node_free_space_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | node_free_space_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | node_free_space_message | Custom message for the Cluster Status monitor | string | `` | no | | node_free_space_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -170,11 +186,13 @@ Creates DataDog monitors with the following checks: | node_free_space_threshold_warning | Cluster Status warning threshold | string | `20` | no | | node_free_space_time_aggregator | Time aggregator for the Cluster Status monitor | string | `sum` | no | | node_free_space_timeframe | Timeframe for the Cluster Status monitor | string | `last_5m` | no | +| not_responding_enabled | Flag to enable Elasticsearch does not respond monitor | string | `true` | no | | not_responding_extra_tags | Extra tags for Elasticsearch does not respond monitor | list | `` | no | | not_responding_message | Custom message for Elasticsearch does not respond monitor | string | `` | no | | not_responding_no_data_timeframe | Elasticsearch not responding monitor no data timeframe | string | `10` | no | | not_responding_silenced | Groups to mute for Elasticsearch does not respond monitor | map | `` | no | | not_responding_threshold_warning | Elasticsearch not responding limit (warning threshold) | string | `3` | no | +| query_cache_evictions_change_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | query_cache_evictions_change_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | query_cache_evictions_change_message | Custom message for the Cluster Status monitor | string | `` | no | | query_cache_evictions_change_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -183,6 +201,7 @@ Creates DataDog monitors with the following checks: | query_cache_evictions_change_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | query_cache_evictions_change_timeframe | Timeframe for the Cluster Status monitor | string | `last_15m` | no | | query_cache_evictions_change_timeshift | Timeframe for the Cluster Status monitor | string | `last_15m` | no | +| request_cache_evictions_change_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | request_cache_evictions_change_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | request_cache_evictions_change_message | Custom message for the Cluster Status monitor | string | `` | no | | request_cache_evictions_change_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -191,6 +210,7 @@ Creates DataDog monitors with the following checks: | request_cache_evictions_change_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | request_cache_evictions_change_timeframe | Timeframe for the Cluster Status monitor | string | `last_15m` | no | | request_cache_evictions_change_timeshift | Timeshift for the Cluster Status monitor | string | `last_15m` | no | +| search_query_change_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | search_query_change_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | search_query_change_message | Custom message for the Cluster Status monitor | string | `` | no | | search_query_change_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -199,6 +219,7 @@ Creates DataDog monitors with the following checks: | search_query_change_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | search_query_change_timeframe | Timeframe for the Cluster Status monitor | string | `last_10m` | no | | search_query_change_timeshift | Timeshift for the Cluster Status monitor | string | `last_10m` | no | +| search_query_latency_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | search_query_latency_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | search_query_latency_message | Custom message for the Cluster Status monitor | string | `` | no | | search_query_latency_silenced | Groups to mute for Cluster Status monitor | map | `` | no | @@ -206,6 +227,7 @@ Creates DataDog monitors with the following checks: | search_query_latency_threshold_warning | Cluster Status warning threshold | string | `0.5` | no | | search_query_latency_time_aggregator | Time aggregator for the Cluster Status monitor | string | `avg` | no | | search_query_latency_timeframe | Timeframe for the Cluster Status monitor | string | `last_10m` | no | +| task_time_in_queue_change_enabled | Flag to enable Cluster Status monitor | string | `true` | no | | task_time_in_queue_change_extra_tags | Extra tags for Cluster Status monitor | list | `` | no | | task_time_in_queue_change_message | Custom message for the Cluster Status monitor | string | `` | no | | task_time_in_queue_change_silenced | Groups to mute for Cluster Status monitor | map | `` | no | diff --git a/database/elasticsearch/inputs.tf b/database/elasticsearch/inputs.tf index f2739e0..af8ec00 100644 --- a/database/elasticsearch/inputs.tf +++ b/database/elasticsearch/inputs.tf @@ -69,6 +69,12 @@ variable "cluster_status_not_green_silenced" { default = {} } +variable "cluster_status_not_green_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "cluster_status_not_green_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -114,6 +120,12 @@ variable "cluster_initializing_shards_silenced" { default = {} } +variable "cluster_initializing_shards_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "cluster_initializing_shards_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -159,6 +171,12 @@ variable "cluster_relocating_shards_silenced" { default = {} } +variable "cluster_relocating_shards_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "cluster_relocating_shards_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -204,6 +222,12 @@ variable "cluster_unassigned_shards_silenced" { default = {} } +variable "cluster_unassigned_shards_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "cluster_unassigned_shards_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -249,6 +273,12 @@ variable "node_free_space_silenced" { default = {} } +variable "node_free_space_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "node_free_space_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -294,6 +324,12 @@ variable "jvm_heap_memory_usage_silenced" { default = {} } +variable "jvm_heap_memory_usage_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "jvm_heap_memory_usage_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -339,6 +375,12 @@ variable "jvm_memory_young_usage_silenced" { default = {} } +variable "jvm_memory_young_usage_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "jvm_memory_young_usage_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -384,6 +426,12 @@ variable "jvm_memory_old_usage_silenced" { default = {} } +variable "jvm_memory_old_usage_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "jvm_memory_old_usage_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -429,6 +477,12 @@ variable "jvm_gc_old_collection_latency_silenced" { default = {} } +variable "jvm_gc_old_collection_latency_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "jvm_gc_old_collection_latency_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -474,6 +528,12 @@ variable "jvm_gc_young_collection_latency_silenced" { default = {} } +variable "jvm_gc_young_collection_latency_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "jvm_gc_young_collection_latency_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -519,6 +579,12 @@ variable "indexing_latency_silenced" { default = {} } +variable "indexing_latency_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "indexing_latency_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -564,6 +630,12 @@ variable "flush_latency_silenced" { default = {} } +variable "flush_latency_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "flush_latency_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -651,6 +723,12 @@ variable "http_connections_anomaly_silenced" { default = {} } +variable "http_connections_anomaly_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "http_connections_anomaly_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -696,6 +774,12 @@ variable "search_query_latency_silenced" { default = {} } +variable "search_query_latency_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "search_query_latency_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -741,6 +825,12 @@ variable "fetch_latency_silenced" { default = {} } +variable "fetch_latency_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "fetch_latency_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -792,6 +882,12 @@ variable "search_query_change_silenced" { default = {} } +variable "search_query_change_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "search_query_change_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -843,6 +939,12 @@ variable "fetch_change_silenced" { default = {} } +variable "fetch_change_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "fetch_change_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -894,6 +996,12 @@ variable "field_data_evictions_change_silenced" { default = {} } +variable "field_data_evictions_change_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "field_data_evictions_change_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -945,6 +1053,12 @@ variable "query_cache_evictions_change_silenced" { default = {} } +variable "query_cache_evictions_change_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "query_cache_evictions_change_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -996,6 +1110,12 @@ variable "request_cache_evictions_change_silenced" { default = {} } +variable "request_cache_evictions_change_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "request_cache_evictions_change_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -1047,6 +1167,12 @@ variable "task_time_in_queue_change_silenced" { default = {} } +variable "task_time_in_queue_change_enabled" { + description = "Flag to enable Cluster Status monitor" + type = "string" + default = "true" +} + variable "task_time_in_queue_change_extra_tags" { description = "Extra tags for Cluster Status monitor" type = "list" @@ -1062,6 +1188,12 @@ variable "not_responding_silenced" { default = {} } +variable "not_responding_enabled" { + description = "Flag to enable Elasticsearch does not respond monitor" + type = "string" + default = "true" +} + variable "not_responding_message" { description = "Custom message for Elasticsearch does not respond monitor" type = "string" diff --git a/database/elasticsearch/monitors-elasticsearch.tf b/database/elasticsearch/monitors-elasticsearch.tf index 52bccfb..6be7dae 100644 --- a/database/elasticsearch/monitors-elasticsearch.tf +++ b/database/elasticsearch/monitors-elasticsearch.tf @@ -2,6 +2,7 @@ # Service Check # resource "datadog_monitor" "not_responding" { + count = "${var.not_responding_enabled ? 1 : 0}" name = "[${var.environment}] ElasticSearch does not respond" message = "${coalesce(var.not_responding_message, var.message)}" @@ -44,6 +45,7 @@ EOL # Cluster Status Not Green # resource "datadog_monitor" "cluster_status_not_green" { + count = "${var.cluster_status_not_green_enabled ? 1 : 0}" name = "[${var.environment}] ElasticSearch Cluster status not green" message = "${coalesce(var.cluster_status_not_green_message, var.message)}" @@ -86,6 +88,7 @@ EOF # Cluster Initializing Shards # resource "datadog_monitor" "cluster_initializing_shards" { + count = "${var.cluster_initializing_shards_enabled ? 1 : 0}" name = "[${var.environment}] ElasticSearch Cluster is initializing shards" message = "${coalesce(var.cluster_initializing_shards_message, var.message)}" @@ -127,6 +130,7 @@ EOF # Cluster Relocating Shards # resource "datadog_monitor" "cluster_relocating_shards" { + count = "${var.cluster_relocating_shards_enabled ? 1 : 0}" name = "[${var.environment}] ElasticSearch Cluster is relocating shards" message = "${coalesce(var.cluster_relocating_shards_message, var.message)}" @@ -168,6 +172,7 @@ EOF # Cluster Unassigned Shards # resource "datadog_monitor" "cluster_unassigned_shards" { + count = "${var.cluster_unassigned_shards_enabled ? 1 : 0}" name = "[${var.environment}] ElasticSearch Cluster has unassigned shards" message = "${coalesce(var.cluster_unassigned_shards_message, var.message)}" @@ -209,6 +214,7 @@ EOF # Free Space in nodes # resource "datadog_monitor" "node_free_space" { + count = "${var.node_free_space_enabled ? 1 : 0}" name = "[${var.environment}] ElasticSearch free space < 10%" message = "${coalesce(var.node_free_space_message, var.message)}" @@ -253,6 +259,7 @@ EOF # JVM Heap Memory Usage # resource "datadog_monitor" "jvm_heap_memory_usage" { + count = "${var.jvm_heap_memory_usage_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch JVM HEAP memory usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.jvm_heap_memory_usage_message, var.message)}" @@ -294,6 +301,7 @@ EOF # JVM Memory Young Usage # resource "datadog_monitor" "jvm_memory_young_usage" { + count = "${var.jvm_memory_young_usage_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch JVM memory Young usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.jvm_memory_young_usage_message, var.message)}" @@ -335,6 +343,7 @@ EOF # JVM Memory Old Usage # resource "datadog_monitor" "jvm_memory_old_usage" { + count = "${var.jvm_memory_old_usage_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch JVM memory Old usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.jvm_memory_old_usage_message, var.message)}" @@ -376,6 +385,7 @@ EOF # JVM Garbace Collector Old Collection Latency # resource "datadog_monitor" "jvm_gc_old_collection_latency" { + count = "${var.jvm_gc_old_collection_latency_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch average Old-generation garbage collections latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.jvm_gc_old_collection_latency_message, var.message)}" @@ -417,6 +427,7 @@ EOF # JVM Garbace Collector Young Collection Latency # resource "datadog_monitor" "jvm_gc_young_collection_latency" { + count = "${var.jvm_gc_young_collection_latency_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch average Young-generation garbage collections latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.jvm_gc_young_collection_latency_message, var.message)}" @@ -458,6 +469,7 @@ EOF # Indexing Latency # resource "datadog_monitor" "indexing_latency" { + count = "${var.indexing_latency_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch average indexing time by document {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.indexing_latency_message, var.message)}" @@ -500,6 +512,7 @@ EOF # Flush Latency # resource "datadog_monitor" "flush_latency" { + count = "${var.flush_latency_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch average index flushing to disk latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.flush_latency_message, var.message)}" @@ -542,6 +555,7 @@ EOF # Open HTTP Connections Anomaly # resource "datadog_monitor" "http_connections_anomaly" { + count = "${var.http_connections_anomaly_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch number of current open HTTP connections anomaly detected" message = "${coalesce(var.http_connections_anomaly_message, var.message)}" @@ -591,6 +605,7 @@ EOF # Query Latency # resource "datadog_monitor" "search_query_latency" { + count = "${var.search_query_latency_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch average search query latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.search_query_latency_message, var.message)}" @@ -633,6 +648,7 @@ EOF # Fetch Latency # resource "datadog_monitor" "fetch_latency" { + count = "${var.fetch_latency_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch average search fetch latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.fetch_latency_message, var.message)}" @@ -675,6 +691,7 @@ EOF # Search Query Change # resource "datadog_monitor" "search_query_change" { + count = "${var.search_query_change_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch change alert on the number of currently active queries" message = "${coalesce(var.search_query_change_message, var.message)}" @@ -716,6 +733,7 @@ EOF # Fetch Change # resource "datadog_monitor" "fetch_change" { + count = "${var.fetch_change_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch change alert on the number of search fetches currently running" message = "${coalesce(var.fetch_change_message, var.message)}" @@ -757,6 +775,7 @@ EOF # Field Data Evictions # resource "datadog_monitor" "field_data_evictions_change" { + count = "${var.field_data_evictions_change_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch change alert on the total number of evictions from the fielddata cache" message = "${coalesce(var.field_data_evictions_change_message, var.message)}" @@ -799,6 +818,7 @@ EOF # Query Cache Evictions # resource "datadog_monitor" "query_cache_evictions_change" { + count = "${var.query_cache_evictions_change_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch change alert on the number of query cache evictions" message = "${coalesce(var.query_cache_evictions_change_message, var.message)}" @@ -841,6 +861,7 @@ EOF # Request Cache Evictions # resource "datadog_monitor" "request_cache_evictions_change" { + count = "${var.request_cache_evictions_change_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch change alert on the number of request cache evictions" message = "${coalesce(var.request_cache_evictions_change_message, var.message)}" @@ -883,6 +904,7 @@ EOF # Task Time in Queue # resource "datadog_monitor" "task_time_in_queue_change" { + count = "${var.task_time_in_queue_change_enabled ? 1 : 0}" name = "[${var.environment}] Elasticsearch change alert on the average time spent by tasks in the queue" message = "${coalesce(var.task_time_in_queue_change_message, var.message)}" diff --git a/database/mysql/README.md b/database/mysql/README.md index 1693d03..790a25e 100644 --- a/database/mysql/README.md +++ b/database/mysql/README.md @@ -34,35 +34,40 @@ Creates DataDog monitors with the following checks: | 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 | +| mysql_aborted_enabled | Flag to enable MySQL aborted connects monitor | string | `true` | no | | mysql_aborted_extra_tags | Extra tags for MySQL aborted connects monitor | list | `` | no | | mysql_aborted_message | Custom message for MySQL aborted connects monitor | string | `` | no | -| mysql_aborted_silenced | Groups to mute MySQL aborted connects monitor | map | `` | no | +| mysql_aborted_silenced | Groups to mute for MySQL aborted connects monitor | map | `` | no | | mysql_aborted_threshold_critical | Maximum critical acceptable percent of aborted connects | string | `10` | no | | mysql_aborted_threshold_warning | Maximum warning acceptable percent of aborted connects | string | `5` | no | | mysql_aborted_time_aggregator | Monitor time aggregator for MySQL aborted connects monitor [available values: min, max or avg] | string | `avg` | no | | mysql_aborted_timeframe | Monitor timeframe for MySQL aborted connects monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_10m` | no | +| mysql_availability_enabled | Flag to enable Mysql availability monitor | string | `true` | no | | mysql_availability_extra_tags | Extra tags for Mysql availability monitor | list | `` | no | | mysql_availability_message | Custom message for Mysql availability monitor | string | `` | no | | mysql_availability_no_data_timeframe | Mysql availability monitor no data timeframe | string | `10` | no | | mysql_availability_silenced | Groups to mute for Mysql availability monitor | map | `` | no | | mysql_availability_threshold_warning | Mysql availability monitor (warning threshold) | string | `3` | no | +| mysql_connection_enabled | Flag to enable MySQL connection monitor | string | `true` | no | | mysql_connection_extra_tags | Extra tags for MySQL connection monitor | list | `` | no | | mysql_connection_message | Custom message for MySQL connection monitor | string | `` | no | -| mysql_connection_silenced | Groups to mute MySQL connection monitor | map | `` | no | +| mysql_connection_silenced | Groups to mute for MySQL connection monitor | map | `` | no | | mysql_connection_threshold_critical | Maximum critical acceptable percent of connections | string | `80` | no | | mysql_connection_threshold_warning | Maximum warning acceptable percent of connections | string | `70` | no | | mysql_connection_time_aggregator | Monitor time aggregator for MySQL connection monitor [available values: min, max or avg] | string | `avg` | no | | mysql_connection_timeframe | Monitor timeframe for MySQL connection monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_10m` | no | +| mysql_pool_efficiency_enabled | Flag to enable MySQL innodb buffer pool efficiency monitor | string | `true` | no | | mysql_pool_efficiency_extra_tags | Extra tags for MySQL innodb buffer pool efficiency monitor | list | `` | no | | mysql_pool_efficiency_message | Custom message for MySQL innodb buffer pool efficiency monitor | string | `` | no | -| mysql_pool_efficiency_silenced | Groups to mute MySQL innodb buffer pool efficiency monitor | map | `` | no | +| mysql_pool_efficiency_silenced | Groups to mute for MySQL innodb buffer pool efficiency monitor | map | `` | no | | mysql_pool_efficiency_threshold_critical | Maximum critical acceptable percent of innodb buffer pool efficiency | string | `20` | no | | mysql_pool_efficiency_threshold_warning | Maximum warning acceptable percent of innodb buffer pool efficiency | string | `1` | no | | mysql_pool_efficiency_time_aggregator | Monitor time aggregator for MySQL innodb buffer pool efficiency monitor [available values: min, max or avg] | string | `sum` | no | | mysql_pool_efficiency_timeframe | Monitor timeframe for MySQL innodb buffer pool efficiency monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_1h` | no | +| mysql_pool_utilization_enabled | Flag to enable MySQL innodb buffer pool utilization monitor | string | `true` | no | | mysql_pool_utilization_extra_tags | Extra tags for MySQL innodb buffer pool utilization monitor | list | `` | no | | mysql_pool_utilization_message | Custom message for MySQL innodb buffer pool utilization monitor | string | `` | no | -| mysql_pool_utilization_silenced | Groups to mute MySQL innodb buffer pool utilization monitor | map | `` | no | +| mysql_pool_utilization_silenced | Groups to mute for MySQL innodb buffer pool utilization monitor | map | `` | no | | mysql_pool_utilization_threshold_critical | Maximum critical acceptable percent of innodb buffer pool utilization | string | `90` | no | | mysql_pool_utilization_threshold_warning | Maximum warning acceptable percent of innodb buffer pool utilization | string | `75` | no | | mysql_pool_utilization_time_aggregator | Monitor time aggregator for MySQL innodb buffer pool utilization monitor [available values: min, max or avg] | string | `min` | no | @@ -72,17 +77,19 @@ Creates DataDog monitors with the following checks: | mysql_queries_detection_algorithm | Anomaly Detection Algorithm used | string | `agile` | no | | mysql_queries_deviations | Deviations to detect the anomaly | string | `5` | no | | mysql_queries_direction | Direction of the anomaly. It can be both, below or above. | string | `both` | no | +| mysql_queries_enabled | Flag to enable mysql queries monitor | string | `true` | no | | mysql_queries_extra_tags | Extra tags for MySQL queries monitor | list | `` | no | | mysql_queries_interval | Interval. | string | `60` | no | | mysql_queries_message | Custom message for MySQL queries monitor | string | `` | no | | mysql_queries_seasonality | Seasonality of the algorithm | string | `daily` | no | -| mysql_queries_silenced | Groups to mute mysql queries monitor | map | `` | no | +| mysql_queries_silenced | Groups to mute for mysql queries monitor | map | `` | no | | mysql_queries_threshold_critical | Maximum critical acceptable number of queries | string | `1` | no | | mysql_queries_time_aggregator | Monitor time aggregator for MySQL queries monitor [available values: min, max or avg] | string | `avg` | no | | mysql_queries_timeframe | Monitor timeframe for MySQL queries monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_4h` | no | +| mysql_slow_enabled | Flag to enable MySQL slow queries monitor | string | `true` | no | | mysql_slow_extra_tags | Extra tags for MySQL slow queries monitor | list | `` | no | | mysql_slow_message | Custom message for MySQL slow queries monitor | string | `` | no | -| mysql_slow_silenced | Groups to mute MySQL slow queries monitor | map | `` | no | +| mysql_slow_silenced | Groups to mute for MySQL slow queries monitor | map | `` | no | | mysql_slow_threshold_critical | Maximum critical acceptable percent of slow queries | string | `20` | no | | mysql_slow_threshold_warning | Maximum warning acceptable percent of slow queries | string | `5` | no | | mysql_slow_time_aggregator | Monitor time aggregator for MySQL slow queries monitor [available values: min, max or avg] | string | `avg` | no | @@ -92,11 +99,12 @@ Creates DataDog monitors with the following checks: | mysql_threads_detection_algorithm | Anomaly Detection Algorithm used | string | `basic` | no | | mysql_threads_deviations | Deviations to detect the anomaly | string | `2` | no | | mysql_threads_direction | Direction of the anomaly. It can be both, below or above. | string | `above` | no | +| mysql_threads_enabled | Flag to enable mysql threads monitor | string | `true` | no | | mysql_threads_extra_tags | Extra tags for MySQL threads monitor | list | `` | no | | mysql_threads_interval | Interval. | string | `60` | no | | mysql_threads_message | Custom message for MySQL threads monitor | string | `` | no | | mysql_threads_seasonality | Seasonality of the algorithm | string | `daily` | no | -| mysql_threads_silenced | Groups to mute mysql threads monitor | map | `` | no | +| mysql_threads_silenced | Groups to mute for mysql threads monitor | map | `` | no | | mysql_threads_threshold_critical | Maximum critical acceptable number of threads | string | `1` | no | | mysql_threads_time_aggregator | Monitor time aggregator for MySQL threads monitor [available values: min, max or avg] | string | `avg` | no | | mysql_threads_timeframe | Monitor timeframe for MySQL threads monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_4h` | no | diff --git a/database/mysql/inputs.tf b/database/mysql/inputs.tf index 0755c6b..352de6b 100644 --- a/database/mysql/inputs.tf +++ b/database/mysql/inputs.tf @@ -39,6 +39,12 @@ variable "mysql_availability_silenced" { default = {} } +variable "mysql_availability_enabled" { + description = "Flag to enable Mysql availability monitor" + type = "string" + default = "true" +} + variable "mysql_availability_extra_tags" { description = "Extra tags for Mysql availability monitor" type = "list" @@ -67,6 +73,30 @@ variable "mysql_availability_no_data_timeframe" { ### MySQL connections ### ################################# +variable "mysql_connection_silenced" { + description = "Groups to mute for MySQL connection monitor" + type = "map" + default = {} +} + +variable "mysql_connection_enabled" { + description = "Flag to enable MySQL connection monitor" + type = "string" + default = "true" +} + +variable "mysql_connection_extra_tags" { + description = "Extra tags for MySQL connection monitor" + type = "list" + default = [] +} + +variable "mysql_connection_message" { + description = "Custom message for MySQL connection monitor" + type = "string" + default = "" +} + variable "mysql_connection_threshold_critical" { default = 80 description = "Maximum critical acceptable percent of connections" @@ -89,27 +119,33 @@ variable "mysql_connection_timeframe" { default = "last_10m" } -variable "mysql_connection_silenced" { - description = "Groups to mute MySQL connection monitor" +################################# +### MySQL aborted connects ### +################################# + +variable "mysql_aborted_silenced" { + description = "Groups to mute for MySQL aborted connects monitor" type = "map" default = {} } -variable "mysql_connection_message" { - description = "Custom message for MySQL connection monitor" +variable "mysql_aborted_enabled" { + description = "Flag to enable MySQL aborted connects monitor" type = "string" - default = "" + default = "true" } -variable "mysql_connection_extra_tags" { - description = "Extra tags for MySQL connection monitor" +variable "mysql_aborted_extra_tags" { + description = "Extra tags for MySQL aborted connects monitor" type = "list" default = [] } -################################# -### MySQL aborted connects ### -################################# +variable "mysql_aborted_message" { + description = "Custom message for MySQL aborted connects monitor" + type = "string" + default = "" +} variable "mysql_aborted_threshold_critical" { default = 10 @@ -133,27 +169,33 @@ variable "mysql_aborted_timeframe" { default = "last_10m" } -variable "mysql_aborted_silenced" { - description = "Groups to mute MySQL aborted connects monitor" +################################# +### MySQL slow queries ### +################################# + +variable "mysql_slow_silenced" { + description = "Groups to mute for MySQL slow queries monitor" type = "map" default = {} } -variable "mysql_aborted_message" { - description = "Custom message for MySQL aborted connects monitor" +variable "mysql_slow_enabled" { + description = "Flag to enable MySQL slow queries monitor" type = "string" - default = "" + default = "true" } -variable "mysql_aborted_extra_tags" { - description = "Extra tags for MySQL aborted connects monitor" +variable "mysql_slow_extra_tags" { + description = "Extra tags for MySQL slow queries monitor" type = "list" default = [] } -################################# -### MySQL slow queries ### -################################# +variable "mysql_slow_message" { + description = "Custom message for MySQL slow queries monitor" + type = "string" + default = "" +} variable "mysql_slow_threshold_critical" { default = 20 @@ -177,27 +219,33 @@ variable "mysql_slow_timeframe" { default = "last_15m" } -variable "mysql_slow_silenced" { - description = "Groups to mute MySQL slow queries monitor" +################################# +# MySQL innodb pool efficiency # +################################# + +variable "mysql_pool_efficiency_silenced" { + description = "Groups to mute for MySQL innodb buffer pool efficiency monitor" type = "map" default = {} } -variable "mysql_slow_message" { - description = "Custom message for MySQL slow queries monitor" +variable "mysql_pool_efficiency_enabled" { + description = "Flag to enable MySQL innodb buffer pool efficiency monitor" type = "string" - default = "" + default = "true" } -variable "mysql_slow_extra_tags" { - description = "Extra tags for MySQL slow queries monitor" +variable "mysql_pool_efficiency_extra_tags" { + description = "Extra tags for MySQL innodb buffer pool efficiency monitor" type = "list" default = [] } -################################# -# MySQL innodb pool efficiency # -################################# +variable "mysql_pool_efficiency_message" { + description = "Custom message for MySQL innodb buffer pool efficiency monitor" + type = "string" + default = "" +} variable "mysql_pool_efficiency_threshold_critical" { default = 20 @@ -221,27 +269,33 @@ variable "mysql_pool_efficiency_timeframe" { default = "last_1h" } -variable "mysql_pool_efficiency_silenced" { - description = "Groups to mute MySQL innodb buffer pool efficiency monitor" +################################# +# MySQL innodb pool utilization # +################################# + +variable "mysql_pool_utilization_silenced" { + description = "Groups to mute for MySQL innodb buffer pool utilization monitor" type = "map" default = {} } -variable "mysql_pool_efficiency_message" { - description = "Custom message for MySQL innodb buffer pool efficiency monitor" +variable "mysql_pool_utilization_enabled" { + description = "Flag to enable MySQL innodb buffer pool utilization monitor" type = "string" - default = "" + default = "true" } -variable "mysql_pool_efficiency_extra_tags" { - description = "Extra tags for MySQL innodb buffer pool efficiency monitor" +variable "mysql_pool_utilization_extra_tags" { + description = "Extra tags for MySQL innodb buffer pool utilization monitor" type = "list" default = [] } -################################# -# MySQL innodb pool utilization # -################################# +variable "mysql_pool_utilization_message" { + description = "Custom message for MySQL innodb buffer pool utilization monitor" + type = "string" + default = "" +} variable "mysql_pool_utilization_threshold_critical" { default = 90 @@ -265,27 +319,33 @@ variable "mysql_pool_utilization_timeframe" { default = "last_4h" } -variable "mysql_pool_utilization_silenced" { - description = "Groups to mute MySQL innodb buffer pool utilization monitor" +################################# +### MySQL threads ### +################################# + +variable "mysql_threads_silenced" { + description = "Groups to mute for mysql threads monitor" type = "map" default = {} } -variable "mysql_pool_utilization_message" { - description = "Custom message for MySQL innodb buffer pool utilization monitor" +variable "mysql_threads_enabled" { + description = "Flag to enable mysql threads monitor" type = "string" - default = "" + default = "true" } -variable "mysql_pool_utilization_extra_tags" { - description = "Extra tags for MySQL innodb buffer pool utilization monitor" +variable "mysql_threads_extra_tags" { + description = "Extra tags for MySQL threads monitor" type = "list" default = [] } -################################# -### MySQL threads ### -################################# +variable "mysql_threads_message" { + description = "Custom message for MySQL threads monitor" + type = "string" + default = "" +} variable "mysql_threads_threshold_critical" { default = 1 @@ -346,27 +406,33 @@ variable "mysql_threads_timeframe" { default = "last_4h" } -variable "mysql_threads_silenced" { - description = "Groups to mute mysql threads monitor" +################################# +### MySQL queries ### +################################# + +variable "mysql_queries_silenced" { + description = "Groups to mute for mysql queries monitor" type = "map" default = {} } -variable "mysql_threads_message" { - description = "Custom message for MySQL threads monitor" +variable "mysql_queries_enabled" { + description = "Flag to enable mysql queries monitor" type = "string" - default = "" + default = "true" } -variable "mysql_threads_extra_tags" { - description = "Extra tags for MySQL threads monitor" +variable "mysql_queries_extra_tags" { + description = "Extra tags for MySQL queries monitor" type = "list" default = [] } -################################# -### MySQL queries ### -################################# +variable "mysql_queries_message" { + description = "Custom message for MySQL queries monitor" + type = "string" + default = "" +} variable "mysql_queries_threshold_critical" { default = 1 @@ -426,21 +492,3 @@ variable "mysql_queries_timeframe" { type = "string" default = "last_4h" } - -variable "mysql_queries_silenced" { - description = "Groups to mute mysql queries monitor" - type = "map" - default = {} -} - -variable "mysql_queries_message" { - description = "Custom message for MySQL queries monitor" - type = "string" - default = "" -} - -variable "mysql_queries_extra_tags" { - description = "Extra tags for MySQL queries monitor" - type = "list" - default = [] -} diff --git a/database/mysql/monitors-mysql.tf b/database/mysql/monitors-mysql.tf index 868dded..14814b3 100644 --- a/database/mysql/monitors-mysql.tf +++ b/database/mysql/monitors-mysql.tf @@ -1,4 +1,5 @@ resource "datadog_monitor" "mysql_availability" { + count = "${var.mysql_availability_enabled ? 1 : 0}" name = "[${var.environment}] Mysql server does not respond" message = "${coalesce(var.mysql_availability_message, var.message)}" @@ -29,6 +30,7 @@ resource "datadog_monitor" "mysql_availability" { } resource "datadog_monitor" "mysql_connection" { + count = "${var.mysql_connection_enabled ? 1 : 0}" name = "[${var.environment}] Mysql Connections limit {{#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" @@ -60,6 +62,7 @@ resource "datadog_monitor" "mysql_connection" { } resource "datadog_monitor" "mysql_aborted" { + count = "${var.mysql_aborted_enabled ? 1 : 0}" name = "[${var.environment}] Mysql Aborted connects {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.mysql_aborted_message, var.message)}" type = "metric alert" @@ -91,6 +94,7 @@ resource "datadog_monitor" "mysql_aborted" { } resource "datadog_monitor" "mysql_slow" { + count = "${var.mysql_slow_enabled ? 1 : 0}" name = "[${var.environment}] Mysql Slow queries {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.mysql_slow_message, var.message)}" type = "metric alert" @@ -122,6 +126,7 @@ resource "datadog_monitor" "mysql_slow" { } resource "datadog_monitor" "mysql_pool_efficiency" { + count = "${var.mysql_pool_efficiency_enabled ? 1 : 0}" name = "[${var.environment}] Mysql Innodb buffer pool efficiency {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.mysql_pool_efficiency_message, var.message)}" type = "metric alert" @@ -153,6 +158,7 @@ resource "datadog_monitor" "mysql_pool_efficiency" { } resource "datadog_monitor" "mysql_pool_utilization" { + count = "${var.mysql_pool_utilization_enabled ? 1 : 0}" name = "[${var.environment}] Mysql Innodb buffer pool utilization {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.mysql_pool_utilization_message, var.message)}" type = "metric alert" @@ -185,6 +191,7 @@ resource "datadog_monitor" "mysql_pool_utilization" { } resource "datadog_monitor" "mysql_threads_anomaly" { + count = "${var.mysql_threads_enabled ? 1 : 0}" name = "[${var.environment}] Mysql threads changed abnormally" message = "${coalesce(var.mysql_threads_message, var.message)}" type = "metric alert" @@ -224,6 +231,7 @@ resource "datadog_monitor" "mysql_threads_anomaly" { } resource "datadog_monitor" "mysql_queries_anomaly" { + count = "${var.mysql_queries_enabled ? 1 : 0}" name = "[${var.environment}] Mysql queries changed abnormally" message = "${coalesce(var.mysql_queries_message, var.message)}" type = "metric alert" diff --git a/middleware/nginx/README.md b/middleware/nginx/README.md index 6a88e83..6e6215b 100644 --- a/middleware/nginx/README.md +++ b/middleware/nginx/README.md @@ -35,6 +35,7 @@ Creates DataDog monitors with the following checks: | nginx_connect_no_data_timeframe | Nginx status monitor no data timeframe | string | `10` | no | | nginx_connect_silenced | Groups to mute for Nginx status monitor | map | `` | no | | nginx_connect_threshold_warning | Nginx status monitor (warning threshold) | string | `3` | no | +| nginx_dropped_enabled | Flag to enable Nginx dropped monitor | string | `true` | no | | nginx_dropped_extra_tags | Extra tags for Nginx dropped connections monitor | list | `` | no | | nginx_dropped_message | Custom message for Nginx dropped connections monitor | string | `` | no | | nginx_dropped_silenced | Groups to mute for Nginx dropped connections monitor | map | `` | no | diff --git a/middleware/nginx/inputs.tf b/middleware/nginx/inputs.tf index 786bdb8..183672d 100644 --- a/middleware/nginx/inputs.tf +++ b/middleware/nginx/inputs.tf @@ -73,6 +73,12 @@ variable "nginx_dropped_silenced" { default = {} } +variable "nginx_dropped_enabled" { + description = "Flag to enable Nginx dropped monitor" + type = "string" + default = "true" +} + variable "nginx_dropped_extra_tags" { description = "Extra tags for Nginx dropped connections monitor" type = "list" diff --git a/middleware/nginx/monitors-nginx.tf b/middleware/nginx/monitors-nginx.tf index 3ab9211..6c66c79 100644 --- a/middleware/nginx/monitors-nginx.tf +++ b/middleware/nginx/monitors-nginx.tf @@ -30,6 +30,7 @@ resource "datadog_monitor" "datadog_nginx_process" { } resource "datadog_monitor" "datadog_nginx_dropped_connections" { + count = "${var.nginx_dropped_enabled ? 1 : 0}" name = "[${var.environment}] Nginx dropped connections {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.nginx_dropped_message, var.message)}"