From d6bdc2c5864c3ae16056234b7dc4051b066f1368 Mon Sep 17 00:00:00 2001 From: Rafael Romero Carmona Date: Mon, 13 Aug 2018 16:19:04 +0200 Subject: [PATCH] MON-224 Split delay in evaluation_delay and new_host_delay --- cloud/gcp/cloud-sql/instance/README.md | 3 ++- cloud/gcp/cloud-sql/instance/inputs.tf | 7 +++++- .../instance/monitors-cloud-sql-instance.tf | 24 +++++++++---------- cloud/gcp/cloud-sql/mysql/README.md | 3 ++- cloud/gcp/cloud-sql/mysql/inputs.tf | 7 +++++- .../mysql/monitors-cloudsql-mysql.tf | 12 +++++----- 6 files changed, 34 insertions(+), 22 deletions(-) diff --git a/cloud/gcp/cloud-sql/instance/README.md b/cloud/gcp/cloud-sql/instance/README.md index 2a3aa54..a9fed1b 100644 --- a/cloud/gcp/cloud-sql/instance/README.md +++ b/cloud/gcp/cloud-sql/instance/README.md @@ -34,7 +34,6 @@ 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 | -| delay | Delay in seconds for the metric evaluation | string | `900` | 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 | @@ -56,6 +55,7 @@ Creates DataDog monitors with the following checks: | disk_utilization_time_aggregator | Time aggregator for the Disk Utilization monitor | string | `avg` | no | | 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_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 | @@ -85,6 +85,7 @@ Creates DataDog monitors with the following checks: | memory_utilization_time_aggregator | Time aggregator for the Memory Utilization monitor | string | `avg` | no | | memory_utilization_timeframe | Timeframe for the Memory Utilization monitor | string | `last_5m` | 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 | | project_id | ID of the GCP Project | string | - | yes | ## Outputs diff --git a/cloud/gcp/cloud-sql/instance/inputs.tf b/cloud/gcp/cloud-sql/instance/inputs.tf index f9e5149..c4c8909 100644 --- a/cloud/gcp/cloud-sql/instance/inputs.tf +++ b/cloud/gcp/cloud-sql/instance/inputs.tf @@ -20,11 +20,16 @@ variable "message" { description = "Message sent when a monitor is triggered" } -variable "delay" { +variable "evaluation_delay" { description = "Delay in seconds for the metric evaluation" default = 900 } +variable "new_host_delay" { + description = "Delay in seconds for the new host evaluation" + default = 300 +} + # # Filter variables # diff --git a/cloud/gcp/cloud-sql/instance/monitors-cloud-sql-instance.tf b/cloud/gcp/cloud-sql/instance/monitors-cloud-sql-instance.tf index 114a755..f4c45d2 100644 --- a/cloud/gcp/cloud-sql/instance/monitors-cloud-sql-instance.tf +++ b/cloud/gcp/cloud-sql/instance/monitors-cloud-sql-instance.tf @@ -40,8 +40,8 @@ EOF notify_no_data = true renotify_interval = 0 - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.cpu_utilization_silenced}" @@ -84,8 +84,8 @@ EOF notify_no_data = true renotify_interval = 0 - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.disk_utilization_silenced}" @@ -134,8 +134,8 @@ EOF notify_no_data = false renotify_interval = 0 - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.disk_utilization_forecast_silenced}" @@ -178,8 +178,8 @@ EOF notify_no_data = true renotify_interval = 0 - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.memory_utilization_silenced}" @@ -228,8 +228,8 @@ EOF notify_no_data = false renotify_interval = 0 - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.memory_utilization_forecast_silenced}" @@ -271,8 +271,8 @@ EOF notify_no_data = true renotify_interval = 0 - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.failover_unavailable_silenced}" diff --git a/cloud/gcp/cloud-sql/mysql/README.md b/cloud/gcp/cloud-sql/mysql/README.md index f194fea..7786bb8 100644 --- a/cloud/gcp/cloud-sql/mysql/README.md +++ b/cloud/gcp/cloud-sql/mysql/README.md @@ -24,11 +24,12 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| -| delay | Delay in seconds for the metric evaluation | string | `900` | no | | environment | Architecture environment | string | - | yes | +| evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | | message | Message sent when a monitor is triggered | string | - | yes | +| new_host_delay | Delay in seconds for the new host evaluation | string | `300` | no | | project_id | ID of the GCP Project | string | - | yes | | queries_changing_anomaly_alert_window | Alert window. | string | `last_30m` | no | | queries_changing_anomaly_count_default_zero | Count default zero. | string | `false` | no | diff --git a/cloud/gcp/cloud-sql/mysql/inputs.tf b/cloud/gcp/cloud-sql/mysql/inputs.tf index 06d2336..a22be9b 100644 --- a/cloud/gcp/cloud-sql/mysql/inputs.tf +++ b/cloud/gcp/cloud-sql/mysql/inputs.tf @@ -20,11 +20,16 @@ variable "message" { description = "Message sent when a monitor is triggered" } -variable "delay" { +variable "evaluation_delay" { description = "Delay in seconds for the metric evaluation" default = 900 } +variable "new_host_delay" { + description = "Delay in seconds for the new host evaluation" + default = 300 +} + # # Filter variables # diff --git a/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf b/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf index a4d7ce5..3bb6101 100644 --- a/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf +++ b/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf @@ -40,8 +40,8 @@ EOF notify_no_data = true renotify_interval = 0 - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.replication_lag_silenced}" @@ -94,8 +94,8 @@ EOF notify_no_data = false renotify_interval = 0 - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.queries_changing_anomaly_silenced}" @@ -148,8 +148,8 @@ EOF notify_no_data = false renotify_interval = 0 - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.questions_changing_anomaly_silenced}"