From 3c08056adb40154eab3d8e79388e82a6e361beb0 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Wed, 26 Jun 2019 19:33:00 +0200 Subject: [PATCH] MON-479 convert metric alert type to query alert when it needs --- caas/kubernetes/ark/monitors-ark.tf | 2 +- .../ingress/vts/monitors-ingress.tf | 4 +-- caas/kubernetes/node/monitors-k8s-node.tf | 4 +-- caas/kubernetes/pod/monitors-k8s-pod.tf | 2 +- .../workload/monitors-k8s-workload.tf | 6 ++-- cloud/aws/alb/monitors-alb.tf | 12 ++++---- cloud/aws/apigateway/monitors-api.tf | 6 ++-- .../common/monitors-elasticache.tf | 12 ++++---- .../memcached/monitors-memcached.tf | 4 +-- cloud/aws/elasticache/redis/monitors-redis.tf | 8 +++--- .../elasticsearch/monitors-elasticsearch.tf | 6 ++-- cloud/aws/elb/monitors-elb.tf | 12 ++++---- .../monitors-kinesis-firehose.tf | 2 +- .../aurora/mysql/monitors-rds-aurora-mysql.tf | 2 +- .../monitors-rds-aurora-postgresql.tf | 2 +- cloud/aws/rds/common/monitors-rds-common.tf | 6 ++-- cloud/aws/vpn/monitors-vpn.tf | 2 +- .../monitors-azure-apimanagement.tf | 8 +++--- .../app-services/monitors-app_services.tf | 10 +++---- .../azure-search/monitors-azure-search.tf | 4 +-- cloud/azure/cosmosdb/monitors-cosmosdb.tf | 6 ++-- .../datalakestore/monitors-datalakestore.tf | 2 +- cloud/azure/eventgrid/monitors-eventgrid.tf | 4 +-- cloud/azure/eventhub/monitors-eventhub.tf | 6 ++-- cloud/azure/functions/monitors-functions.tf | 6 ++-- cloud/azure/iothubs/monitors-iothubs.tf | 28 +++++++++---------- cloud/azure/keyvault/monitors-keyvault.tf | 4 +-- .../load-balancer/monitors-load-balancer.tf | 2 +- cloud/azure/mysql/monitors-mysql.tf | 8 +++--- .../azure/postgresql/monitors-postegresql.tf | 10 +++---- cloud/azure/redis/monitors-azure-redis.tf | 8 +++--- .../serverfarms/monitors-azure-serverfarms.tf | 6 ++-- .../azure/servicebus/monitors-service-bus.tf | 8 +++--- .../sql-database/monitors-sql-database.tf | 10 +++---- .../monitors-sql-elasticpool.tf | 6 ++-- cloud/azure/storage/monitors-azure-storage.tf | 18 ++++++------ .../monitors-stream-analytics.tf | 10 +++---- .../monitors-virtual-machine.tf | 6 ++-- cloud/gcp/big-query/monitors-big-query.tf | 14 +++++----- .../common/monitors-cloud-sql-common.tf | 8 +++--- .../gcp/gce/instance/monitors-gce-instance.tf | 6 ++-- cloud/gcp/lb/monitors-lb.tf | 8 +++--- database/mongodb/monitors-mongo.tf | 2 +- database/mysql/monitors-mysql.tf | 10 +++---- database/postgresql/monitors-postgresql.tf | 4 +-- database/redis/monitors-redis.tf | 18 ++++++------ middleware/php-fpm/monitors-fpm.tf | 2 +- system/generic/monitors-system.tf | 10 +++---- 48 files changed, 172 insertions(+), 172 deletions(-) diff --git a/caas/kubernetes/ark/monitors-ark.tf b/caas/kubernetes/ark/monitors-ark.tf index 38bf079..5a502b2 100644 --- a/caas/kubernetes/ark/monitors-ark.tf +++ b/caas/kubernetes/ark/monitors-ark.tf @@ -1,7 +1,7 @@ resource "datadog_monitor" "ark_schedules_monitor" { count = "${var.ark_schedules_enabled == "true" ? 1 : 0}" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Ark backup failed" - type = "metric alert" + type = "query alert" message = "${coalesce(var.ark_schedules_monitor_message, var.message)}" query = < ${var.ingress_5xx_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.ingress_5xx_threshold_warning}" @@ -42,7 +42,7 @@ resource "datadog_monitor" "nginx_ingress_too_many_4xx" { * 100, 0) > ${var.ingress_4xx_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.ingress_4xx_threshold_warning}" diff --git a/caas/kubernetes/node/monitors-k8s-node.tf b/caas/kubernetes/node/monitors-k8s-node.tf index 965e2ac..cca6ed1 100644 --- a/caas/kubernetes/node/monitors-k8s-node.tf +++ b/caas/kubernetes/node/monitors-k8s-node.tf @@ -221,7 +221,7 @@ resource "datadog_monitor" "node_unschedulable" { resource "datadog_monitor" "volume_space" { count = "${var.volume_space_enabled == "true" ? 1 : 0}" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node volume space usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - type = "metric alert" + type = "query alert" message = "${coalesce(var.volume_space_message, var.message)}" query = < ${var.elb_4xx_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.elb_4xx_threshold_warning}" @@ -75,7 +75,7 @@ resource "datadog_monitor" "ELB_too_much_5xx" { * 100 > ${var.elb_5xx_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.elb_5xx_threshold_warning}" @@ -107,7 +107,7 @@ resource "datadog_monitor" "ELB_too_much_4xx_backend" { * 100 > ${var.elb_backend_4xx_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.elb_backend_4xx_threshold_warning}" @@ -139,7 +139,7 @@ resource "datadog_monitor" "ELB_too_much_5xx_backend" { * 100 > ${var.elb_backend_5xx_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.elb_backend_5xx_threshold_warning}" @@ -170,7 +170,7 @@ resource "datadog_monitor" "ELB_backend_latency" { > ${var.elb_backend_latency_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.elb_backend_latency_warning}" diff --git a/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf b/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf index 35006ce..633e22a 100644 --- a/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf +++ b/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf @@ -4,7 +4,7 @@ resource "datadog_monitor" "firehose_incoming_records" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kinesis Firehose No incoming records" message = "${coalesce(var.incoming_records_message, var.message)}" - type = "metric alert" + type = "query alert" query = < ${var.cosmos_db_4xx_request_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.cosmos_db_4xx_request_rate_threshold_critical}" @@ -86,7 +86,7 @@ resource "datadog_monitor" "cosmos_db_5xx_requests" { , 0) * 100 > ${var.cosmos_db_5xx_request_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.cosmos_db_5xx_request_rate_threshold_critical}" @@ -120,7 +120,7 @@ resource "datadog_monitor" "cosmos_db_scaling" { , 0) * 100 > ${var.cosmos_db_scaling_error_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.cosmos_db_scaling_error_rate_threshold_critical}" diff --git a/cloud/azure/datalakestore/monitors-datalakestore.tf b/cloud/azure/datalakestore/monitors-datalakestore.tf index 3993797..edf703e 100644 --- a/cloud/azure/datalakestore/monitors-datalakestore.tf +++ b/cloud/azure/datalakestore/monitors-datalakestore.tf @@ -10,7 +10,7 @@ resource "datadog_monitor" "datalakestore_status" { ) < 1 EOQ - type = "metric alert" + type = "query alert" notify_no_data = true evaluation_delay = "${var.evaluation_delay}" diff --git a/cloud/azure/eventgrid/monitors-eventgrid.tf b/cloud/azure/eventgrid/monitors-eventgrid.tf index 083ede5..c0ef553 100644 --- a/cloud/azure/eventgrid/monitors-eventgrid.tf +++ b/cloud/azure/eventgrid/monitors-eventgrid.tf @@ -39,7 +39,7 @@ resource "datadog_monitor" "eventgrid_failed_messages" { ) > ${var.failed_messages_rate_thresold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.failed_messages_rate_thresold_critical}" @@ -74,7 +74,7 @@ resource "datadog_monitor" "eventgrid_unmatched_events" { ) > ${var.unmatched_events_rate_thresold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.unmatched_events_rate_thresold_critical}" diff --git a/cloud/azure/eventhub/monitors-eventhub.tf b/cloud/azure/eventhub/monitors-eventhub.tf index 27fb10f..f79635b 100644 --- a/cloud/azure/eventhub/monitors-eventhub.tf +++ b/cloud/azure/eventhub/monitors-eventhub.tf @@ -9,7 +9,7 @@ resource "datadog_monitor" "eventhub_status" { ) != 1 EOQ - type = "metric alert" + type = "query alert" notify_no_data = true evaluation_delay = "${var.evaluation_delay}" @@ -36,7 +36,7 @@ resource "datadog_monitor" "eventhub_failed_requests" { ) * 100 > ${var.failed_requests_rate_thresold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.failed_requests_rate_thresold_critical}" @@ -70,7 +70,7 @@ resource "datadog_monitor" "eventhub_errors" { ) * 100 > ${var.errors_rate_thresold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.errors_rate_thresold_critical}" diff --git a/cloud/azure/functions/monitors-functions.tf b/cloud/azure/functions/monitors-functions.tf index af98ec7..1f946ac 100644 --- a/cloud/azure/functions/monitors-functions.tf +++ b/cloud/azure/functions/monitors-functions.tf @@ -1,7 +1,7 @@ resource "datadog_monitor" "function_http_5xx_errors_rate" { count = "${var.http_5xx_errors_rate_enabled == "true" ? 1 : 0}" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Function App HTTP 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - type = "metric alert" + type = "query alert" message = "${coalesce(var.http_5xx_errors_rate_message, var.message)}" query = < ${var.failed_jobs_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.failed_jobs_rate_threshold_warning}" @@ -46,7 +46,7 @@ resource "datadog_monitor" "too_many_list_jobs_failed" { * 100, 0) > ${var.failed_listjobs_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.failed_listjobs_rate_threshold_warning}" @@ -80,7 +80,7 @@ resource "datadog_monitor" "too_many_query_jobs_failed" { * 100, 0) > ${var.failed_queryjobs_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.failed_queryjobs_rate_threshold_warning}" @@ -111,7 +111,7 @@ resource "datadog_monitor" "status" { ) < 1 EOQ - type = "metric alert" + type = "query alert" notify_no_data = true evaluation_delay = "${var.evaluation_delay}" @@ -137,7 +137,7 @@ resource "datadog_monitor" "total_devices" { ) == 0 EOQ - type = "metric alert" + type = "query alert" notify_no_data = false evaluation_delay = "${var.evaluation_delay}" @@ -166,7 +166,7 @@ resource "datadog_monitor" "too_many_c2d_methods_failed" { * 100, 0) > ${var.failed_c2d_methods_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.failed_c2d_methods_rate_threshold_warning}" @@ -200,7 +200,7 @@ resource "datadog_monitor" "too_many_c2d_twin_read_failed" { * 100, 0) > ${var.failed_c2d_twin_read_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.failed_c2d_twin_read_rate_threshold_warning}" @@ -234,7 +234,7 @@ resource "datadog_monitor" "too_many_c2d_twin_update_failed" { * 100, 0) > ${var.failed_c2d_twin_update_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.failed_c2d_twin_update_rate_threshold_warning}" @@ -268,7 +268,7 @@ resource "datadog_monitor" "too_many_d2c_twin_read_failed" { * 100, 0) > ${var.failed_d2c_twin_read_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.failed_d2c_twin_read_rate_threshold_warning}" @@ -302,7 +302,7 @@ resource "datadog_monitor" "too_many_d2c_twin_update_failed" { * 100, 0) > ${var.failed_d2c_twin_update_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.failed_d2c_twin_update_rate_threshold_warning}" @@ -338,7 +338,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_dropped" { * 100, 0) > ${var.dropped_d2c_telemetry_egress_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.dropped_d2c_telemetry_egress_rate_threshold_warning}" @@ -374,7 +374,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_orphaned" { * 100, 0) > ${var.orphaned_d2c_telemetry_egress_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.orphaned_d2c_telemetry_egress_rate_threshold_warning}" @@ -410,7 +410,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_invalid" { * 100, 0) > ${var.invalid_d2c_telemetry_egress_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.invalid_d2c_telemetry_egress_rate_threshold_warning}" @@ -443,7 +443,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_ingress_nosent" { , 0) > 0 EOQ - type = "metric alert" + type = "query alert" notify_no_data = false evaluation_delay = "${var.evaluation_delay}" diff --git a/cloud/azure/keyvault/monitors-keyvault.tf b/cloud/azure/keyvault/monitors-keyvault.tf index e905c35..6005b71 100644 --- a/cloud/azure/keyvault/monitors-keyvault.tf +++ b/cloud/azure/keyvault/monitors-keyvault.tf @@ -10,7 +10,7 @@ resource "datadog_monitor" "keyvault_status" { ) < 1 EOQ - type = "metric alert" + type = "query alert" notify_no_data = true evaluation_delay = "${var.evaluation_delay}" @@ -45,7 +45,7 @@ resource "datadog_monitor" "keyvault_api_result" { warning = "${var.api_result_threshold_warning}" } - type = "metric alert" + type = "query alert" notify_no_data = false evaluation_delay = "${var.evaluation_delay}" diff --git a/cloud/azure/load-balancer/monitors-load-balancer.tf b/cloud/azure/load-balancer/monitors-load-balancer.tf index 658b1b5..45ede58 100644 --- a/cloud/azure/load-balancer/monitors-load-balancer.tf +++ b/cloud/azure/load-balancer/monitors-load-balancer.tf @@ -10,7 +10,7 @@ resource "datadog_monitor" "loadbalancer_status" { ) < 1 EOQ - type = "metric alert" + type = "query alert" notify_no_data = true evaluation_delay = "${var.evaluation_delay}" diff --git a/cloud/azure/mysql/monitors-mysql.tf b/cloud/azure/mysql/monitors-mysql.tf index 481cc1c..9dd0910 100644 --- a/cloud/azure/mysql/monitors-mysql.tf +++ b/cloud/azure/mysql/monitors-mysql.tf @@ -9,7 +9,7 @@ resource "datadog_monitor" "mysql_cpu_usage" { ) > ${var.cpu_usage_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.cpu_usage_threshold_critical}" @@ -40,7 +40,7 @@ resource "datadog_monitor" "mysql_free_storage" { ) < ${var.free_storage_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.free_storage_threshold_critical}" @@ -71,7 +71,7 @@ resource "datadog_monitor" "mysql_io_consumption" { ) > ${var.io_consumption_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.io_consumption_threshold_critical}" @@ -102,7 +102,7 @@ resource "datadog_monitor" "mysql_memory_usage" { ) > ${var.memory_usage_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.memory_usage_threshold_critical}" diff --git a/cloud/azure/postgresql/monitors-postegresql.tf b/cloud/azure/postgresql/monitors-postegresql.tf index 374b5f5..679278f 100644 --- a/cloud/azure/postgresql/monitors-postegresql.tf +++ b/cloud/azure/postgresql/monitors-postegresql.tf @@ -9,7 +9,7 @@ resource "datadog_monitor" "postgresql_cpu_usage" { ) > ${var.cpu_usage_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.cpu_usage_threshold_critical}" @@ -40,7 +40,7 @@ resource "datadog_monitor" "postgresql_no_connection" { ) < 1 EOQ - type = "metric alert" + type = "query alert" notify_no_data = true evaluation_delay = "${var.evaluation_delay}" @@ -66,7 +66,7 @@ resource "datadog_monitor" "postgresql_free_storage" { ) < ${var.free_storage_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.free_storage_threshold_critical}" @@ -97,7 +97,7 @@ resource "datadog_monitor" "postgresql_io_consumption" { ) > ${var.io_consumption_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.io_consumption_threshold_critical}" @@ -128,7 +128,7 @@ resource "datadog_monitor" "postgresql_memory_usage" { ) > ${var.memory_usage_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.memory_usage_threshold_critical}" diff --git a/cloud/azure/redis/monitors-azure-redis.tf b/cloud/azure/redis/monitors-azure-redis.tf index 85ac8df..fd38fc2 100644 --- a/cloud/azure/redis/monitors-azure-redis.tf +++ b/cloud/azure/redis/monitors-azure-redis.tf @@ -9,7 +9,7 @@ resource "datadog_monitor" "status" { ) != 1 EOQ - type = "metric alert" + type = "query alert" notify_no_data = true evaluation_delay = "${var.evaluation_delay}" @@ -35,7 +35,7 @@ resource "datadog_monitor" "evictedkeys" { ) > ${var.evictedkeys_limit_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.evictedkeys_limit_threshold_warning}" @@ -66,7 +66,7 @@ resource "datadog_monitor" "percent_processor_time" { ) > ${var.percent_processor_time_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.percent_processor_time_threshold_warning}" @@ -97,7 +97,7 @@ resource "datadog_monitor" "server_load" { ) > ${var.server_load_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.server_load_rate_threshold_warning}" diff --git a/cloud/azure/serverfarms/monitors-azure-serverfarms.tf b/cloud/azure/serverfarms/monitors-azure-serverfarms.tf index 081092d..1dccf59 100644 --- a/cloud/azure/serverfarms/monitors-azure-serverfarms.tf +++ b/cloud/azure/serverfarms/monitors-azure-serverfarms.tf @@ -9,7 +9,7 @@ resource "datadog_monitor" "status" { ) != 1 EOQ - type = "metric alert" + type = "query alert" notify_no_data = true evaluation_delay = "${var.evaluation_delay}" @@ -35,7 +35,7 @@ resource "datadog_monitor" "cpu_percentage" { ) > ${var.cpu_percentage_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.cpu_percentage_threshold_warning}" @@ -66,7 +66,7 @@ resource "datadog_monitor" "memory_percentage" { ) > ${var.memory_percentage_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.memory_percentage_threshold_warning}" diff --git a/cloud/azure/servicebus/monitors-service-bus.tf b/cloud/azure/servicebus/monitors-service-bus.tf index 8f8af34..ccad349 100644 --- a/cloud/azure/servicebus/monitors-service-bus.tf +++ b/cloud/azure/servicebus/monitors-service-bus.tf @@ -10,7 +10,7 @@ resource "datadog_monitor" "servicebus_status" { ) != 1 EOQ - type = "metric alert" + type = "query alert" notify_no_data = true evaluation_delay = "${var.evaluation_delay}" @@ -37,7 +37,7 @@ resource "datadog_monitor" "service_bus_no_active_connections" { ) < 1 EOQ - type = "metric alert" + type = "query alert" notify_no_data = false evaluation_delay = "${var.evaluation_delay}" @@ -65,7 +65,7 @@ resource "datadog_monitor" "service_bus_user_errors" { ) * 100 > ${var.user_errors_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.user_errors_threshold_critical}" @@ -98,7 +98,7 @@ resource "datadog_monitor" "service_bus_server_errors" { ) * 100 > ${var.server_errors_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.server_errors_threshold_critical}" diff --git a/cloud/azure/sql-database/monitors-sql-database.tf b/cloud/azure/sql-database/monitors-sql-database.tf index dfb068c..6d8908c 100644 --- a/cloud/azure/sql-database/monitors-sql-database.tf +++ b/cloud/azure/sql-database/monitors-sql-database.tf @@ -9,7 +9,7 @@ resource "datadog_monitor" "status" { ) != 1 EOQ - type = "metric alert" + type = "query alert" notify_no_data = true evaluation_delay = "${var.evaluation_delay}" @@ -35,7 +35,7 @@ resource "datadog_monitor" "sql-database_cpu" { ) > ${var.cpu_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.cpu_threshold_critical}" @@ -60,7 +60,7 @@ resource "datadog_monitor" "sql-database_free_space_low" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Database high disk usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.diskspace_message, var.message)}" - type = "metric alert" + type = "query alert" query = < ${var.cpu_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.cpu_threshold_critical}" @@ -34,7 +34,7 @@ resource "datadog_monitor" "sql_elasticpool_free_space_low" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Elastic Pool high disk usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.diskspace_message, var.message)}" - type = "metric alert" + type = "query alert" query = < ${var.su_utilization_threshold_critical} EOQ - type = "metric alert" + type = "query alert" notify_no_data = false evaluation_delay = "${var.evaluation_delay}" @@ -67,7 +67,7 @@ resource "datadog_monitor" "failed_function_requests" { ) * 100 > ${var.failed_function_requests_threshold_critical} EOQ - type = "metric alert" + type = "query alert" notify_no_data = false evaluation_delay = "${var.evaluation_delay}" @@ -98,7 +98,7 @@ resource "datadog_monitor" "conversion_errors" { ) > ${var.conversion_errors_threshold_critical} EOQ - type = "metric alert" + type = "query alert" notify_no_data = false evaluation_delay = "${var.evaluation_delay}" @@ -129,7 +129,7 @@ resource "datadog_monitor" "runtime_errors" { ) > ${var.runtime_errors_threshold_critical} EOQ - type = "metric alert" + type = "query alert" notify_no_data = false evaluation_delay = "${var.evaluation_delay}" diff --git a/cloud/azure/virtual-machine/monitors-virtual-machine.tf b/cloud/azure/virtual-machine/monitors-virtual-machine.tf index 2998547..aaeddc7 100644 --- a/cloud/azure/virtual-machine/monitors-virtual-machine.tf +++ b/cloud/azure/virtual-machine/monitors-virtual-machine.tf @@ -10,7 +10,7 @@ resource "datadog_monitor" "virtualmachine_status" { ) < 1 EOQ - type = "metric alert" + type = "query alert" notify_no_data = true evaluation_delay = "${var.evaluation_delay}" @@ -36,7 +36,7 @@ resource "datadog_monitor" "virtualmachine_cpu_usage" { ) > ${var.cpu_usage_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { critical = "${var.cpu_usage_threshold_critical}" @@ -70,7 +70,7 @@ resource "datadog_monitor" "virtualmachine_credit_cpu_remaining_too_low" { * 100 , 100) < ${var.cpu_remaining_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.cpu_remaining_rate_threshold_warning}" diff --git a/cloud/gcp/big-query/monitors-big-query.tf b/cloud/gcp/big-query/monitors-big-query.tf index b20484d..6575b87 100644 --- a/cloud/gcp/big-query/monitors-big-query.tf +++ b/cloud/gcp/big-query/monitors-big-query.tf @@ -6,7 +6,7 @@ resource "datadog_monitor" "concurrent_queries" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${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)}" - type = "metric alert" + type = "query alert" query = < ${var.evictedkeys_change_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.evictedkeys_change_threshold_warning}" @@ -73,7 +73,7 @@ resource "datadog_monitor" "expirations" { ) > ${var.expirations_rate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.expirations_rate_threshold_warning}" @@ -105,7 +105,7 @@ resource "datadog_monitor" "blocked_clients" { ) * 100 > ${var.blocked_clients_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.blocked_clients_threshold_warning}" @@ -136,7 +136,7 @@ resource "datadog_monitor" "keyspace_full" { ) == ${var.keyspace_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.keyspace_threshold_warning}" @@ -168,7 +168,7 @@ resource "datadog_monitor" "memory_used" { ) * 100 > ${var.mem_used_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.mem_used_threshold_warning}" @@ -199,7 +199,7 @@ resource "datadog_monitor" "memory_frag" { * 100 > ${var.mem_frag_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.mem_frag_threshold_warning}" @@ -230,7 +230,7 @@ resource "datadog_monitor" "rejected_connections" { ) > ${var.rejected_con_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.rejected_con_threshold_warning}" @@ -261,7 +261,7 @@ resource "datadog_monitor" "latency" { ) > ${var.latency_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.latency_threshold_warning}" @@ -294,7 +294,7 @@ resource "datadog_monitor" "hitrate" { ) * 100 < ${var.hitrate_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.hitrate_threshold_warning}" diff --git a/middleware/php-fpm/monitors-fpm.tf b/middleware/php-fpm/monitors-fpm.tf index bbb70f9..464cd5e 100644 --- a/middleware/php-fpm/monitors-fpm.tf +++ b/middleware/php-fpm/monitors-fpm.tf @@ -32,7 +32,7 @@ resource "datadog_monitor" "php_fpm_connect_idle" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Php-fpm busy worker {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.php_fpm_busy_message, var.message)}" - type = "metric alert" + type = "query alert" query = < ${var.cpu_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.cpu_threshold_warning}" @@ -39,7 +39,7 @@ resource "datadog_monitor" "load" { ) > ${var.load_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.load_threshold_warning}" @@ -69,7 +69,7 @@ resource "datadog_monitor" "disk_space" { * 100 > ${var.disk_space_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.disk_space_threshold_warning}" @@ -137,7 +137,7 @@ resource "datadog_monitor" "disk_inodes" { * 100 > ${var.disk_inodes_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.disk_inodes_threshold_warning}" @@ -168,7 +168,7 @@ resource "datadog_monitor" "memory" { < ${var.memory_threshold_critical} EOQ - type = "metric alert" + type = "query alert" thresholds { warning = "${var.memory_threshold_warning}"