From 5c7f47fb75c6fc37d5447e95605a23ea10175f85 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Tue, 23 Apr 2019 10:08:43 +0200 Subject: [PATCH 1/3] MON-326 use EOQ instead of EOL or EOF --- caas/kubernetes/ark/monitors-ark.tf | 4 +- .../ingress/vts/monitors-ingress.tf | 8 +- cloud/aws/alb/monitors-alb.tf | 24 ++--- cloud/aws/apigateway/monitors-api.tf | 12 +-- .../common/monitors-elasticache.tf | 24 ++--- .../memcached/monitors-memcached.tf | 8 +- cloud/aws/elasticache/redis/monitors-redis.tf | 16 ++-- .../elasticsearch/monitors-elasticsearch.tf | 12 +-- cloud/aws/elb/monitors-elb.tf | 24 ++--- .../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 | 12 +-- cloud/aws/vpn/monitors-vpn.tf | 4 +- .../monitors-azure-apimanagement.tf | 20 ++--- .../app-services/monitors-app_services.tf | 20 ++--- .../azure-search/monitors-azure-search.tf | 8 +- cloud/azure/cosmosdb/monitors-cosmosdb.tf | 16 ++-- .../datalakestore/monitors-datalakestore.tf | 4 +- cloud/azure/eventgrid/monitors-eventgrid.tf | 12 +-- cloud/azure/eventhub/monitors-eventhub.tf | 12 +-- cloud/azure/functions/monitors-functions.tf | 12 +-- cloud/azure/iothubs/monitors-iothubs.tf | 56 ++++++------ cloud/azure/keyvault/monitors-keyvault.tf | 12 +-- .../load-balancer/monitors-load-balancer.tf | 4 +- cloud/azure/mysql/monitors-mysql.tf | 16 ++-- .../azure/postgresql/monitors-postegresql.tf | 20 ++--- cloud/azure/redis/monitors-azure-redis.tf | 16 ++-- .../serverfarms/monitors-azure-serverfarms.tf | 12 +-- .../azure/servicebus/monitors-service-bus.tf | 16 ++-- .../monitors-sql-database-basics.tf | 20 ++--- cloud/azure/storage/monitors-azure-storage.tf | 36 ++++---- .../monitors-stream-analytics.tf | 20 ++--- .../monitors-virtual-machine.tf | 12 +-- cloud/gcp/big-query/monitors-big-query.tf | 36 ++++---- .../common/monitors-cloud-sql-common.tf | 24 ++--- .../mysql/monitors-cloudsql-mysql.tf | 4 +- .../gcp/gce/instance/monitors-gce-instance.tf | 12 +-- cloud/gcp/lb/monitors-lb.tf | 20 ++--- cloud/gcp/pubsub/monitors-pubsub.tf | 8 +- .../elasticsearch/monitors-elasticsearch.tf | 88 +++++++++---------- database/mongodb/monitors-mongo.tf | 16 ++-- database/mysql/monitors-mysql.tf | 32 +++---- database/postgresql/monitors-postgresql.tf | 12 +-- database/redis/monitors-redis.tf | 40 ++++----- middleware/apache/monitors-apache.tf | 4 +- middleware/nginx/monitors-nginx.tf | 4 +- middleware/php-fpm/monitors-fpm.tf | 8 +- system/generic/monitors-system.tf | 24 ++--- 49 files changed, 418 insertions(+), 418 deletions(-) diff --git a/caas/kubernetes/ark/monitors-ark.tf b/caas/kubernetes/ark/monitors-ark.tf index f7ca08b..a0279f3 100644 --- a/caas/kubernetes/ark/monitors-ark.tf +++ b/caas/kubernetes/ark/monitors-ark.tf @@ -4,9 +4,9 @@ resource "datadog_monitor" "ark_schedules_monitor" { type = "metric alert" message = "${coalesce(var.ark_schedules_monitor_message, var.message)}" - query = < 1 - EOF + EOQ thresholds { critical = 1 diff --git a/caas/kubernetes/ingress/vts/monitors-ingress.tf b/caas/kubernetes/ingress/vts/monitors-ingress.tf index b70f2d7..e170360 100644 --- a/caas/kubernetes/ingress/vts/monitors-ingress.tf +++ b/caas/kubernetes/ingress/vts/monitors-ingress.tf @@ -3,12 +3,12 @@ resource "datadog_monitor" "nginx_ingress_too_many_5xx" { name = "[${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)}" - query = < ${var.ingress_5xx_threshold_critical} - EOF + EOQ type = "metric alert" @@ -37,12 +37,12 @@ resource "datadog_monitor" "nginx_ingress_too_many_4xx" { name = "[${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)}" - query = < ${var.ingress_4xx_threshold_critical} - EOF + EOQ type = "metric alert" diff --git a/cloud/aws/alb/monitors-alb.tf b/cloud/aws/alb/monitors-alb.tf index 8241ffd..7e436bc 100644 --- a/cloud/aws/alb/monitors-alb.tf +++ b/cloud/aws/alb/monitors-alb.tf @@ -4,13 +4,13 @@ resource "datadog_monitor" "ALB_no_healthy_instances" { type = "metric alert" message = "${coalesce(var.alb_no_healthy_instances_message, var.message)}" - query = < ${var.latency_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -68,12 +68,12 @@ resource "datadog_monitor" "ALB_httpcode_5xx" { type = "metric alert" message = "${coalesce(var.httpcode_alb_5xx_message, var.message)}" - query = < ${var.httpcode_alb_5xx_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -100,12 +100,12 @@ resource "datadog_monitor" "ALB_httpcode_4xx" { type = "metric alert" message = "${coalesce(var.httpcode_alb_4xx_message, var.message)}" - query = < ${var.httpcode_alb_4xx_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -132,12 +132,12 @@ resource "datadog_monitor" "ALB_httpcode_target_5xx" { type = "metric alert" message = "${coalesce(var.httpcode_target_5xx_message, var.message)}" - query = < ${var.httpcode_target_5xx_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -164,12 +164,12 @@ resource "datadog_monitor" "ALB_httpcode_target_4xx" { type = "metric alert" message = "${coalesce(var.httpcode_target_4xx_message, var.message)}" - query = < ${var.httpcode_target_4xx_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" diff --git a/cloud/aws/apigateway/monitors-api.tf b/cloud/aws/apigateway/monitors-api.tf index cb6a9cc..b397a70 100644 --- a/cloud/aws/apigateway/monitors-api.tf +++ b/cloud/aws/apigateway/monitors-api.tf @@ -5,11 +5,11 @@ resource "datadog_monitor" "API_Gateway_latency" { type = "metric alert" message = "${coalesce(var.latency_message, var.message)}" - query = < ${var.latency_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -37,12 +37,12 @@ resource "datadog_monitor" "API_http_5xx_errors_count" { type = "metric alert" message = "${coalesce(var.http_5xx_requests_message, var.message)}" - query = < ${var.http_5xx_requests_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -70,12 +70,12 @@ resource "datadog_monitor" "API_http_4xx_errors_count" { type = "metric alert" message = "${coalesce(var.http_4xx_requests_message, var.message)}" - query = < ${var.http_4xx_requests_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" diff --git a/cloud/aws/elasticache/common/monitors-elasticache.tf b/cloud/aws/elasticache/common/monitors-elasticache.tf index 40e4e9d..5a3ccdd 100644 --- a/cloud/aws/elasticache/common/monitors-elasticache.tf +++ b/cloud/aws/elasticache/common/monitors-elasticache.tf @@ -5,11 +5,11 @@ resource "datadog_monitor" "elasticache_eviction" { type = "metric alert" - query = < ${var.eviction_threshold_critical} - EOF + EOQ thresholds { warning = "${var.eviction_threshold_warning}" @@ -38,11 +38,11 @@ resource "datadog_monitor" "elasticache_max_connection" { type = "metric alert" - query = <= 65000 - EOF + EOQ notify_no_data = true evaluation_delay = "${var.evaluation_delay}" @@ -66,11 +66,11 @@ resource "datadog_monitor" "elasticache_no_connection" { type = "metric alert" - query = < ${var.swap_threshold_critical} - EOF + EOQ thresholds { warning = "${var.swap_threshold_warning}" @@ -127,11 +127,11 @@ resource "datadog_monitor" "elasticache_free_memory" { type = "metric alert" - query = < ${var.eviction_growing_threshold_critical} - EOF + EOQ thresholds { warning = "${var.eviction_growing_threshold_warning}" diff --git a/cloud/aws/elasticache/memcached/monitors-memcached.tf b/cloud/aws/elasticache/memcached/monitors-memcached.tf index ec95b24..fc4ef33 100644 --- a/cloud/aws/elasticache/memcached/monitors-memcached.tf +++ b/cloud/aws/elasticache/memcached/monitors-memcached.tf @@ -5,13 +5,13 @@ resource "datadog_monitor" "memcached_get_hits" { type = "metric alert" - query = < ${var.cpu_high_threshold_critical} - EOF + EOQ thresholds { warning = "${var.cpu_high_threshold_warning}" diff --git a/cloud/aws/elasticache/redis/monitors-redis.tf b/cloud/aws/elasticache/redis/monitors-redis.tf index b87055d..d10f6b2 100644 --- a/cloud/aws/elasticache/redis/monitors-redis.tf +++ b/cloud/aws/elasticache/redis/monitors-redis.tf @@ -5,13 +5,13 @@ resource "datadog_monitor" "redis_cache_hits" { type = "metric alert" - query = < ${var.cpu_high_threshold_critical} - EOF + EOQ notify_no_data = true evaluation_delay = "${var.evaluation_delay}" @@ -68,11 +68,11 @@ resource "datadog_monitor" "redis_replication_lag" { type = "metric alert" - query = < ${var.replication_lag_threshold_critical} - EOF + EOQ thresholds { warning = "${var.replication_lag_threshold_warning}" @@ -101,12 +101,12 @@ resource "datadog_monitor" "redis_commands" { type = "metric alert" - query = <= 2 -EOF +EOQ thresholds { warning = 1 @@ -45,12 +45,12 @@ resource "datadog_monitor" "es_free_space_low" { type = "metric alert" - query = < ${var.cpu_threshold_critical} -EOF +EOQ thresholds { warning = "${var.cpu_threshold_warning}" diff --git a/cloud/aws/elb/monitors-elb.tf b/cloud/aws/elb/monitors-elb.tf index c8fdbb5..0b84d42 100644 --- a/cloud/aws/elb/monitors-elb.tf +++ b/cloud/aws/elb/monitors-elb.tf @@ -3,13 +3,13 @@ resource "datadog_monitor" "ELB_no_healthy_instances" { name = "[${var.environment}] ELB healthy instances {{#is_alert}}is at 0{{/is_alert}}{{#is_warning}}is at {{value}}%{{/is_warning}}" message = "${coalesce(var.elb_no_healthy_instance_message, var.message)}" - query = < ${var.elb_4xx_threshold_critical} - EOF + EOQ type = "metric alert" @@ -72,12 +72,12 @@ resource "datadog_monitor" "ELB_too_much_5xx" { name = "[${var.environment}] ELB 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.elb_5xx_message, var.message)}" - query = < ${var.elb_5xx_threshold_critical} - EOF + EOQ type = "metric alert" @@ -106,12 +106,12 @@ resource "datadog_monitor" "ELB_too_much_4xx_backend" { name = "[${var.environment}] ELB backend 4xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.elb_backend_4xx_message, var.message)}" - query = < ${var.elb_backend_4xx_threshold_critical} - EOF + EOQ type = "metric alert" @@ -140,12 +140,12 @@ resource "datadog_monitor" "ELB_too_much_5xx_backend" { name = "[${var.environment}] ELB backend 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.elb_backend_5xx_message, var.message)}" - query = < ${var.elb_backend_5xx_threshold_critical} - EOF + EOQ type = "metric alert" @@ -174,11 +174,11 @@ resource "datadog_monitor" "ELB_backend_latency" { name = "[${var.environment}] ELB latency too high {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" message = "${coalesce(var.elb_backend_latency_message, var.message)}" - query = < ${var.elb_backend_latency_critical} - EOF + EOQ type = "metric alert" diff --git a/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf b/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf index f23b7ca..b32ce4c 100644 --- a/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf +++ b/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf @@ -6,11 +6,11 @@ resource "datadog_monitor" "firehose_incoming_records" { type = "metric alert" - query = < ${var.aurora_replicalag_threshold_critical} -EOF +EOQ thresholds { warning = "${var.aurora_replicalag_threshold_warning}" diff --git a/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf b/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf index 14c8271..2da7253 100644 --- a/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf +++ b/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf @@ -6,11 +6,11 @@ resource "datadog_monitor" "rds_aurora_postgresql_replica_lag" { type = "metric alert" - query = < ${var.aurora_replicalag_threshold_critical} -EOF +EOQ thresholds { warning = "${var.aurora_replicalag_threshold_warning}" diff --git a/cloud/aws/rds/common/monitors-rds-common.tf b/cloud/aws/rds/common/monitors-rds-common.tf index 10a4d7b..d78581b 100644 --- a/cloud/aws/rds/common/monitors-rds-common.tf +++ b/cloud/aws/rds/common/monitors-rds-common.tf @@ -6,11 +6,11 @@ resource "datadog_monitor" "rds_cpu_90_15min" { type = "metric alert" - query = < ${var.cpu_threshold_critical} -EOF +EOQ thresholds { warning = "${var.cpu_threshold_warning}" @@ -39,12 +39,12 @@ resource "datadog_monitor" "rds_free_space_low" { type = "metric alert" - query = < ${var.replicalag_threshold_critical} -EOF +EOQ thresholds { warning = "${var.replicalag_threshold_warning}" diff --git a/cloud/aws/vpn/monitors-vpn.tf b/cloud/aws/vpn/monitors-vpn.tf index a2c3afc..1e87080 100644 --- a/cloud/aws/vpn/monitors-vpn.tf +++ b/cloud/aws/vpn/monitors-vpn.tf @@ -3,11 +3,11 @@ resource "datadog_monitor" "VPN_status" { name = "[${var.environment}] VPN tunnel down" message = "${coalesce(var.vpn_status_message, var.message)}" - query = < ${var.failed_requests_threshold_critical} - EOF + EOQ thresholds { critical = "${var.failed_requests_threshold_critical}" @@ -66,12 +66,12 @@ resource "datadog_monitor" "apimgt_other_requests" { name = "[${var.environment}] API Management too many other requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.other_requests_message, var.message)}" - query = < ${var.other_requests_threshold_critical} - EOF + EOQ thresholds { critical = "${var.other_requests_threshold_critical}" @@ -99,12 +99,12 @@ resource "datadog_monitor" "apimgt_unauthorized_requests" { name = "[${var.environment}] API Management too many unauthorized requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.unauthorized_requests_message, var.message)}" - query = < ${var.unauthorized_requests_threshold_critical} - EOF + EOQ thresholds { critical = "${var.unauthorized_requests_threshold_critical}" @@ -132,14 +132,14 @@ resource "datadog_monitor" "apimgt_successful_requests" { name = "[${var.environment}] API Management successful requests rate too low {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.successful_requests_message, var.message)}" - query = < ${var.response_time_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -37,11 +37,11 @@ resource "datadog_monitor" "appservices_memory_usage_count" { type = "metric alert" message = "${coalesce(var.memory_usage_message, var.message)}" - query = < ${var.memory_usage_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -69,12 +69,12 @@ resource "datadog_monitor" "appservices_http_5xx_errors_count" { type = "metric alert" message = "${coalesce(var.http_5xx_requests_message, var.message)}" - query = < ${var.http_5xx_requests_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -102,12 +102,12 @@ resource "datadog_monitor" "appservices_http_4xx_errors_count" { type = "metric alert" message = "${coalesce(var.http_4xx_requests_message, var.message)}" - query = < ${var.http_4xx_requests_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -135,14 +135,14 @@ resource "datadog_monitor" "appservices_http_success_status_rate" { type = "metric alert" message = "${coalesce(var.http_successful_requests_message, var.message)}" - query = < ${var.latency_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -37,11 +37,11 @@ resource "datadog_monitor" "azure_search_throttled_queries_rate" { type = "metric alert" message = "${coalesce(var.throttled_queries_rate_message, var.message)}" - query = < ${var.throttled_queries_rate_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" diff --git a/cloud/azure/cosmosdb/monitors-cosmosdb.tf b/cloud/azure/cosmosdb/monitors-cosmosdb.tf index 4e30f78..4afde15 100644 --- a/cloud/azure/cosmosdb/monitors-cosmosdb.tf +++ b/cloud/azure/cosmosdb/monitors-cosmosdb.tf @@ -4,11 +4,11 @@ resource "datadog_monitor" "cosmos_db_status" { name = "[${var.environment}] Cosmos DB is down" message = "${coalesce(var.status_message, var.message)}" - query = < ${var.cosmos_db_4xx_request_rate_threshold_critical} - EOF + EOQ type = "metric alert" @@ -82,13 +82,13 @@ resource "datadog_monitor" "cosmos_db_5xx_requests" { name = "[${var.environment}] Cosmos DB 5xx requests rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cosmos_db_5xx_requests_message, var.message)}" - query = < ${var.cosmos_db_5xx_request_rate_threshold_critical} - EOF + EOQ type = "metric alert" @@ -119,12 +119,12 @@ resource "datadog_monitor" "cosmos_db_scaling" { message = "${coalesce(var.cosmos_db_scaling_message, var.message)}" # List of available status codes : https://docs.microsoft.com/en-us/rest/api/cosmos-db/http-status-codes-for-cosmosdb - query = < ${var.cosmos_db_scaling_error_rate_threshold_critical} - EOF + EOQ type = "metric alert" diff --git a/cloud/azure/datalakestore/monitors-datalakestore.tf b/cloud/azure/datalakestore/monitors-datalakestore.tf index 8620fb1..721fb75 100644 --- a/cloud/azure/datalakestore/monitors-datalakestore.tf +++ b/cloud/azure/datalakestore/monitors-datalakestore.tf @@ -4,11 +4,11 @@ resource "datadog_monitor" "datalakestore_status" { name = "[${var.environment}] Datalake Store is down" message = "${coalesce(var.status_message, var.message)}" - query = < ${var.failed_messages_rate_thresold_critical} - EOF + EOQ type = "metric alert" @@ -68,7 +68,7 @@ resource "datadog_monitor" "eventgrid_unmatched_events" { name = "[${var.environment}] Event Grid too many unmatched events {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.unmatched_events_rate_message, var.message)}" - query = < ${var.unmatched_events_rate_thresold_critical} - EOF + EOQ type = "metric alert" diff --git a/cloud/azure/eventhub/monitors-eventhub.tf b/cloud/azure/eventhub/monitors-eventhub.tf index 12d83ea..52c059b 100644 --- a/cloud/azure/eventhub/monitors-eventhub.tf +++ b/cloud/azure/eventhub/monitors-eventhub.tf @@ -3,11 +3,11 @@ resource "datadog_monitor" "eventhub_status" { name = "[${var.environment}] Event Hub is down" message = "${coalesce(var.status_message, var.message)}" - query = < ${var.failed_requests_rate_thresold_critical} - EOF + EOQ type = "metric alert" @@ -65,14 +65,14 @@ resource "datadog_monitor" "eventhub_errors" { name = "[${var.environment}] Event Hub too many errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.errors_rate_message, var.message)}" - query = < ${var.errors_rate_thresold_critical} - EOF + EOQ type = "metric alert" diff --git a/cloud/azure/functions/monitors-functions.tf b/cloud/azure/functions/monitors-functions.tf index 995aa58..71db0fa 100644 --- a/cloud/azure/functions/monitors-functions.tf +++ b/cloud/azure/functions/monitors-functions.tf @@ -4,12 +4,12 @@ resource "datadog_monitor" "function_http_5xx_errors_rate" { type = "metric alert" message = "${coalesce(var.http_5xx_errors_rate_message, var.message)}" - query = < ${var.http_5xx_errors_rate_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -36,11 +36,11 @@ resource "datadog_monitor" "function_high_connections_count" { type = "metric alert" message = "${coalesce(var.high_connections_count_message, var.message)}" - query = < ${var.high_connections_count_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -67,11 +67,11 @@ resource "datadog_monitor" "function_high_threads_count" { type = "metric alert" message = "${coalesce(var.high_threads_count_message, var.message)}" - query = < ${var.high_threads_count_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" diff --git a/cloud/azure/iothubs/monitors-iothubs.tf b/cloud/azure/iothubs/monitors-iothubs.tf index ba85e1c..7d234d5 100644 --- a/cloud/azure/iothubs/monitors-iothubs.tf +++ b/cloud/azure/iothubs/monitors-iothubs.tf @@ -3,14 +3,14 @@ resource "datadog_monitor" "too_many_jobs_failed" { name = "[${var.environment}] IOT Hub Too many jobs failed {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_jobs_rate_message, var.message)}" - query = < ${var.failed_jobs_rate_threshold_critical} - EOF + EOQ type = "metric alert" @@ -39,14 +39,14 @@ resource "datadog_monitor" "too_many_list_jobs_failed" { name = "[${var.environment}] IOT Hub Too many list_jobs failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_listjobs_rate_message, var.message)}" - query = < ${var.failed_listjobs_rate_threshold_critical} - EOF + EOQ type = "metric alert" @@ -75,14 +75,14 @@ resource "datadog_monitor" "too_many_query_jobs_failed" { name = "[${var.environment}] IOT Hub Too many query_jobs failed {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_queryjobs_rate_message, var.message)}" - query = < ${var.failed_queryjobs_rate_threshold_critical} - EOF + EOQ type = "metric alert" @@ -111,11 +111,11 @@ resource "datadog_monitor" "status" { name = "[${var.environment}] IOT Hub is down" message = "${coalesce(var.status_message, var.message)}" - query = < ${var.failed_c2d_methods_rate_threshold_critical} - EOF + EOQ type = "metric alert" @@ -203,14 +203,14 @@ resource "datadog_monitor" "too_many_c2d_twin_read_failed" { name = "[${var.environment}] IOT Hub Too many c2d twin read failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_c2d_twin_read_rate_message, var.message)}" - query = < ${var.failed_c2d_twin_read_rate_threshold_critical} - EOF + EOQ type = "metric alert" @@ -239,14 +239,14 @@ resource "datadog_monitor" "too_many_c2d_twin_update_failed" { name = "[${var.environment}] IOT Hub Too many c2d twin update failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_c2d_twin_update_rate_message, var.message)}" - query = < ${var.failed_c2d_twin_update_rate_threshold_critical} - EOF + EOQ type = "metric alert" @@ -275,14 +275,14 @@ resource "datadog_monitor" "too_many_d2c_twin_read_failed" { name = "[${var.environment}] IOT Hub Too many d2c twin read failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_d2c_twin_read_rate_message, var.message)}" - query = < ${var.failed_d2c_twin_read_rate_threshold_critical} - EOF + EOQ type = "metric alert" @@ -311,14 +311,14 @@ resource "datadog_monitor" "too_many_d2c_twin_update_failed" { name = "[${var.environment}] IOT Hub Too many d2c twin update failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_d2c_twin_update_rate_message, var.message)}" - query = < ${var.failed_d2c_twin_update_rate_threshold_critical} - EOF + EOQ type = "metric alert" @@ -347,7 +347,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_dropped" { name = "[${var.environment}] IOT Hub Too many d2c telemetry egress dropped {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.dropped_d2c_telemetry_egress_message, var.message)}" - query = < ${var.dropped_d2c_telemetry_egress_rate_threshold_critical} - EOF + EOQ type = "metric alert" @@ -385,7 +385,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_orphaned" { name = "[${var.environment}] IOT Hub Too many d2c telemetry egress orphaned {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.orphaned_d2c_telemetry_egress_message, var.message)}" - query = < ${var.orphaned_d2c_telemetry_egress_rate_threshold_critical} - EOF + EOQ type = "metric alert" @@ -423,7 +423,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_invalid" { name = "[${var.environment}] IOT Hub Too many d2c telemetry egress invalid {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.invalid_d2c_telemetry_egress_message, var.message)}" - query = < ${var.invalid_d2c_telemetry_egress_rate_threshold_critical} - EOF + EOQ type = "metric alert" @@ -461,13 +461,13 @@ resource "datadog_monitor" "too_many_d2c_telemetry_ingress_nosent" { name = "[${var.environment}] IOT Hub Too many d2c telemetry ingress not sent {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.too_many_d2c_telemetry_ingress_nosent_message, var.message)}" - query = < 0 - EOF + EOQ type = "metric alert" diff --git a/cloud/azure/keyvault/monitors-keyvault.tf b/cloud/azure/keyvault/monitors-keyvault.tf index 984edb8..02865b3 100644 --- a/cloud/azure/keyvault/monitors-keyvault.tf +++ b/cloud/azure/keyvault/monitors-keyvault.tf @@ -4,11 +4,11 @@ resource "datadog_monitor" "keyvault_status" { name = "[${var.environment}] Key Vault is down" message = "${coalesce(var.status_message, var.message)}" - query = < ${var.api_latency_threshold_critical} - EOF + EOQ thresholds { critical = "${var.api_latency_threshold_critical}" diff --git a/cloud/azure/load-balancer/monitors-load-balancer.tf b/cloud/azure/load-balancer/monitors-load-balancer.tf index 8852925..4db10da 100644 --- a/cloud/azure/load-balancer/monitors-load-balancer.tf +++ b/cloud/azure/load-balancer/monitors-load-balancer.tf @@ -4,11 +4,11 @@ resource "datadog_monitor" "loadbalancer_status" { name = "[${var.environment}] Load Balancer is unreachable" message = "${coalesce(var.status_message, var.message)}" - query = < ${var.cpu_usage_threshold_critical} - EOF + EOQ type = "metric alert" @@ -36,11 +36,11 @@ resource "datadog_monitor" "mysql_free_storage" { name = "[${var.environment}] Mysql Server storage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.free_storage_message, var.message)}" - query = < ${var.io_consumption_threshold_critical} - EOF + EOQ type = "metric alert" @@ -102,11 +102,11 @@ resource "datadog_monitor" "mysql_memory_usage" { name = "[${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)}" - query = < ${var.memory_usage_threshold_critical} - EOF + EOQ type = "metric alert" diff --git a/cloud/azure/postgresql/monitors-postegresql.tf b/cloud/azure/postgresql/monitors-postegresql.tf index d92f42d..3aa9cdd 100644 --- a/cloud/azure/postgresql/monitors-postegresql.tf +++ b/cloud/azure/postgresql/monitors-postegresql.tf @@ -3,11 +3,11 @@ resource "datadog_monitor" "postgresql_cpu_usage" { name = "[${var.environment}] Postgresql Server CPU usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_usage_message, var.message)}" - query = < ${var.cpu_usage_threshold_critical} - EOF + EOQ type = "metric alert" @@ -36,11 +36,11 @@ resource "datadog_monitor" "postgresql_no_connection" { name = "[${var.environment}] Postgresql Server has no connection" message = "${coalesce(var.no_connection_message, var.message)}" - query = < ${var.io_consumption_threshold_critical} - EOF + EOQ type = "metric alert" @@ -130,11 +130,11 @@ resource "datadog_monitor" "postgresql_memory_usage" { name = "[${var.environment}] Postgresql 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)}" - query = < ${var.memory_usage_threshold_critical} - EOF + EOQ type = "metric alert" diff --git a/cloud/azure/redis/monitors-azure-redis.tf b/cloud/azure/redis/monitors-azure-redis.tf index 3709b54..2d60d72 100644 --- a/cloud/azure/redis/monitors-azure-redis.tf +++ b/cloud/azure/redis/monitors-azure-redis.tf @@ -3,11 +3,11 @@ resource "datadog_monitor" "status" { name = "[${var.environment}] Redis {{name}} is down" message = "${coalesce(var.status_message, var.message)}" - query = < ${var.evictedkeys_limit_threshold_critical} -EOF +EOQ type = "metric alert" @@ -64,11 +64,11 @@ resource "datadog_monitor" "percent_processor_time" { name = "[${var.environment}] Redis processor time too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.percent_processor_time_message, var.message)}" - query = < ${var.percent_processor_time_threshold_critical} -EOF +EOQ type = "metric alert" @@ -97,11 +97,11 @@ resource "datadog_monitor" "server_load" { name = "[${var.environment}] Redis server load too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.server_load_rate_message, var.message)}" - query = < ${var.server_load_rate_threshold_critical} -EOF +EOQ type = "metric alert" diff --git a/cloud/azure/serverfarms/monitors-azure-serverfarms.tf b/cloud/azure/serverfarms/monitors-azure-serverfarms.tf index 2df06ab..7a52a0f 100644 --- a/cloud/azure/serverfarms/monitors-azure-serverfarms.tf +++ b/cloud/azure/serverfarms/monitors-azure-serverfarms.tf @@ -3,11 +3,11 @@ resource "datadog_monitor" "status" { name = "[${var.environment}] Serverfarm is down" message = "${coalesce(var.status_message, var.message)}" - query = < ${var.cpu_percentage_threshold_critical} - EOF + EOQ type = "metric alert" @@ -64,11 +64,11 @@ resource "datadog_monitor" "memory_percentage" { name = "[${var.environment}] Serverfarm memory percentage is too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.memory_percentage_message, var.message)}" - query = < ${var.memory_percentage_threshold_critical} - EOF + EOQ type = "metric alert" diff --git a/cloud/azure/servicebus/monitors-service-bus.tf b/cloud/azure/servicebus/monitors-service-bus.tf index e205ee6..c0a004b 100644 --- a/cloud/azure/servicebus/monitors-service-bus.tf +++ b/cloud/azure/servicebus/monitors-service-bus.tf @@ -4,11 +4,11 @@ resource "datadog_monitor" "servicebus_status" { name = "[${var.environment}] Service Bus is down" message = "${coalesce(var.status_message, var.message)}" - query = < ${var.user_errors_threshold_critical} - EOF + EOQ type = "metric alert" @@ -97,12 +97,12 @@ resource "datadog_monitor" "service_bus_server_errors" { name = "[${var.environment}] Service Bus server errors rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.server_errors_message, var.message)}" - query = < ${var.server_errors_threshold_critical} - EOF + EOQ type = "metric alert" diff --git a/cloud/azure/sql-database/monitors-sql-database-basics.tf b/cloud/azure/sql-database/monitors-sql-database-basics.tf index 3160e5f..e639e40 100644 --- a/cloud/azure/sql-database/monitors-sql-database-basics.tf +++ b/cloud/azure/sql-database/monitors-sql-database-basics.tf @@ -3,11 +3,11 @@ resource "datadog_monitor" "status" { name = "[${var.environment}] SQL Database is down" message = "${coalesce(var.status_message, var.message)}" - query = < ${var.cpu_threshold_critical} - EOF + EOQ type = "metric alert" @@ -65,11 +65,11 @@ resource "datadog_monitor" "sql-database_free_space_low" { type = "metric alert" - query = < ${var.diskspace_threshold_critical} - EOF + EOQ thresholds { warning = "${var.diskspace_threshold_warning}" @@ -98,11 +98,11 @@ resource "datadog_monitor" "sql-database_dtu_consumption_high" { type = "metric alert" - query = < ${var.dtu_threshold_critical} - EOF + EOQ thresholds { warning = "${var.dtu_threshold_warning}" @@ -131,11 +131,11 @@ resource "datadog_monitor" "sql-database_deadlocks_count" { type = "metric alert" - query = < ${var.deadlock_threshold_critical} - EOF + EOQ thresholds { critical = "${var.deadlock_threshold_critical}" diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index 0c1e022..5928a55 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -3,11 +3,11 @@ resource "datadog_monitor" "availability" { name = "[${var.environment}] Azure Storage is down" message = "${coalesce(var.availability_message, var.message)}" - query = < ${var.latency_threshold_critical} -EOF +EOQ thresholds { critical = "${var.latency_threshold_critical}" @@ -99,11 +99,11 @@ resource "datadog_monitor" "timeout_error_requests" { name = "[${var.environment}] Azure Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.timeout_error_requests_message, var.message)}" - query = < ${var.timeout_error_requests_threshold_critical} -EOF +EOQ thresholds { critical = "${var.timeout_error_requests_threshold_critical}" @@ -131,11 +131,11 @@ resource "datadog_monitor" "network_error_requests" { name = "[${var.environment}] Azure Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.network_error_requests_message, var.message)}" - query = < ${var.network_error_requests_threshold_critical} -EOF +EOQ thresholds { critical = "${var.network_error_requests_threshold_critical}" @@ -163,11 +163,11 @@ resource "datadog_monitor" "throttling_error_requests" { name = "[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.throttling_error_requests_message, var.message)}" - query = < ${var.throttling_error_requests_threshold_critical} -EOF +EOQ thresholds { critical = "${var.throttling_error_requests_threshold_critical}" @@ -195,11 +195,11 @@ resource "datadog_monitor" "server_other_error_requests" { name = "[${var.environment}] Azure Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.server_other_error_requests_message, var.message)}" - query = < ${var.server_other_error_requests_threshold_critical} -EOF +EOQ thresholds { critical = "${var.server_other_error_requests_threshold_critical}" @@ -227,11 +227,11 @@ resource "datadog_monitor" "client_other_error_requests" { name = "[${var.environment}] Azure Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.client_other_error_requests_message, var.message)}" - query = < ${var.client_other_error_requests_threshold_critical} -EOF +EOQ thresholds { critical = "${var.client_other_error_requests_threshold_critical}" @@ -259,11 +259,11 @@ resource "datadog_monitor" "authorization_error_requests" { name = "[${var.environment}] Azure Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.authorization_error_requests_message, var.message)}" - query = < ${var.authorization_error_requests_threshold_critical} -EOF +EOQ thresholds { critical = "${var.authorization_error_requests_threshold_critical}" diff --git a/cloud/azure/stream-analytics/monitors-stream-analytics.tf b/cloud/azure/stream-analytics/monitors-stream-analytics.tf index 549094e..1e62d78 100644 --- a/cloud/azure/stream-analytics/monitors-stream-analytics.tf +++ b/cloud/azure/stream-analytics/monitors-stream-analytics.tf @@ -3,11 +3,11 @@ resource "datadog_monitor" "status" { name = "[${var.environment}] Stream Analytics is down" message = "${coalesce(var.status_message, var.message)}" - query = < ${var.su_utilization_threshold_critical} - EOF + EOQ type = "metric alert" @@ -64,12 +64,12 @@ resource "datadog_monitor" "failed_function_requests" { name = "[${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)}" - query = < ${var.failed_function_requests_threshold_critical} - EOF + EOQ type = "metric alert" @@ -98,11 +98,11 @@ resource "datadog_monitor" "conversion_errors" { name = "[${var.environment}] Stream Analytics too many conversion errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.conversion_errors_message, var.message)}" - query = < ${var.conversion_errors_threshold_critical} - EOF + EOQ type = "metric alert" @@ -131,11 +131,11 @@ resource "datadog_monitor" "runtime_errors" { name = "[${var.environment}] Stream Analytics too many runtime errors {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.runtime_errors_message, var.message)}" - query = < ${var.runtime_errors_threshold_critical} - EOF + EOQ type = "metric alert" diff --git a/cloud/azure/virtual-machine/monitors-virtual-machine.tf b/cloud/azure/virtual-machine/monitors-virtual-machine.tf index 29cba32..a25cfd7 100644 --- a/cloud/azure/virtual-machine/monitors-virtual-machine.tf +++ b/cloud/azure/virtual-machine/monitors-virtual-machine.tf @@ -4,11 +4,11 @@ resource "datadog_monitor" "virtualmachine_status" { name = "[${var.environment}] Virtual Machine is unreachable" message = "${coalesce(var.status_message, var.message)}" - query = < ${var.cpu_usage_threshold_critical} - EOF + EOQ type = "metric alert" @@ -65,14 +65,14 @@ resource "datadog_monitor" "virtualmachine_credit_cpu_remaining_too_low" { name = "[${var.environment}] Virtual Machine credit CPU {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_remaining_rate_message, var.message)}" - query = < ${var.concurrent_queries_threshold_critical} -EOF +EOQ thresholds { warning = "${var.concurrent_queries_threshold_warning}" @@ -44,10 +44,10 @@ resource "datadog_monitor" "execution_time" { type = "metric alert" - query = < ${var.execution_time_threshold_critical} -EOF +EOQ thresholds { warning = "${var.execution_time_threshold_warning}" @@ -80,10 +80,10 @@ resource "datadog_monitor" "scanned_bytes" { type = "metric alert" - query = < ${var.scanned_bytes_threshold_critical} -EOF +EOQ thresholds { warning = "${var.scanned_bytes_threshold_warning}" @@ -116,10 +116,10 @@ resource "datadog_monitor" "scanned_bytes_billed" { type = "metric alert" - query = < ${var.scanned_bytes_billed_threshold_critical} -EOF +EOQ thresholds { warning = "${var.scanned_bytes_billed_threshold_warning}" @@ -152,10 +152,10 @@ resource "datadog_monitor" "available_slots" { type = "metric alert" - query = < ${var.stored_bytes_threshold_critical} -EOF +EOQ thresholds { warning = "${var.stored_bytes_threshold_warning}" @@ -224,10 +224,10 @@ resource "datadog_monitor" "table_count" { type = "metric alert" - query = < ${var.table_count_threshold_critical} -EOF +EOQ thresholds { warning = "${var.table_count_threshold_warning}" @@ -260,10 +260,10 @@ resource "datadog_monitor" "uploaded_bytes" { type = "metric alert" - query = < ${var.uploaded_bytes_threshold_critical} -EOF +EOQ thresholds { warning = "${var.uploaded_bytes_threshold_warning}" @@ -296,10 +296,10 @@ resource "datadog_monitor" "uploaded_bytes_billed" { type = "metric alert" - query = < ${var.uploaded_bytes_billed_threshold_critical} -EOF +EOQ thresholds { warning = "${var.uploaded_bytes_billed_threshold_warning}" 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 2b37bc2..74ebd20 100644 --- a/cloud/gcp/cloud-sql/common/monitors-cloud-sql-common.tf +++ b/cloud/gcp/cloud-sql/common/monitors-cloud-sql-common.tf @@ -8,12 +8,12 @@ resource "datadog_monitor" "cpu_utilization" { type = "metric alert" - query = < ${var.cpu_utilization_threshold_critical} -EOF +EOQ thresholds { warning = "${var.cpu_utilization_threshold_warning}" @@ -46,12 +46,12 @@ resource "datadog_monitor" "disk_utilization" { type = "metric alert" - query = < ${var.disk_utilization_threshold_critical} -EOF +EOQ thresholds { warning = "${var.disk_utilization_threshold_warning}" @@ -84,7 +84,7 @@ resource "datadog_monitor" "disk_utilization_forecast" { type = "metric alert" - query = <= ${var.disk_utilization_forecast_threshold_critical} -EOF +EOQ thresholds { critical = "${var.disk_utilization_forecast_threshold_critical}" @@ -128,12 +128,12 @@ resource "datadog_monitor" "memory_utilization" { type = "metric alert" - query = < ${var.memory_utilization_threshold_critical} -EOF +EOQ thresholds { warning = "${var.memory_utilization_threshold_warning}" @@ -166,7 +166,7 @@ resource "datadog_monitor" "memory_utilization_forecast" { type = "query alert" - query = <= ${var.memory_utilization_forecast_threshold_critical} -EOF +EOQ thresholds { critical = "${var.memory_utilization_forecast_threshold_critical}" @@ -210,12 +210,12 @@ resource "datadog_monitor" "failover_unavailable" { type = "metric alert" - query = < ${var.replication_lag_threshold_critical} -EOF +EOQ thresholds { critical = "${var.replication_lag_threshold_critical}" diff --git a/cloud/gcp/gce/instance/monitors-gce-instance.tf b/cloud/gcp/gce/instance/monitors-gce-instance.tf index fed557a..4419819 100644 --- a/cloud/gcp/gce/instance/monitors-gce-instance.tf +++ b/cloud/gcp/gce/instance/monitors-gce-instance.tf @@ -8,11 +8,11 @@ resource "datadog_monitor" "cpu_utilization" { type = "metric alert" - query = < ${var.cpu_utilization_threshold_critical} -EOF +EOQ thresholds { warning = "${var.cpu_utilization_threshold_warning}" @@ -45,7 +45,7 @@ resource "datadog_monitor" "disk_throttled_bps" { type = "metric alert" - query = < ${var.disk_throttled_bps_threshold_critical} -EOF +EOQ thresholds { warning = "${var.disk_throttled_bps_threshold_warning}" @@ -88,7 +88,7 @@ resource "datadog_monitor" "disk_throttled_ops" { type = "metric alert" - query = < ${var.disk_throttled_ops_threshold_critical} -EOF +EOQ thresholds { warning = "${var.disk_throttled_ops_threshold_warning}" diff --git a/cloud/gcp/lb/monitors-lb.tf b/cloud/gcp/lb/monitors-lb.tf index 0422812..835449c 100644 --- a/cloud/gcp/lb/monitors-lb.tf +++ b/cloud/gcp/lb/monitors-lb.tf @@ -8,12 +8,12 @@ resource "datadog_monitor" "error_rate_4xx" { type = "metric alert" - query = < ${var.error_rate_4xx_threshold_critical} -EOF +EOQ thresholds { warning = "${var.error_rate_4xx_threshold_warning}" @@ -46,12 +46,12 @@ resource "datadog_monitor" "error_rate_5xx" { type = "metric alert" - query = < ${var.error_rate_5xx_threshold_critical} -EOF +EOQ thresholds { warning = "${var.error_rate_5xx_threshold_warning}" @@ -84,11 +84,11 @@ resource "datadog_monitor" "backend_latency_service" { type = "metric alert" - query = < ${var.backend_latency_service_threshold_critical} -EOF +EOQ thresholds { warning = "${var.backend_latency_service_threshold_warning}" @@ -121,11 +121,11 @@ resource "datadog_monitor" "backend_latency_bucket" { type = "metric alert" - query = < ${var.backend_latency_bucket_threshold_critical} -EOF +EOQ thresholds { warning = "${var.backend_latency_bucket_threshold_warning}" @@ -158,11 +158,11 @@ resource "datadog_monitor" "request_count" { type = "query alert" - query = < ${var.request_count_threshold_critical} -EOF +EOQ thresholds { warning = "${var.request_count_threshold_warning}" diff --git a/cloud/gcp/pubsub/monitors-pubsub.tf b/cloud/gcp/pubsub/monitors-pubsub.tf index a364670..2f71227 100644 --- a/cloud/gcp/pubsub/monitors-pubsub.tf +++ b/cloud/gcp/pubsub/monitors-pubsub.tf @@ -8,11 +8,11 @@ resource "datadog_monitor" "sending_operations_count" { type = "query alert" - query = <= ${var.unavailable_sending_operations_count_threshold_critical} -EOF +EOQ thresholds { warning = "${var.unavailable_sending_operations_count_threshold_warning}" diff --git a/database/elasticsearch/monitors-elasticsearch.tf b/database/elasticsearch/monitors-elasticsearch.tf index ecb599f..109dda6 100644 --- a/database/elasticsearch/monitors-elasticsearch.tf +++ b/database/elasticsearch/monitors-elasticsearch.tf @@ -6,9 +6,9 @@ resource "datadog_monitor" "not_responding" { name = "[${var.environment}] ElasticSearch does not respond" message = "${coalesce(var.not_responding_message, var.message)}" - query = < ${var.cluster_initializing_shards_threshold_critical} -EOF +EOQ thresholds { warning = "${var.cluster_initializing_shards_threshold_warning}" @@ -136,11 +136,11 @@ resource "datadog_monitor" "cluster_relocating_shards" { type = "metric alert" - query = < ${var.cluster_relocating_shards_threshold_critical} -EOF +EOQ thresholds { warning = "${var.cluster_relocating_shards_threshold_warning}" @@ -178,11 +178,11 @@ resource "datadog_monitor" "cluster_unassigned_shards" { type = "metric alert" - query = < ${var.cluster_unassigned_shards_threshold_critical} -EOF +EOQ thresholds { warning = "${var.cluster_unassigned_shards_threshold_warning}" @@ -220,14 +220,14 @@ resource "datadog_monitor" "node_free_space" { type = "query alert" - query = < ${var.jvm_heap_memory_usage_threshold_critical} -EOF +EOQ thresholds { warning = "${var.jvm_heap_memory_usage_threshold_warning}" @@ -307,11 +307,11 @@ resource "datadog_monitor" "jvm_memory_young_usage" { type = "query alert" - query = < ${var.jvm_memory_young_usage_threshold_critical} -EOF +EOQ thresholds { warning = "${var.jvm_memory_young_usage_threshold_warning}" @@ -349,11 +349,11 @@ resource "datadog_monitor" "jvm_memory_old_usage" { type = "query alert" - query = < ${var.jvm_memory_old_usage_threshold_critical} -EOF +EOQ thresholds { warning = "${var.jvm_memory_old_usage_threshold_warning}" @@ -391,11 +391,11 @@ resource "datadog_monitor" "jvm_gc_old_collection_latency" { type = "query alert" - query = < ${var.jvm_gc_old_collection_latency_threshold_critical} -EOF +EOQ thresholds { warning = "${var.jvm_gc_old_collection_latency_threshold_warning}" @@ -433,11 +433,11 @@ resource "datadog_monitor" "jvm_gc_young_collection_latency" { type = "query alert" - query = < ${var.jvm_gc_young_collection_latency_threshold_critical} -EOF +EOQ thresholds { warning = "${var.jvm_gc_young_collection_latency_threshold_warning}" @@ -476,11 +476,11 @@ resource "datadog_monitor" "indexing_latency" { type = "query alert" // TODO add tags to filter by node type and do not apply this monitor on non-data nodes - query = < ${var.indexing_latency_threshold_critical} -EOF +EOQ thresholds { warning = "${var.indexing_latency_threshold_warning}" @@ -519,11 +519,11 @@ resource "datadog_monitor" "flush_latency" { type = "query alert" // TODO add tags to filter by node type and do not apply this monitor on non-data nodes - query = < ${var.flush_latency_threshold_critical} -EOF +EOQ thresholds { warning = "${var.flush_latency_threshold_warning}" @@ -561,7 +561,7 @@ resource "datadog_monitor" "http_connections_anomaly" { type = "query alert" - query = <= ${var.http_connections_anomaly_threshold_critical} -EOF +EOQ thresholds { warning = "${var.http_connections_anomaly_threshold_warning}" @@ -612,11 +612,11 @@ resource "datadog_monitor" "search_query_latency" { type = "query alert" // TODO add tags to filter by node type and do not apply this monitor on non-data nodes - query = < ${var.search_query_latency_threshold_critical} -EOF +EOQ thresholds { warning = "${var.search_query_latency_threshold_warning}" @@ -655,11 +655,11 @@ resource "datadog_monitor" "fetch_latency" { type = "query alert" // TODO add tags to filter by node type and do not apply this monitor on non-data nodes - query = < ${var.fetch_latency_threshold_critical} -EOF +EOQ thresholds { warning = "${var.fetch_latency_threshold_warning}" @@ -697,11 +697,11 @@ resource "datadog_monitor" "search_query_change" { type = "query alert" - query = <= ${var.search_query_change_threshold_critical} -EOF +EOQ thresholds { warning = "${var.search_query_change_threshold_warning}" @@ -739,11 +739,11 @@ resource "datadog_monitor" "fetch_change" { type = "query alert" - query = <= ${var.fetch_change_threshold_critical} -EOF +EOQ thresholds { warning = "${var.fetch_change_threshold_warning}" @@ -782,11 +782,11 @@ resource "datadog_monitor" "field_data_evictions_change" { type = "query alert" // TODO add tags to filter by node type and do not apply this monitor on non-data nodes - query = < ${var.field_data_evictions_change_threshold_critical} -EOF +EOQ thresholds { warning = "${var.field_data_evictions_change_threshold_warning}" @@ -825,11 +825,11 @@ resource "datadog_monitor" "query_cache_evictions_change" { type = "query alert" // TODO add tags to filter by node type and do not apply this monitor on non-data nodes - query = < ${var.query_cache_evictions_change_threshold_critical} -EOF +EOQ thresholds { warning = "${var.query_cache_evictions_change_threshold_warning}" @@ -868,11 +868,11 @@ resource "datadog_monitor" "request_cache_evictions_change" { type = "query alert" // TODO add tags to filter by node type and do not apply this monitor on non-data nodes - query = < ${var.request_cache_evictions_change_threshold_critical} -EOF +EOQ thresholds { warning = "${var.request_cache_evictions_change_threshold_warning}" @@ -910,11 +910,11 @@ resource "datadog_monitor" "task_time_in_queue_change" { type = "query alert" - query = < ${var.task_time_in_queue_change_threshold_critical} -EOF +EOQ thresholds { warning = "${var.task_time_in_queue_change_threshold_warning}" diff --git a/database/mongodb/monitors-mongo.tf b/database/mongodb/monitors-mongo.tf index 992a042..054bba5 100644 --- a/database/mongodb/monitors-mongo.tf +++ b/database/mongodb/monitors-mongo.tf @@ -3,10 +3,10 @@ resource "datadog_monitor" "mongodb_primary" { name = "[${var.environment}] MongoDB primary state" message = "${coalesce(var.mongodb_primary_message, var.message)}" - query = <= 2 - EOF + EOQ type = "metric alert" @@ -29,12 +29,12 @@ resource "datadog_monitor" "mongodb_secondary" { name = "[${var.environment}] MongoDB secondary missing" message = "${coalesce(var.mongodb_secondary_message, var.message)}" - query = < 1 - EOF + EOQ thresholds { critical = 1 @@ -62,11 +62,11 @@ resource "datadog_monitor" "mongodb_server_count" { name = "[${var.environment}] MongoDB too much servers or wrong monitoring config" message = "${coalesce(var.mongodb_server_count_message, var.message)}" - query = < 99 - EOF + EOQ thresholds { critical = 99 @@ -94,10 +94,10 @@ resource "datadog_monitor" "mongodb_replication" { name = "[${var.environment}] MongoDB replication lag" message = "${coalesce(var.mongodb_replication_message, var.message)}" - query = < ${var.mongodb_lag_critical} - EOF + EOQ thresholds { critical = "${var.mongodb_lag_critical}" diff --git a/database/mysql/monitors-mysql.tf b/database/mysql/monitors-mysql.tf index acbe571..a5c8950 100644 --- a/database/mysql/monitors-mysql.tf +++ b/database/mysql/monitors-mysql.tf @@ -5,9 +5,9 @@ resource "datadog_monitor" "mysql_availability" { type = "service check" - query = < ${var.mysql_connection_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -67,12 +67,12 @@ resource "datadog_monitor" "mysql_aborted" { message = "${coalesce(var.mysql_aborted_message, var.message)}" type = "metric alert" - query = < ${var.mysql_aborted_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -99,12 +99,12 @@ resource "datadog_monitor" "mysql_slow" { message = "${coalesce(var.mysql_slow_message, var.message)}" type = "metric alert" - query = < ${var.mysql_slow_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -131,12 +131,12 @@ resource "datadog_monitor" "mysql_pool_efficiency" { message = "${coalesce(var.mysql_pool_efficiency_message, var.message)}" type = "metric alert" - query = < ${var.mysql_pool_efficiency_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -163,13 +163,13 @@ resource "datadog_monitor" "mysql_pool_utilization" { message = "${coalesce(var.mysql_pool_utilization_message, var.message)}" type = "metric alert" - query = < ${var.mysql_pool_utilization_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -196,7 +196,7 @@ resource "datadog_monitor" "mysql_threads_anomaly" { message = "${coalesce(var.mysql_threads_message, var.message)}" type = "metric alert" - query = <= ${var.mysql_threads_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -236,7 +236,7 @@ resource "datadog_monitor" "mysql_questions_anomaly" { message = "${coalesce(var.mysql_questions_message, var.message)}" type = "metric alert" - query = <= ${var.mysql_questions_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" diff --git a/database/postgresql/monitors-postgresql.tf b/database/postgresql/monitors-postgresql.tf index f18b7a8..ce8907c 100644 --- a/database/postgresql/monitors-postgresql.tf +++ b/database/postgresql/monitors-postgresql.tf @@ -5,9 +5,9 @@ resource "datadog_monitor" "postgresql_availability" { type = "service check" - query = < ${var.postgresql_connection_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" @@ -66,11 +66,11 @@ resource "datadog_monitor" "postgresql_too_many_locks" { message = "${coalesce(var.postgresql_lock_message, var.message)}" type = "metric alert" - query = < ${var.postgresql_lock_threshold_critical} - EOF + EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" diff --git a/database/redis/monitors-redis.tf b/database/redis/monitors-redis.tf index e948467..22079bf 100644 --- a/database/redis/monitors-redis.tf +++ b/database/redis/monitors-redis.tf @@ -8,9 +8,9 @@ resource "datadog_monitor" "not_responding" { type = "service check" - query = < ${var.evictedkeys_change_threshold_critical} -EOL +EOQ type = "metric alert" @@ -71,11 +71,11 @@ resource "datadog_monitor" "expirations" { name = "[${var.environment}] Redis expired keys {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.expirations_rate_message, var.message)}" - query = < ${var.expirations_rate_threshold_critical} -EOL +EOQ type = "metric alert" @@ -104,12 +104,12 @@ resource "datadog_monitor" "blocked_clients" { name = "[${var.environment}] Redis blocked clients {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.blocked_clients_message, var.message)}" - query = < ${var.blocked_clients_threshold_critical} -EOL +EOQ type = "metric alert" @@ -138,11 +138,11 @@ resource "datadog_monitor" "keyspace_full" { name = "[${var.environment}] Redis keyspace seems full (no changes since ${var.keyspace_timeframe})" message = "${coalesce(var.keyspace_message, var.message)}" - query = < ${var.mem_used_threshold_critical} -EOL +EOQ type = "metric alert" @@ -205,11 +205,11 @@ resource "datadog_monitor" "memory_frag" { name = "[${var.environment}] Redis memory fragmented {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.mem_frag_message, var.message)}" - query = < ${var.mem_frag_threshold_critical} -EOL +EOQ type = "metric alert" @@ -238,11 +238,11 @@ resource "datadog_monitor" "rejected_connections" { name = "[${var.environment}] Redis rejected connections {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.rejected_con_message, var.message)}" - query = < ${var.rejected_con_threshold_critical} -EOL +EOQ type = "metric alert" @@ -271,11 +271,11 @@ resource "datadog_monitor" "latency" { name = "[${var.environment}] Redis latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}){{/is_warning}}" message = "${coalesce(var.latency_message, var.message)}" - query = < ${var.latency_threshold_critical} -EOL +EOQ type = "metric alert" @@ -304,13 +304,13 @@ resource "datadog_monitor" "hitrate" { name = "[${var.environment}] Redis hitrate {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.hitrate_message, var.message)}" - query = < ${var.php_fpm_busy_threshold_critical} - EOF + EOQ thresholds { warning = "${var.php_fpm_busy_threshold_warning}" diff --git a/system/generic/monitors-system.tf b/system/generic/monitors-system.tf index ab528f4..62ff489 100644 --- a/system/generic/monitors-system.tf +++ b/system/generic/monitors-system.tf @@ -3,11 +3,11 @@ resource "datadog_monitor" "cpu" { name = "[${var.environment}] CPU usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_message, var.message)}" - query = < ${var.cpu_threshold_critical} - EOF + EOQ type = "metric alert" @@ -35,11 +35,11 @@ resource "datadog_monitor" "load" { name = "[${var.environment}] CPU load 5 ratio {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.load_message, var.message)}" - query = < ${var.load_threshold_critical} - EOF + EOQ type = "metric alert" @@ -67,11 +67,11 @@ resource "datadog_monitor" "disk_space" { name = "[${var.environment}] Disk space usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.disk_space_message, var.message)}" - query = < ${var.disk_space_threshold_critical} - EOF + EOQ type = "metric alert" @@ -99,7 +99,7 @@ resource "datadog_monitor" "disk_space_forecast" { name = "[${var.environment}] Disk Space usage could reach {{#is_alert}}{{threshold}}%{{/is_alert}} in a near future" message = "${coalesce(var.disk_space_forecast_message, var.message)}" - query = <= ${var.disk_space_forecast_threshold_critical} - EOF + EOQ type = "query alert" @@ -139,11 +139,11 @@ resource "datadog_monitor" "disk_inodes" { name = "[${var.environment}] Disk inodes usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.disk_inodes_message, var.message)}" - query = < ${var.disk_inodes_threshold_critical} - EOF + EOQ type = "metric alert" @@ -171,12 +171,12 @@ resource "datadog_monitor" "memory" { name = "[${var.environment}] Usable Memory {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${var.memory_message}" - query = < Date: Tue, 23 Apr 2019 10:13:15 +0200 Subject: [PATCH 2/3] MON-326 harmonize queries EOQ end --- .../elasticsearch/monitors-elasticsearch.tf | 6 +-- .../aurora/mysql/monitors-rds-aurora-mysql.tf | 2 +- .../monitors-rds-aurora-postgresql.tf | 2 +- cloud/aws/rds/common/monitors-rds-common.tf | 6 +-- .../datalakestore/monitors-datalakestore.tf | 2 +- cloud/azure/redis/monitors-azure-redis.tf | 6 +-- .../azure/servicebus/monitors-service-bus.tf | 2 +- cloud/azure/storage/monitors-azure-storage.tf | 18 ++++---- cloud/gcp/big-query/monitors-big-query.tf | 18 ++++---- .../common/monitors-cloud-sql-common.tf | 12 ++--- .../mysql/monitors-cloudsql-mysql.tf | 2 +- .../gcp/gce/instance/monitors-gce-instance.tf | 6 +-- cloud/gcp/lb/monitors-lb.tf | 10 ++--- cloud/gcp/pubsub/monitors-pubsub.tf | 4 +- .../elasticsearch/monitors-elasticsearch.tf | 44 +++++++++---------- database/redis/monitors-redis.tf | 18 ++++---- 16 files changed, 79 insertions(+), 79 deletions(-) diff --git a/cloud/aws/elasticsearch/monitors-elasticsearch.tf b/cloud/aws/elasticsearch/monitors-elasticsearch.tf index d781840..263699c 100644 --- a/cloud/aws/elasticsearch/monitors-elasticsearch.tf +++ b/cloud/aws/elasticsearch/monitors-elasticsearch.tf @@ -15,7 +15,7 @@ resource "datadog_monitor" "es_cluster_status" { avg:aws.es.cluster_statusred${module.filter-tags.query_alert} by {region,name} * 2 + (avg:aws.es.cluster_statusyellow${module.filter-tags.query_alert} by {region,name} + 0.1) ) >= 2 -EOQ + EOQ thresholds { warning = 1 @@ -50,7 +50,7 @@ resource "datadog_monitor" "es_free_space_low" { avg:aws.es.free_storage_space${module.filter-tags.query_alert} by {region,name} / (${var.es_cluster_volume_size}*1000) * 100 ) < ${var.diskspace_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.diskspace_threshold_warning}" @@ -84,7 +84,7 @@ resource "datadog_monitor" "es_cpu_90_15min" { ${var.cpu_time_aggregator}(${var.cpu_timeframe}): ( avg:aws.es.cpuutilization${module.filter-tags.query_alert} by {region,name} ) > ${var.cpu_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.cpu_threshold_warning}" diff --git a/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf b/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf index 56e12a3..087ee64 100644 --- a/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf +++ b/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf @@ -10,7 +10,7 @@ resource "datadog_monitor" "rds_aurora_mysql_replica_lag" { avg(${var.aurora_replicalag_timeframe}): ( avg:aws.rds.aurora_replica_lag${module.filter-tags.query_alert} by {region,name} ) > ${var.aurora_replicalag_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.aurora_replicalag_threshold_warning}" diff --git a/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf b/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf index 2da7253..57248ac 100644 --- a/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf +++ b/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf @@ -10,7 +10,7 @@ resource "datadog_monitor" "rds_aurora_postgresql_replica_lag" { avg(${var.aurora_replicalag_timeframe}): ( avg:aws.rds.rdsto_aurora_postgre_sqlreplica_lag${module.filter-tags.query_alert} by {region,name} ) > ${var.aurora_replicalag_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.aurora_replicalag_threshold_warning}" diff --git a/cloud/aws/rds/common/monitors-rds-common.tf b/cloud/aws/rds/common/monitors-rds-common.tf index d78581b..369b896 100644 --- a/cloud/aws/rds/common/monitors-rds-common.tf +++ b/cloud/aws/rds/common/monitors-rds-common.tf @@ -10,7 +10,7 @@ resource "datadog_monitor" "rds_cpu_90_15min" { ${var.cpu_time_aggregator}(${var.cpu_timeframe}): ( avg:aws.rds.cpuutilization${module.filter-tags.query_alert} by {region,name} ) > ${var.cpu_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.cpu_threshold_warning}" @@ -44,7 +44,7 @@ resource "datadog_monitor" "rds_free_space_low" { avg:aws.rds.free_storage_space${module.filter-tags.query_alert} by {region,name} / avg:aws.rds.total_storage_space${module.filter-tags.query_alert} by {region,name} * 100 ) < ${var.diskspace_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.diskspace_threshold_warning}" @@ -77,7 +77,7 @@ resource "datadog_monitor" "rds_replica_lag" { avg(${var.replicalag_timeframe}): ( avg:aws.rds.replica_lag${module.filter-tags.query_alert} by {region,name} ) > ${var.replicalag_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.replicalag_threshold_warning}" diff --git a/cloud/azure/datalakestore/monitors-datalakestore.tf b/cloud/azure/datalakestore/monitors-datalakestore.tf index 721fb75..82fc3ec 100644 --- a/cloud/azure/datalakestore/monitors-datalakestore.tf +++ b/cloud/azure/datalakestore/monitors-datalakestore.tf @@ -8,7 +8,7 @@ resource "datadog_monitor" "datalakestore_status" { ${var.status_time_aggregator}(${var.status_timeframe}): ( avg:azure.datalakestore_accounts.status${module.filter-tags.query_alert} by {resource_group,region,name} ) < 1 -EOQ + EOQ type = "metric alert" diff --git a/cloud/azure/redis/monitors-azure-redis.tf b/cloud/azure/redis/monitors-azure-redis.tf index 2d60d72..fd3242a 100644 --- a/cloud/azure/redis/monitors-azure-redis.tf +++ b/cloud/azure/redis/monitors-azure-redis.tf @@ -35,7 +35,7 @@ resource "datadog_monitor" "evictedkeys" { ${var.evictedkeys_limit_time_aggregator}(${var.evictedkeys_limit_timeframe}): ( avg:azure.cache_redis.evictedkeys${module.filter-tags.query_alert} by {resource_group,region,name} ) > ${var.evictedkeys_limit_threshold_critical} -EOQ + EOQ type = "metric alert" @@ -68,7 +68,7 @@ resource "datadog_monitor" "percent_processor_time" { ${var.percent_processor_time_time_aggregator}(${var.percent_processor_time_timeframe}): ( avg:azure.cache_redis.percent_processor_time${module.filter-tags.query_alert} by {resource_group,region,name} ) > ${var.percent_processor_time_threshold_critical} -EOQ + EOQ type = "metric alert" @@ -101,7 +101,7 @@ resource "datadog_monitor" "server_load" { ${var.server_load_rate_time_aggregator}(${var.server_load_rate_timeframe}): ( avg:azure.cache_redis.server_load${module.filter-tags.query_alert} by {resource_group,region,name} ) > ${var.server_load_rate_threshold_critical} -EOQ + EOQ type = "metric alert" diff --git a/cloud/azure/servicebus/monitors-service-bus.tf b/cloud/azure/servicebus/monitors-service-bus.tf index c0a004b..f1bb8b4 100644 --- a/cloud/azure/servicebus/monitors-service-bus.tf +++ b/cloud/azure/servicebus/monitors-service-bus.tf @@ -8,7 +8,7 @@ resource "datadog_monitor" "servicebus_status" { ${var.status_time_aggregator}(${var.status_timeframe}): ( avg:azure.servicebus_namespaces.status${module.filter-tags.query_alert} by {resource_group,region,name} ) != 1 -EOQ + EOQ type = "metric alert" diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index 5928a55..7c027f8 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -7,7 +7,7 @@ resource "datadog_monitor" "availability" { ${var.availability_time_aggregator}(${var.availability_timeframe}): (default( avg:azure.storage.availability${module.filter-tags.query_alert} by {resource_group,storage_type,name}, 100)) < ${var.availability_threshold_critical} -EOQ + EOQ thresholds { critical = "${var.availability_threshold_critical}" @@ -39,7 +39,7 @@ resource "datadog_monitor" "successful_requests" { ${var.successful_requests_time_aggregator}(${var.successful_requests_timeframe}): (default( avg:azure.storage.percent_success${module.filter-tags.query_alert} by {resource_group,storage_type,name}, 100)) < ${var.successful_requests_threshold_critical} -EOQ + EOQ thresholds { critical = "${var.successful_requests_threshold_critical}" @@ -71,7 +71,7 @@ resource "datadog_monitor" "latency" { ${var.latency_time_aggregator}(${var.latency_timeframe}): (default( avg:azure.storage.average_e2_e_latency${module.filter-tags.query_alert} by {resource_group,storage_type,name}, 0)) > ${var.latency_threshold_critical} -EOQ + EOQ thresholds { critical = "${var.latency_threshold_critical}" @@ -103,7 +103,7 @@ resource "datadog_monitor" "timeout_error_requests" { ${var.timeout_error_requests_time_aggregator}(${var.timeout_error_requests_timeframe}): (default( avg:azure.storage.percent_timeout_error${module.filter-tags.query_alert} by {resource_group,storage_type,name}, 0)) > ${var.timeout_error_requests_threshold_critical} -EOQ + EOQ thresholds { critical = "${var.timeout_error_requests_threshold_critical}" @@ -135,7 +135,7 @@ resource "datadog_monitor" "network_error_requests" { ${var.network_error_requests_time_aggregator}(${var.network_error_requests_timeframe}): (default( avg:azure.storage.percent_network_error${module.filter-tags.query_alert} by {resource_group,storage_type,name}, 0)) > ${var.network_error_requests_threshold_critical} -EOQ + EOQ thresholds { critical = "${var.network_error_requests_threshold_critical}" @@ -167,7 +167,7 @@ resource "datadog_monitor" "throttling_error_requests" { ${var.throttling_error_requests_time_aggregator}(${var.throttling_error_requests_timeframe}): (default( avg:azure.storage.percent_throttling_error${module.filter-tags.query_alert} by {resource_group,storage_type,name}, 0)) > ${var.throttling_error_requests_threshold_critical} -EOQ + EOQ thresholds { critical = "${var.throttling_error_requests_threshold_critical}" @@ -199,7 +199,7 @@ resource "datadog_monitor" "server_other_error_requests" { ${var.server_other_error_requests_time_aggregator}(${var.server_other_error_requests_timeframe}): (default( avg:azure.storage.percent_server_other_error${module.filter-tags.query_alert} by {resource_group,storage_type,name}, 0)) > ${var.server_other_error_requests_threshold_critical} -EOQ + EOQ thresholds { critical = "${var.server_other_error_requests_threshold_critical}" @@ -231,7 +231,7 @@ resource "datadog_monitor" "client_other_error_requests" { ${var.client_other_error_requests_time_aggregator}(${var.client_other_error_requests_timeframe}): (default( avg:azure.storage.percent_client_other_error${module.filter-tags.query_alert} by {resource_group,storage_type,name}, 0)) > ${var.client_other_error_requests_threshold_critical} -EOQ + EOQ thresholds { critical = "${var.client_other_error_requests_threshold_critical}" @@ -263,7 +263,7 @@ resource "datadog_monitor" "authorization_error_requests" { ${var.authorization_error_requests_time_aggregator}(${var.authorization_error_requests_timeframe}): (default( avg:azure.storage.percent_authorization_error${module.filter-tags.query_alert} by {resource_group,storage_type,name}, 0)) > ${var.authorization_error_requests_threshold_critical} -EOQ + EOQ thresholds { critical = "${var.authorization_error_requests_threshold_critical}" diff --git a/cloud/gcp/big-query/monitors-big-query.tf b/cloud/gcp/big-query/monitors-big-query.tf index 1352b95..3768c14 100644 --- a/cloud/gcp/big-query/monitors-big-query.tf +++ b/cloud/gcp/big-query/monitors-big-query.tf @@ -11,7 +11,7 @@ resource "datadog_monitor" "concurrent_queries" { query = < ${var.concurrent_queries_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.concurrent_queries_threshold_warning}" @@ -47,7 +47,7 @@ resource "datadog_monitor" "execution_time" { query = < ${var.execution_time_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.execution_time_threshold_warning}" @@ -83,7 +83,7 @@ resource "datadog_monitor" "scanned_bytes" { query = < ${var.scanned_bytes_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.scanned_bytes_threshold_warning}" @@ -119,7 +119,7 @@ resource "datadog_monitor" "scanned_bytes_billed" { query = < ${var.scanned_bytes_billed_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.scanned_bytes_billed_threshold_warning}" @@ -155,7 +155,7 @@ resource "datadog_monitor" "available_slots" { query = < ${var.stored_bytes_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.stored_bytes_threshold_warning}" @@ -227,7 +227,7 @@ resource "datadog_monitor" "table_count" { query = < ${var.table_count_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.table_count_threshold_warning}" @@ -263,7 +263,7 @@ resource "datadog_monitor" "uploaded_bytes" { query = < ${var.uploaded_bytes_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.uploaded_bytes_threshold_warning}" @@ -299,7 +299,7 @@ resource "datadog_monitor" "uploaded_bytes_billed" { query = < ${var.uploaded_bytes_billed_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.uploaded_bytes_billed_threshold_warning}" 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 74ebd20..6069ab7 100644 --- a/cloud/gcp/cloud-sql/common/monitors-cloud-sql-common.tf +++ b/cloud/gcp/cloud-sql/common/monitors-cloud-sql-common.tf @@ -13,7 +13,7 @@ resource "datadog_monitor" "cpu_utilization" { avg:gcp.cloudsql.database.cpu.utilization{${var.filter_tags}} by {database_id} * 100 > ${var.cpu_utilization_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.cpu_utilization_threshold_warning}" @@ -51,7 +51,7 @@ resource "datadog_monitor" "disk_utilization" { avg:gcp.cloudsql.database.disk.utilization{${var.filter_tags}} by {database_id} * 100 > ${var.disk_utilization_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.disk_utilization_threshold_warning}" @@ -95,7 +95,7 @@ resource "datadog_monitor" "disk_utilization_forecast" { ${var.disk_utilization_forecast_algorithm == "seasonal" ? format("seasonality='%s'", var.disk_utilization_forecast_seasonal_seasonality): ""} ) >= ${var.disk_utilization_forecast_threshold_critical} -EOQ + EOQ thresholds { critical = "${var.disk_utilization_forecast_threshold_critical}" @@ -133,7 +133,7 @@ resource "datadog_monitor" "memory_utilization" { avg:gcp.cloudsql.database.memory.utilization{${var.filter_tags}} by {database_id} * 100 > ${var.memory_utilization_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.memory_utilization_threshold_warning}" @@ -177,7 +177,7 @@ resource "datadog_monitor" "memory_utilization_forecast" { ${var.memory_utilization_forecast_algorithm == "seasonal" ? format("seasonality='%s'", var.memory_utilization_forecast_seasonal_seasonality): ""} ) >= ${var.memory_utilization_forecast_threshold_critical} -EOQ + EOQ thresholds { critical = "${var.memory_utilization_forecast_threshold_critical}" @@ -215,7 +215,7 @@ resource "datadog_monitor" "failover_unavailable" { avg:gcp.cloudsql.database.available_for_failover{${var.filter_tags}} by {database_id} <= ${var.failover_unavailable_threshold_critical} -EOQ + EOQ thresholds { critical = "${var.failover_unavailable_threshold_critical}" diff --git a/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf b/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf index 9717cf3..938a6c5 100644 --- a/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf +++ b/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf @@ -13,7 +13,7 @@ resource "datadog_monitor" "replication_lag" { avg:gcp.cloudsql.database.mysql.replication.seconds_behind_master{${var.filter_tags}} by {database_id} > ${var.replication_lag_threshold_critical} -EOQ + EOQ thresholds { critical = "${var.replication_lag_threshold_critical}" diff --git a/cloud/gcp/gce/instance/monitors-gce-instance.tf b/cloud/gcp/gce/instance/monitors-gce-instance.tf index 4419819..b3d1033 100644 --- a/cloud/gcp/gce/instance/monitors-gce-instance.tf +++ b/cloud/gcp/gce/instance/monitors-gce-instance.tf @@ -12,7 +12,7 @@ resource "datadog_monitor" "cpu_utilization" { ${var.cpu_utilization_time_aggregator}(${var.cpu_utilization_timeframe}): avg:gcp.gce.instance.cpu.utilization{${var.filter_tags}} by {instance_name} * 100 > ${var.cpu_utilization_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.cpu_utilization_threshold_warning}" @@ -55,7 +55,7 @@ resource "datadog_monitor" "disk_throttled_bps" { sum:gcp.gce.instance.disk.write_bytes_count{${var.filter_tags}} by {instance_name, device_name} ) * 100 > ${var.disk_throttled_bps_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.disk_throttled_bps_threshold_warning}" @@ -98,7 +98,7 @@ resource "datadog_monitor" "disk_throttled_ops" { sum:gcp.gce.instance.disk.write_ops_count{${var.filter_tags}} by {instance_name, device_name} ) * 100 > ${var.disk_throttled_ops_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.disk_throttled_ops_threshold_warning}" diff --git a/cloud/gcp/lb/monitors-lb.tf b/cloud/gcp/lb/monitors-lb.tf index 835449c..bbef18e 100644 --- a/cloud/gcp/lb/monitors-lb.tf +++ b/cloud/gcp/lb/monitors-lb.tf @@ -13,7 +13,7 @@ resource "datadog_monitor" "error_rate_4xx" { default(sum:gcp.loadbalancing.https.request_count{${var.filter_tags},response_code_class:400} by {forwarding_rule_name}.as_rate(), 0) / ( default(sum:gcp.loadbalancing.https.request_count{${var.filter_tags}} by {forwarding_rule_name}.as_rate() + ${var.error_rate_4xx_artificial_request}, 1)) * 100 > ${var.error_rate_4xx_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.error_rate_4xx_threshold_warning}" @@ -51,7 +51,7 @@ resource "datadog_monitor" "error_rate_5xx" { default(sum:gcp.loadbalancing.https.request_count{${var.filter_tags},response_code_class:500} by {forwarding_rule_name}.as_rate(), 0) / ( default(sum:gcp.loadbalancing.https.request_count{${var.filter_tags}} by {forwarding_rule_name}.as_rate() + ${var.error_rate_5xx_artificial_request}, 1)) * 100 > ${var.error_rate_5xx_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.error_rate_5xx_threshold_warning}" @@ -88,7 +88,7 @@ resource "datadog_monitor" "backend_latency_service" { ${var.backend_latency_service_time_aggregator}(${var.backend_latency_service_timeframe}): default(min:gcp.loadbalancing.https.backend_latencies.avg{${var.filter_tags},backend_target_type:backend_service} by {backend_target_name,forwarding_rule_name}, 0) > ${var.backend_latency_service_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.backend_latency_service_threshold_warning}" @@ -125,7 +125,7 @@ resource "datadog_monitor" "backend_latency_bucket" { ${var.backend_latency_bucket_time_aggregator}(${var.backend_latency_bucket_timeframe}): default(min:gcp.loadbalancing.https.backend_latencies.avg{${var.filter_tags},backend_target_type:backend_bucket} by {backend_target_name,forwarding_rule_name}, 0) > ${var.backend_latency_bucket_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.backend_latency_bucket_threshold_warning}" @@ -162,7 +162,7 @@ resource "datadog_monitor" "request_count" { pct_change(${var.request_count_time_aggregator}(${var.request_count_timeframe}),${var.request_count_timeshift}): default(sum:gcp.loadbalancing.https.request_count{${var.filter_tags}} by {forwarding_rule_name}.as_count(), 0) > ${var.request_count_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.request_count_threshold_warning}" diff --git a/cloud/gcp/pubsub/monitors-pubsub.tf b/cloud/gcp/pubsub/monitors-pubsub.tf index 2f71227..faa4b01 100644 --- a/cloud/gcp/pubsub/monitors-pubsub.tf +++ b/cloud/gcp/pubsub/monitors-pubsub.tf @@ -12,7 +12,7 @@ resource "datadog_monitor" "sending_operations_count" { ${var.sending_operations_count_time_aggregator}(${var.sending_operations_count_timeframe}): default(avg:gcp.pubsub.topic.send_message_operation_count{${var.filter_tags}} by {topic_id}.as_count(), 0) <= ${var.sending_operations_count_threshold_critical} -EOQ + EOQ thresholds { critical = "${var.sending_operations_count_threshold_critical}" @@ -48,7 +48,7 @@ resource "datadog_monitor" "unavailable_sending_operations_count" { ${var.unavailable_sending_operations_count_time_aggregator}(${var.unavailable_sending_operations_count_timeframe}): default(avg:gcp.pubsub.topic.send_message_operation_count{${var.filter_tags},response_code:unavailable} by {topic_id}.as_count(), 0) >= ${var.unavailable_sending_operations_count_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.unavailable_sending_operations_count_threshold_warning}" diff --git a/database/elasticsearch/monitors-elasticsearch.tf b/database/elasticsearch/monitors-elasticsearch.tf index 109dda6..3607114 100644 --- a/database/elasticsearch/monitors-elasticsearch.tf +++ b/database/elasticsearch/monitors-elasticsearch.tf @@ -8,7 +8,7 @@ resource "datadog_monitor" "not_responding" { query = < ${var.cluster_initializing_shards_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.cluster_initializing_shards_threshold_warning}" @@ -140,7 +140,7 @@ resource "datadog_monitor" "cluster_relocating_shards" { ${var.cluster_relocating_shards_time_aggregator}(${var.cluster_relocating_shards_timeframe}): avg:elasticsearch.relocating_shards${module.filter-tags.query_alert} by {cluster_name} > ${var.cluster_relocating_shards_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.cluster_relocating_shards_threshold_warning}" @@ -182,7 +182,7 @@ resource "datadog_monitor" "cluster_unassigned_shards" { ${var.cluster_unassigned_shards_time_aggregator}(${var.cluster_unassigned_shards_timeframe}): avg:elasticsearch.unassigned_shards${module.filter-tags.query_alert} by {cluster_name} > ${var.cluster_unassigned_shards_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.cluster_unassigned_shards_threshold_warning}" @@ -227,7 +227,7 @@ resource "datadog_monitor" "node_free_space" { min:elasticsearch.fs.total.total_in_bytes${module.filter-tags.query_alert} by {node_name} ) * 100 < ${var.node_free_space_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.node_free_space_threshold_warning}" @@ -269,7 +269,7 @@ resource "datadog_monitor" "jvm_heap_memory_usage" { ${var.jvm_heap_memory_usage_time_aggregator}(${var.jvm_heap_memory_usage_timeframe}): avg:jvm.mem.heap_in_use${module.filter-tags.query_alert} by {node_name} > ${var.jvm_heap_memory_usage_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.jvm_heap_memory_usage_threshold_warning}" @@ -311,7 +311,7 @@ resource "datadog_monitor" "jvm_memory_young_usage" { ${var.jvm_memory_young_usage_time_aggregator}(${var.jvm_memory_young_usage_timeframe}): avg:jvm.mem.pools.young.used${module.filter-tags.query_alert} by {node_name} / avg:jvm.mem.pools.young.max${module.filter-tags.query_alert} by {node_name} * 100 > ${var.jvm_memory_young_usage_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.jvm_memory_young_usage_threshold_warning}" @@ -353,7 +353,7 @@ resource "datadog_monitor" "jvm_memory_old_usage" { ${var.jvm_memory_old_usage_time_aggregator}(${var.jvm_memory_old_usage_timeframe}): avg:jvm.mem.pools.old.used${module.filter-tags.query_alert} by {node_name} / avg:jvm.mem.pools.old.max${module.filter-tags.query_alert} by {node_name} * 100 > ${var.jvm_memory_old_usage_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.jvm_memory_old_usage_threshold_warning}" @@ -395,7 +395,7 @@ resource "datadog_monitor" "jvm_gc_old_collection_latency" { ${var.jvm_gc_old_collection_latency_time_aggregator}(${var.jvm_gc_old_collection_latency_timeframe}): avg:jvm.gc.collectors.old.collection_time${module.filter-tags.query_alert} by {node_name} / avg:jvm.gc.collectors.old.count${module.filter-tags.query_alert} by {node_name} * 1000 > ${var.jvm_gc_old_collection_latency_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.jvm_gc_old_collection_latency_threshold_warning}" @@ -437,7 +437,7 @@ resource "datadog_monitor" "jvm_gc_young_collection_latency" { ${var.jvm_gc_young_collection_latency_time_aggregator}(${var.jvm_gc_young_collection_latency_timeframe}): avg:jvm.gc.collectors.young.collection_time${module.filter-tags.query_alert} by {node_name} / avg:jvm.gc.collectors.young.count${module.filter-tags.query_alert} by {node_name} * 1000 > ${var.jvm_gc_young_collection_latency_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.jvm_gc_young_collection_latency_threshold_warning}" @@ -480,7 +480,7 @@ resource "datadog_monitor" "indexing_latency" { ${var.indexing_latency_time_aggregator}(${var.indexing_latency_timeframe}): avg:elasticsearch.indexing.index.time${module.filter-tags.query_alert} by {node_name}/ avg:elasticsearch.indexing.index.total${module.filter-tags.query_alert} by {node_name} * 1000 > ${var.indexing_latency_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.indexing_latency_threshold_warning}" @@ -523,7 +523,7 @@ resource "datadog_monitor" "flush_latency" { ${var.flush_latency_time_aggregator}(${var.flush_latency_timeframe}): avg:elasticsearch.flush.total.time${module.filter-tags.query_alert} by {node_name} / avg:elasticsearch.flush.total${module.filter-tags.query_alert} by {node_name} * 1000 > ${var.flush_latency_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.flush_latency_threshold_warning}" @@ -573,7 +573,7 @@ resource "datadog_monitor" "http_connections_anomaly" { seasonality='${var.http_connections_anomaly_seasonality}' ) >= ${var.http_connections_anomaly_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.http_connections_anomaly_threshold_warning}" @@ -616,7 +616,7 @@ resource "datadog_monitor" "search_query_latency" { ${var.search_query_latency_time_aggregator}(${var.search_query_latency_timeframe}): avg:elasticsearch.search.query.time${module.filter-tags.query_alert} by {node_name} / avg:elasticsearch.search.query.total${module.filter-tags.query_alert} by {node_name} * 1000 > ${var.search_query_latency_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.search_query_latency_threshold_warning}" @@ -659,7 +659,7 @@ resource "datadog_monitor" "fetch_latency" { ${var.fetch_latency_time_aggregator}(${var.fetch_latency_timeframe}): avg:elasticsearch.search.fetch.time${module.filter-tags.query_alert} by {node_name} / avg:elasticsearch.search.fetch.total${module.filter-tags.query_alert} by {node_name} * 1000 > ${var.fetch_latency_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.fetch_latency_threshold_warning}" @@ -701,7 +701,7 @@ resource "datadog_monitor" "search_query_change" { pct_change(${var.search_query_change_time_aggregator}(${var.search_query_change_timeframe}),${var.search_query_change_timeshift}): avg:elasticsearch.search.query.current${module.filter-tags.query_alert} by {cluster_name} >= ${var.search_query_change_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.search_query_change_threshold_warning}" @@ -743,7 +743,7 @@ resource "datadog_monitor" "fetch_change" { pct_change(${var.fetch_change_time_aggregator}(${var.fetch_change_timeframe}),${var.fetch_change_timeshift}): avg:elasticsearch.search.fetch.current${module.filter-tags.query_alert} by {cluster_name} >= ${var.fetch_change_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.fetch_change_threshold_warning}" @@ -786,7 +786,7 @@ resource "datadog_monitor" "field_data_evictions_change" { change(${var.field_data_evictions_change_time_aggregator}(${var.field_data_evictions_change_timeframe}),${var.field_data_evictions_change_timeshift}): avg:elasticsearch.fielddata.evictions${module.filter-tags.query_alert} by {node_name} > ${var.field_data_evictions_change_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.field_data_evictions_change_threshold_warning}" @@ -829,7 +829,7 @@ resource "datadog_monitor" "query_cache_evictions_change" { change(${var.query_cache_evictions_change_time_aggregator}(${var.query_cache_evictions_change_timeframe}),${var.query_cache_evictions_change_timeshift}): avg:elasticsearch.indices.query_cache.evictions${module.filter-tags.query_alert} by {node_name} > ${var.query_cache_evictions_change_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.query_cache_evictions_change_threshold_warning}" @@ -872,7 +872,7 @@ resource "datadog_monitor" "request_cache_evictions_change" { change(${var.request_cache_evictions_change_time_aggregator}(${var.request_cache_evictions_change_timeframe}),${var.request_cache_evictions_change_timeshift}): avg:elasticsearch.indices.request_cache.evictions${module.filter-tags.query_alert} by {node_name} > ${var.request_cache_evictions_change_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.request_cache_evictions_change_threshold_warning}" @@ -914,7 +914,7 @@ resource "datadog_monitor" "task_time_in_queue_change" { change(${var.task_time_in_queue_change_time_aggregator}(${var.task_time_in_queue_change_timeframe}),${var.task_time_in_queue_change_timeshift}): avg:elasticsearch.pending_tasks_time_in_queue${module.filter-tags.query_alert} by {cluster_name} > ${var.task_time_in_queue_change_threshold_critical} -EOQ + EOQ thresholds { warning = "${var.task_time_in_queue_change_threshold_warning}" diff --git a/database/redis/monitors-redis.tf b/database/redis/monitors-redis.tf index 22079bf..6fe3856 100644 --- a/database/redis/monitors-redis.tf +++ b/database/redis/monitors-redis.tf @@ -42,7 +42,7 @@ resource "datadog_monitor" "evicted_keys" { change(${var.evictedkeys_change_time_aggregator}(${var.evictedkeys_change_timeframe}),${var.evictedkeys_change_timeframe}): ( avg:redis.keys.evicted${module.filter-tags.query_alert} by {redis_host,redis_port} ) > ${var.evictedkeys_change_threshold_critical} -EOQ + EOQ type = "metric alert" @@ -75,7 +75,7 @@ resource "datadog_monitor" "expirations" { ${var.expirations_rate_time_aggregator}(${var.expirations_rate_timeframe}): ( avg:redis.expires.percent${module.filter-tags.query_alert} by {redis_host,redis_port} ) > ${var.expirations_rate_threshold_critical} -EOQ + EOQ type = "metric alert" @@ -109,7 +109,7 @@ resource "datadog_monitor" "blocked_clients" { sum:redis.clients.blocked${module.filter-tags.query_alert} by {redis_host,redis_port} / sum:redis.net.clients${module.filter-tags.query_alert} by {redis_host,redis_port} ) * 100 > ${var.blocked_clients_threshold_critical} -EOQ + EOQ type = "metric alert" @@ -142,7 +142,7 @@ resource "datadog_monitor" "keyspace_full" { ${var.keyspace_time_aggregator}(${var.keyspace_timeframe}): ( abs(diff(avg:redis.keys${module.filter-tags.query_alert} by {redis_host,redis_port})) ) == ${var.keyspace_threshold_critical} -EOQ + EOQ type = "metric alert" @@ -176,7 +176,7 @@ resource "datadog_monitor" "memory_used" { avg:redis.mem.used${module.filter-tags.query_alert} by {redis_host,redis_port} / max:redis.mem.maxmemory${module.filter-tags.query_alert} by {redis_host,redis_port} ) * 100 > ${var.mem_used_threshold_critical} -EOQ + EOQ type = "metric alert" @@ -209,7 +209,7 @@ resource "datadog_monitor" "memory_frag" { ${var.mem_frag_time_aggregator}(${var.mem_frag_timeframe}): avg:redis.mem.fragmentation_ratio${module.filter-tags.query_alert} by {redis_host,redis_port} * 100 > ${var.mem_frag_threshold_critical} -EOQ + EOQ type = "metric alert" @@ -242,7 +242,7 @@ resource "datadog_monitor" "rejected_connections" { change(${var.rejected_con_time_aggregator}(${var.rejected_con_timeframe}),${var.rejected_con_timeframe}): ( avg:redis.net.rejected${module.filter-tags.query_alert} by {redis_host,redis_port} ) > ${var.rejected_con_threshold_critical} -EOQ + EOQ type = "metric alert" @@ -275,7 +275,7 @@ resource "datadog_monitor" "latency" { change(${var.latency_time_aggregator}(${var.latency_timeframe}),${var.latency_timeframe}): ( avg:redis.info.latency_ms${module.filter-tags.query_alert} by {redis_host,redis_port} ) > ${var.latency_threshold_critical} -EOQ + EOQ type = "metric alert" @@ -310,7 +310,7 @@ resource "datadog_monitor" "hitrate" { / (sum:redis.stats.keyspace_hits${module.filter-tags.query_alert} by {redis_host,redis_port} + sum:redis.stats.keyspace_misses${module.filter-tags.query_alert} by {redis_host,redis_port}) ) * 100 < ${var.hitrate_threshold_critical} -EOQ + EOQ type = "metric alert" From ef7de8f6c6845269f93ae44c17d921d0b42e1d2e Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Tue, 23 Apr 2019 10:43:05 +0200 Subject: [PATCH 3/3] MON-326 always use EOF syntax --- middleware/nginx/monitors-nginx.tf | 6 +++++- system/unreachable/monitors-unreachable.tf | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/middleware/nginx/monitors-nginx.tf b/middleware/nginx/monitors-nginx.tf index a12bff7..ee67d0e 100644 --- a/middleware/nginx/monitors-nginx.tf +++ b/middleware/nginx/monitors-nginx.tf @@ -36,7 +36,11 @@ resource "datadog_monitor" "datadog_nginx_dropped_connections" { type = "metric alert" - query = "${var.nginx_dropped_time_aggregator}(${var.nginx_dropped_timeframe}):avg:nginx.net.conn_dropped_per_s${module.filter-tags.query_alert} by {host} > ${var.nginx_dropped_threshold_critical}" + query = < ${var.nginx_dropped_threshold_critical} + EOQ thresholds { critical = "${var.nginx_dropped_threshold_critical}" diff --git a/system/unreachable/monitors-unreachable.tf b/system/unreachable/monitors-unreachable.tf index 8621c00..25c3480 100644 --- a/system/unreachable/monitors-unreachable.tf +++ b/system/unreachable/monitors-unreachable.tf @@ -3,7 +3,9 @@ resource "datadog_monitor" "host_unreachable" { name = "[${var.environment}] Host unreachable" message = "${coalesce(var.unreachable_message, var.message)}" - query = "\"datadog.agent.up\"${module.filter-tags.service_check}.last(6).count_by_status()" + query = <