resource "datadog_monitor" "apimgt_status" { count = var.status_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] API Management is down" message = coalesce(var.status_message, var.message) type = "metric alert" query = < ${var.failed_requests_threshold_critical} EOQ monitor_thresholds { critical = var.failed_requests_threshold_critical warning = var.failed_requests_threshold_warning } new_host_delay = var.new_host_delay evaluation_delay = var.evaluation_delay notify_no_data = false notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:apimanagement", "team:claranet", "created-by:terraform"], var.failed_requests_extra_tags) } resource "datadog_monitor" "apimgt_other_requests" { count = var.other_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${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) type = "query alert" query = < ${var.other_requests_threshold_critical} EOQ monitor_thresholds { critical = var.other_requests_threshold_critical warning = var.other_requests_threshold_warning } new_host_delay = var.new_host_delay evaluation_delay = var.evaluation_delay notify_no_data = false notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:apimanagement", "team:claranet", "created-by:terraform"], var.other_requests_extra_tags) } resource "datadog_monitor" "apimgt_unauthorized_requests" { count = var.unauthorized_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${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) type = "query alert" query = < ${var.unauthorized_requests_threshold_critical} EOQ monitor_thresholds { critical = var.unauthorized_requests_threshold_critical warning = var.unauthorized_requests_threshold_warning } new_host_delay = var.new_host_delay evaluation_delay = var.evaluation_delay notify_no_data = false notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:apimanagement", "team:claranet", "created-by:terraform"], var.unauthorized_requests_extra_tags) } resource "datadog_monitor" "apimgt_successful_requests" { count = var.successful_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${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) type = "query alert" query = <