resource "datadog_monitor" "datadog_cpu_too_high" { name = "[${var.environment}] CPU usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_high_message, var.message)}" query = < ${var.cpu_high_threshold_critical} EOF type = "metric alert" thresholds { warning = "${var.cpu_high_threshold_warning}" critical = "${var.cpu_high_threshold_critical}" } notify_no_data = true evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = true silenced = "${var.cpu_high_silenced}" tags = ["env:${var.environment}", "type:system", "provider:system-check", "resource:generic", "team:claranet", "created-by:terraform", "${var.cpu_high_extra_tags}"] } resource "datadog_monitor" "datadog_load_too_high" { name = "[${var.environment}] CPU load 5 {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_load_message, var.message)}" query = < ${var.cpu_load_threshold_critical} EOF type = "metric alert" thresholds { warning = "${var.cpu_load_threshold_warning}" critical = "${var.cpu_load_threshold_critical}" } notify_no_data = true evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = true silenced = "${var.cpu_load_silenced}" tags = ["env:${var.environment}", "type:system", "provider:system-core", "resource:generic", "team:claranet", "created-by:terraform", "${var.cpu_load_extra_tags}"] } resource "datadog_monitor" "datadog_free_disk_space_too_low" { name = "[${var.environment}] Free disk space {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.free_disk_space_message, var.message)}" query = <= ${var.free_disk_space_forecast_threshold_critical} EOF type = "query alert" thresholds { critical_recovery = "${var.free_disk_space_forecast_threshold_critical_recovery}" critical = "${var.free_disk_space_forecast_threshold_critical}" } tags = ["env:${var.environment}", "type:system", "resource:disk"] notify_audit = false locked = false timeout_h = 0 include_tags = true require_full_window = true notify_no_data = false renotify_interval = 0 evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" silenced = "${var.free_disk_space_forecast_silenced}" } resource "datadog_monitor" "datadog_free_disk_space_inodes_too_low" { name = "[${var.environment}] Free disk inodes {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.free_disk_inodes_message, var.message)}" query = <