From 2215481f712464235dea35b0389970e750c9ff81 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Fri, 14 Jun 2019 12:39:34 +0200 Subject: [PATCH] MON-459 fix undesired changes --- .../ingress/vts/monitors-ingress.tf | 10 ++- caas/kubernetes/node/monitors-k8s-node.tf | 18 ++--- caas/kubernetes/pod/monitors-k8s-pod.tf | 5 +- .../workload/monitors-k8s-workload.tf | 11 +-- cloud/aws/alb/monitors-alb.tf | 4 +- cloud/aws/apigateway/monitors-api.tf | 21 +++--- .../memcached/monitors-memcached.tf | 10 ++- cloud/aws/elasticache/redis/monitors-redis.tf | 23 +++---- .../elasticsearch/monitors-elasticsearch.tf | 15 ++-- cloud/aws/elb/monitors-elb.tf | 28 ++++---- .../monitors-kinesis-firehose.tf | 4 +- .../aurora/mysql/monitors-rds-aurora-mysql.tf | 4 +- .../monitors-rds-aurora-postgresql.tf | 4 +- cloud/aws/rds/common/monitors-rds-common.tf | 14 ++-- cloud/aws/vpn/monitors-vpn.tf | 4 +- .../monitors-azure-apimanagement.tf | 24 +++---- .../app-services/monitors-app_services.tf | 6 +- cloud/azure/cosmosdb/monitors-cosmosdb.tf | 20 +++--- .../datalakestore/monitors-datalakestore.tf | 4 +- cloud/azure/eventgrid/monitors-eventgrid.tf | 14 ++-- cloud/azure/eventhub/monitors-eventhub.tf | 14 ++-- cloud/azure/functions/monitors-functions.tf | 6 +- cloud/azure/iothubs/monitors-iothubs.tf | 68 +++++++++---------- cloud/azure/keyvault/monitors-keyvault.tf | 12 ++-- .../load-balancer/monitors-load-balancer.tf | 4 +- cloud/azure/mysql/monitors-mysql.tf | 19 +++--- .../azure/postgresql/monitors-postegresql.tf | 25 ++++--- cloud/azure/redis/monitors-azure-redis.tf | 20 +++--- .../serverfarms/monitors-azure-serverfarms.tf | 12 ++-- .../azure/servicebus/monitors-service-bus.tf | 20 +++--- .../sql-database/monitors-sql-database.tf | 24 +++---- .../monitors-sql-elasticpool.tf | 14 ++-- cloud/azure/storage/monitors-azure-storage.tf | 45 ++++++------ .../monitors-stream-analytics.tf | 25 ++++--- .../monitors-virtual-machine.tf | 14 ++-- cloud/gcp/big-query/monitors-big-query.tf | 52 ++++++-------- .../common/monitors-cloud-sql-common.tf | 31 ++++----- .../mysql/monitors-cloudsql-mysql.tf | 5 +- .../gcp/gce/instance/monitors-gce-instance.tf | 19 +++--- cloud/gcp/lb/monitors-lb.tf | 29 ++++---- cloud/gcp/pubsub/monitors-pubsub.tf | 10 ++- database/mongodb/monitors-mongo.tf | 2 - database/mysql/monitors-mysql.tf | 2 +- 43 files changed, 327 insertions(+), 388 deletions(-) diff --git a/caas/kubernetes/ingress/vts/monitors-ingress.tf b/caas/kubernetes/ingress/vts/monitors-ingress.tf index b90bc00..4c5b32d 100644 --- a/caas/kubernetes/ingress/vts/monitors-ingress.tf +++ b/caas/kubernetes/ingress/vts/monitors-ingress.tf @@ -2,6 +2,7 @@ resource "datadog_monitor" "nginx_ingress_too_many_5xx" { count = var.ingress_5xx_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Nginx Ingress 5xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.ingress_5xx_message, var.message) + type = "query alert" query = < ${var.ingress_5xx_threshold_critical} EOQ - type = "query alert" - thresholds = { warning = var.ingress_5xx_threshold_warning critical = var.ingress_5xx_threshold_critical } - notify_no_data = false evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay + notify_no_data = false renotify_interval = 0 notify_audit = false timeout_h = 0 @@ -34,6 +33,7 @@ resource "datadog_monitor" "nginx_ingress_too_many_4xx" { count = var.ingress_4xx_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Nginx Ingress 4xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.ingress_4xx_message, var.message) + type = "query alert" query = < ${var.ingress_4xx_threshold_critical} EOQ -type = "query alert" - thresholds = { warning = var.ingress_4xx_threshold_warning critical = var.ingress_4xx_threshold_critical } -notify_no_data = false evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay +notify_no_data = false renotify_interval = 0 notify_audit = false timeout_h = 0 diff --git a/caas/kubernetes/node/monitors-k8s-node.tf b/caas/kubernetes/node/monitors-k8s-node.tf index 23e82cd..61901ed 100644 --- a/caas/kubernetes/node/monitors-k8s-node.tf +++ b/caas/kubernetes/node/monitors-k8s-node.tf @@ -2,7 +2,6 @@ resource "datadog_monitor" "disk_pressure" { count = var.disk_pressure_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node Disk pressure" message = coalesce(var.disk_pressure_message, var.message) - type = "service check" query = < ${var.unregister_net_device_threshold_critical} EOQ new_host_delay = var.new_host_delay - notify_no_data = false renotify_interval = 0 notify_audit = false @@ -191,8 +184,8 @@ tags = ["env:${var.environment}", "type:caas", "provider:kubernetes", "resource: resource "datadog_monitor" "node_unschedulable" { count = var.node_unschedulable_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node unschedulable" -type = "metric alert" message = coalesce(var.node_unschedulable_message, var.message) +type = "metric alert" query = < ${var.latency_threshold_critical} EOQ - evaluation_delay = var.evaluation_delay - new_host_delay = var.new_host_delay - thresholds = { warning = var.latency_threshold_warning critical = var.latency_threshold_critical } + evaluation_delay = var.evaluation_delay + new_host_delay = var.new_host_delay notify_no_data = false renotify_interval = 0 require_full_window = false @@ -32,8 +31,8 @@ EOQ resource "datadog_monitor" "API_http_5xx_errors_count" { count = var.http_5xx_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] API Gateway HTTP 5xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - type = "query alert" message = coalesce(var.http_5xx_requests_message, var.message) + type = "query alert" query = < ${var.http_5xx_requests_threshold_critical} EOQ -evaluation_delay = var.evaluation_delay -new_host_delay = var.new_host_delay - thresholds = { warning = var.http_5xx_requests_threshold_warning critical = var.http_5xx_requests_threshold_critical } +evaluation_delay = var.evaluation_delay +new_host_delay = var.new_host_delay notify_no_data = false renotify_interval = 0 require_full_window = false @@ -63,8 +61,8 @@ tags = ["env:${var.environment}", "type:cloud", "provider:aws", "resource:apigat resource "datadog_monitor" "API_http_4xx_errors_count" { count = var.http_4xx_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] API Gateway HTTP 4xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - type = "query alert" message = coalesce(var.http_4xx_requests_message, var.message) +type = "query alert" query = < ${var.http_4xx_requests_threshold_critical} EOQ -evaluation_delay = var.evaluation_delay -new_host_delay = var.new_host_delay - thresholds = { warning = var.http_4xx_requests_threshold_warning critical = var.http_4xx_requests_threshold_critical } +evaluation_delay = var.evaluation_delay +new_host_delay = var.new_host_delay notify_no_data = false renotify_interval = 0 require_full_window = false diff --git a/cloud/aws/elasticache/memcached/monitors-memcached.tf b/cloud/aws/elasticache/memcached/monitors-memcached.tf index 3006253..25e3b0c 100644 --- a/cloud/aws/elasticache/memcached/monitors-memcached.tf +++ b/cloud/aws/elasticache/memcached/monitors-memcached.tf @@ -2,7 +2,6 @@ resource "datadog_monitor" "memcached_get_hits" { count = var.get_hits_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache memcached cache hit ratio {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.get_hits_message, var.message) - type = "query alert" query = < ${var.cpu_high_threshold_critical} EOQ -notify_no_data = true evaluation_delay = var.evaluation_delay +new_host_delay = var.new_host_delay +notify_no_data = true renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false -new_host_delay = var.new_host_delay tags = ["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-redis", "team:claranet", "created-by:terraform", "engine:redis", var.cpu_high_extra_tags] } @@ -61,8 +59,7 @@ resource "datadog_monitor" "redis_replication_lag" { count = var.replication_lag_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache redis 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) - - type = "query alert" +type = "query alert" query = < 0 EOQ -notify_no_data = false evaluation_delay = var.evaluation_delay +new_host_delay = var.new_host_delay +notify_no_data = false renotify_interval = 0 notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false -new_host_delay = var.new_host_delay tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform", var.too_many_d2c_telemetry_ingress_nosent_extra_tags] } diff --git a/cloud/azure/keyvault/monitors-keyvault.tf b/cloud/azure/keyvault/monitors-keyvault.tf index aabad04..948afbf 100644 --- a/cloud/azure/keyvault/monitors-keyvault.tf +++ b/cloud/azure/keyvault/monitors-keyvault.tf @@ -10,15 +10,15 @@ resource "datadog_monitor" "keyvault_status" { ) < 1 EOQ - notify_no_data = true evaluation_delay = var.evaluation_delay + new_host_delay = var.new_host_delay + notify_no_data = true renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false - new_host_delay = var.new_host_delay tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:keyvault", "team:claranet", "created-by:terraform", var.status_extra_tags] } @@ -43,15 +43,15 @@ critical = var.api_result_threshold_critical warning = var.api_result_threshold_warning } -notify_no_data = false evaluation_delay = var.evaluation_delay +new_host_delay = var.new_host_delay +notify_no_data = false renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false -new_host_delay = var.new_host_delay tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:keyvault", "team:claranet", "created-by:terraform", var.api_result_extra_tags] } @@ -73,15 +73,15 @@ critical = var.api_latency_threshold_critical warning = var.api_latency_threshold_warning } +evaluation_delay = var.evaluation_delay +new_host_delay = var.new_host_delay notify_no_data = false -evaluation_delay = var.evaluation_delay renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false -new_host_delay = var.new_host_delay tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:keyvault", "team:claranet", "created-by:terraform", var.api_latency_extra_tags] } diff --git a/cloud/azure/load-balancer/monitors-load-balancer.tf b/cloud/azure/load-balancer/monitors-load-balancer.tf index a67ab49..730fb6b 100644 --- a/cloud/azure/load-balancer/monitors-load-balancer.tf +++ b/cloud/azure/load-balancer/monitors-load-balancer.tf @@ -10,15 +10,15 @@ resource "datadog_monitor" "loadbalancer_status" { ) < 1 EOQ - notify_no_data = true evaluation_delay = var.evaluation_delay + new_host_delay = var.new_host_delay + notify_no_data = true renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false - new_host_delay = var.new_host_delay tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:load-balancer", "team:claranet", "created-by:terraform", var.status_extra_tags] } diff --git a/cloud/azure/mysql/monitors-mysql.tf b/cloud/azure/mysql/monitors-mysql.tf index 064a4ed..5c3e611 100644 --- a/cloud/azure/mysql/monitors-mysql.tf +++ b/cloud/azure/mysql/monitors-mysql.tf @@ -15,15 +15,15 @@ EOQ warning = var.cpu_usage_threshold_warning } - notify_no_data = false evaluation_delay = var.evaluation_delay + new_host_delay = var.new_host_delay + notify_no_data = false renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false - new_host_delay = var.new_host_delay tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform", var.cpu_usage_extra_tags] } @@ -38,7 +38,6 @@ resource "datadog_monitor" "mysql_free_storage" { ${var.free_storage_time_aggregator}(${var.free_storage_timeframe}): ( 100 - avg:azure.dbformysql_servers.storage_percent${module.filter-tags.query_alert} by {resource_group,region,name} ) < ${var.free_storage_threshold_critical} - EOQ thresholds = { @@ -46,15 +45,15 @@ critical = var.free_storage_threshold_critical warning = var.free_storage_threshold_warning } -notify_no_data = false evaluation_delay = var.evaluation_delay +new_host_delay = var.new_host_delay +notify_no_data = false renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false -new_host_delay = var.new_host_delay tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform", var.free_storage_extra_tags] } @@ -76,15 +75,15 @@ critical = var.io_consumption_threshold_critical warning = var.io_consumption_threshold_warning } -notify_no_data = false evaluation_delay = var.evaluation_delay +new_host_delay = var.new_host_delay +notify_no_data = false renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false -new_host_delay = var.new_host_delay tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform", var.io_consumption_extra_tags] } @@ -93,7 +92,7 @@ resource "datadog_monitor" "mysql_memory_usage" { count = var.memory_usage_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Server memory usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.memory_usage_message, var.message) - type = "query alert" +type = "query alert" query = < ${var.su_utilization_threshold_critical} EOQ -notify_no_data = false evaluation_delay = var.evaluation_delay +new_host_delay = var.new_host_delay +notify_no_data = false renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false -new_host_delay = var.new_host_delay thresholds = { warning = var.su_utilization_threshold_warning @@ -57,7 +57,7 @@ resource "datadog_monitor" "failed_function_requests" { count = var.failed_function_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Stream Analytics too many failed requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.failed_function_requests_message, var.message) - type = "query alert" +type = "query alert" query = < ${var.stored_bytes_threshold_critical} EOQ - thresholds = { warning = var.stored_bytes_threshold_warning critical = var.stored_bytes_threshold_critical } +evaluation_delay = var.evaluation_delay +new_host_delay = var.new_host_delay include_tags = true notify_no_data = false require_full_window = false @@ -197,9 +193,6 @@ notify_audit = false timeout_h = 0 locked = false -evaluation_delay = var.evaluation_delay -new_host_delay = var.new_host_delay - tags = ["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform", var.stored_bytes_extra_tags] } @@ -223,6 +216,8 @@ warning = var.table_count_threshold_warning critical = var.table_count_threshold_critical } +evaluation_delay = var.evaluation_delay +new_host_delay = var.new_host_delay include_tags = true notify_no_data = false require_full_window = false @@ -231,9 +226,6 @@ notify_audit = false timeout_h = 0 locked = false -evaluation_delay = var.evaluation_delay -new_host_delay = var.new_host_delay - tags = ["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform", var.table_count_extra_tags] } @@ -244,7 +236,7 @@ resource "datadog_monitor" "uploaded_bytes" { count = var.uploaded_bytes_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${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) - type = "query alert" +type = "query alert" query = <= 2 EOQ - evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay notify_no_data = true @@ -61,7 +60,6 @@ query = < 99 - EOQ thresholds = { diff --git a/database/mysql/monitors-mysql.tf b/database/mysql/monitors-mysql.tf index 31511fe..7feeffe 100644 --- a/database/mysql/monitors-mysql.tf +++ b/database/mysql/monitors-mysql.tf @@ -13,9 +13,9 @@ EOQ critical = 5 } - notify_no_data = true no_data_timeframe = var.mysql_availability_no_data_timeframe new_host_delay = var.new_host_delay + notify_no_data = true renotify_interval = 0 notify_audit = false timeout_h = 0