From ae6a68a590b59401ee5f01eee834148f39dd0ee4 Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 16 Apr 2025 15:47:09 -0400 Subject: [PATCH 1/2] add default elasticache monitors --- aws/elasticache/variables.tf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/aws/elasticache/variables.tf b/aws/elasticache/variables.tf index f4e163d..33ce2eb 100644 --- a/aws/elasticache/variables.tf +++ b/aws/elasticache/variables.tf @@ -17,7 +17,7 @@ variable "base_tags" { # Node CPU Utilization ######################################## variable "cpu_utilization_enabled" { - default = false + default = true description = "Enable CPU utilization monitor" type = bool } @@ -29,7 +29,7 @@ variable "cpu_utilization_no_data_window" { } variable "cpu_utilization_evaluation_window" { - default = "last_5m" + default = "last_15m" description = "Evaluation window for monitor (`last_?m` (1, 5, 10, 15, or 30), `last_?h` (1, 2, or 4), or `last_1d`]" type = string } @@ -49,7 +49,7 @@ variable "cpu_utilization_threshold_warning" { variable "cpu_utilization_use_message" { description = "Whether to use the query alert base message for CPU utilization monitor" type = bool - default = false + default = true } ######################################## @@ -326,7 +326,7 @@ variable "swap_usage_use_message" { # Memory Utilization ######################################## variable "memory_utilization_enabled" { - default = false + default = true description = "Enable memory utilization monitor" type = bool } @@ -358,5 +358,5 @@ variable "memory_utilization_threshold_warning" { variable "memory_utilization_use_message" { description = "Whether to use the query alert base message for memory utilization monitor" type = bool - default = false + default = true } From 492ec5cb69d41627f7b0b31b4bbbeec45212f405 Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 16 Apr 2025 16:29:03 -0400 Subject: [PATCH 2/2] Change elasticache monitor to use name --- aws/elasticache/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/elasticache/main.tf b/aws/elasticache/main.tf index b214f3d..5eabbde 100644 --- a/aws/elasticache/main.tf +++ b/aws/elasticache/main.tf @@ -216,7 +216,7 @@ END resource "datadog_monitor" "memory_utilization" { count = var.memory_utilization_enabled ? 1 : 0 - name = join("", [local.title_prefix, "Elasticache Memory Utilization - {{replication_group.name}} - {{value}}%", local.title_suffix]) + name = join("", [local.title_prefix, "Elasticache Memory Utilization - {{name.name}} - {{value}}%", local.title_suffix]) include_tags = false message = var.memory_utilization_use_message ? local.query_alert_base_message : "" tags = concat(local.common_tags, var.base_tags, var.additional_tags) @@ -232,7 +232,7 @@ resource "datadog_monitor" "memory_utilization" { query = <= ${var.memory_utilization_threshold_critical} END