diff --git a/aws/elasticsearch/variables.tf b/aws/elasticsearch/variables.tf index d251705..66172c2 100644 --- a/aws/elasticsearch/variables.tf +++ b/aws/elasticsearch/variables.tf @@ -89,13 +89,13 @@ variable "cpu_utilization_evaluation_window" { } variable "cpu_utilization_threshold_critical" { - default = 0.90 + default = 90 description = "Critical threshold (percent)" type = number } variable "cpu_utilization_threshold_warning" { - default = 0.80 + default = 80 description = "Warning threshold (percent)" type = number } diff --git a/aws/rds/variables.tf b/aws/rds/variables.tf index 64f2191..2f085d9 100644 --- a/aws/rds/variables.tf +++ b/aws/rds/variables.tf @@ -23,7 +23,7 @@ variable "connection_count_anomaly_enabled" { } variable "connection_count_anomaly_evaluation_window" { - default = "last_1h" + default = "last_4h" description = "Evaluation window for monitor (`last_?m` (1, 5, 10, 15, or 30), `last_?h` (1, 2, or 4), or `last_1d`]" type = string } diff --git a/host/agent/main.tf b/host/agent/main.tf index 7377cdb..dc54b4d 100644 --- a/host/agent/main.tf +++ b/host/agent/main.tf @@ -4,32 +4,34 @@ locals { monitor_warn_default_priority = null monitor_nodata_default_priority = null - title_prefix = "${var.title_prefix == null ? "" : "[${var.title_prefix}]"}[${var.env}] " + title_prefix = var.title_prefix == null ? "" : "[${var.title_prefix}]" title_suffix = var.title_suffix == null ? "" : " (${var.title_suffix})" } resource "datadog_monitor" "host_unreachable" { count = var.host_unreachable_enabled ? 1 : 0 - name = join("", [local.title_prefix, "Host Unreachable - {{host.name}}", local.title_suffix]) - message = local.query_alert_base_message + name = join("", [local.title_prefix, "Datadog Agent Status - {{name.name}}", local.title_suffix]) + include_tags = false + message = var.host_unreachable_use_message ? local.query_alert_base_message : "" tags = concat(local.common_tags, var.base_tags, var.additional_tags) type = "service check" evaluation_delay = var.evaluation_delay new_group_delay = var.new_group_delay - notify_no_data = var.notify_no_data + no_data_timeframe = "5" + notify_no_data = true renotify_interval = var.renotify_interval require_full_window = true timeout_h = var.timeout_h query = < ${var.cpu_utilization_threshold_critical} EOQ diff --git a/host/cpu/variables.tf b/host/cpu/variables.tf index 049e904..69e1f30 100644 --- a/host/cpu/variables.tf +++ b/host/cpu/variables.tf @@ -51,3 +51,9 @@ variable "cpu_utilization_threshold_warning" { description = "Warning threshold (percent)" type = number } + +variable "cpu_utilization_use_message" { + default = false + description = "Flag to enable CPU Utilitzation alerting" + type = bool +} \ No newline at end of file diff --git a/host/disk/main.tf b/host/disk/main.tf index ca4ce0f..e6e4c4c 100644 --- a/host/disk/main.tf +++ b/host/disk/main.tf @@ -4,15 +4,15 @@ locals { monitor_warn_default_priority = null monitor_nodata_default_priority = null - title_prefix = "${var.title_prefix == null ? "" : "[${var.title_prefix}]"}[${var.env}] " + title_prefix = var.title_prefix == null ? "" : "[${var.title_prefix}]" title_suffix = var.title_suffix == null ? "" : " (${var.title_suffix})" } resource "datadog_monitor" "disk_space" { count = var.disk_space_enabled ? 1 : 0 - name = join("", [local.title_prefix, "Disk Space - {{host.name}}", local.title_suffix]) - message = local.query_alert_base_message + name = join("", [local.title_prefix, "Disk Space - {{name.name}}", local.title_suffix]) + message = var.disk_space_use_message ? local.query_alert_base_message : "" tags = concat(local.common_tags, var.base_tags, var.additional_tags) type = "query alert" @@ -26,7 +26,7 @@ resource "datadog_monitor" "disk_space" { query = < ${var.disk_space_threshold_critical} EOQ @@ -39,8 +39,9 @@ resource "datadog_monitor" "disk_space" { resource "datadog_monitor" "disk_space_forecast" { count = var.disk_space_forecast_enabled ? 1 : 0 - name = join("", [local.title_prefix, "Disk Space Forecast - {{host.name}}", local.title_suffix]) - message = local.query_alert_base_message + name = join("", [local.title_prefix, "Disk Space Forecast - {{name.name}}", local.title_suffix]) + include_tags = false + message = var.disk_space_forecast_use_message ? local.query_alert_base_message : "" tags = concat(local.common_tags, var.base_tags, var.additional_tags) type = "query alert" @@ -48,14 +49,13 @@ resource "datadog_monitor" "disk_space_forecast" { new_group_delay = var.new_group_delay notify_audit = false timeout_h = var.timeout_h - include_tags = true require_full_window = true notify_no_data = false renotify_interval = 0 query = < ${var.disk_inodes_threshold_critical} EOQ @@ -90,7 +91,6 @@ resource "datadog_monitor" "disk_inodes" { notify_no_data = false notify_audit = false timeout_h = var.timeout_h - include_tags = true require_full_window = true monitor_thresholds { diff --git a/host/disk/variables.tf b/host/disk/variables.tf index b9c36fa..7b6e21a 100644 --- a/host/disk/variables.tf +++ b/host/disk/variables.tf @@ -46,6 +46,12 @@ variable "disk_space_threshold_critical" { default = 90 } +variable "disk_space_use_message" { + description = "Flag to enable Free diskspace alerting" + type = string + default = "true" +} + ######################################## # Disk Space Forecast ######################################## @@ -115,6 +121,12 @@ variable "disk_space_forecast_threshold_critical" { default = 80 } +variable "disk_space_forecast_use_message" { + description = "Flag to enable Free diskspace forecast alerting" + type = string + default = "false" +} + ######################################## # Disk Inodes ######################################## @@ -147,3 +159,9 @@ variable "disk_inodes_threshold_critical" { type = number default = 95 } + +variable "disk_inodes_use_message" { + description = "Flag to enable Free disk inodes alerting" + type = string + default = "true" +} \ No newline at end of file diff --git a/host/memory/main.tf b/host/memory/main.tf index 129bd45..d5e1ac5 100644 --- a/host/memory/main.tf +++ b/host/memory/main.tf @@ -4,22 +4,23 @@ locals { monitor_warn_default_priority = null monitor_nodata_default_priority = null - title_prefix = "${var.title_prefix == null ? "" : "[${var.title_prefix}]"}[${var.env}] " + title_prefix = var.title_prefix == null ? "" : "[${var.title_prefix}]" title_suffix = var.title_suffix == null ? "" : " (${var.title_suffix})" } resource "datadog_monitor" "memory" { count = var.memory_enabled ? 1 : 0 - name = join("", [local.title_prefix, "Usable Memory - {{host.name}}", local.title_suffix]) - message = local.query_alert_base_message + name = join("", [local.title_prefix, "Usable Memory - {{name.name}}", local.title_suffix]) + include_tags = false + message = var.memory_use_message ? local.query_alert_base_message : "" tags = concat(local.common_tags, var.base_tags, var.additional_tags) type = "query alert" query = <