resource "datadog_monitor" "status" { count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis {{name}} is down" message = "${coalesce(var.status_message, var.message)}" query = < ${var.evictedkeys_limit_threshold_critical} EOF type = "metric alert" thresholds { warning = "${var.evictedkeys_limit_threshold_warning}" critical = "${var.evictedkeys_limit_threshold_critical}" } silenced = "${var.evictedkeys_limit_silenced}" notify_no_data = false evaluation_delay = "${var.evaluation_delay}" renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false new_host_delay = "${var.new_host_delay}" tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:redis", "team:claranet", "created-by:terraform", "${var.evictedkeys_limit_extra_tags}"] } resource "datadog_monitor" "percent_processor_time" { count = "${var.percent_processor_time_enabled == "true" ? 1 : 0}" 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 type = "metric alert" thresholds { warning = "${var.percent_processor_time_threshold_warning}" critical = "${var.percent_processor_time_threshold_critical}" } silenced = "${var.percent_processor_time_silenced}" notify_no_data = false evaluation_delay = "${var.evaluation_delay}" renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false new_host_delay = "${var.new_host_delay}" tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:redis", "team:claranet", "created-by:terraform", "${var.percent_processor_time_extra_tags}"] } resource "datadog_monitor" "server_load" { count = "${var.server_load_rate_enabled == "true" ? 1 : 0}" 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 type = "metric alert" thresholds { warning = "${var.server_load_rate_threshold_warning}" critical = "${var.server_load_rate_threshold_critical}" } silenced = "${var.server_load_rate_silenced}" notify_no_data = false evaluation_delay = "${var.evaluation_delay}" renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false new_host_delay = "${var.new_host_delay}" tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:redis", "team:claranet", "created-by:terraform", "${var.server_load_rate_extra_tags}"] }