data "template_file" "filter" { template = "$${filter}" vars { filter = "${var.filter_tags_default == "true" ? format("dd_monitoring:enabled,dd_azure_storage:enabled,env:%s", var.environment) : "${var.filter_tags_custom}"}" } } resource "datadog_monitor" "availability" { name = "[${var.environment}] Azure Storage {{name}} unvailability detected" message = "${var.message}" query = < ${var.latency_threshold_critical} EOF thresholds { critical = "${var.latency_threshold_critical}" } type = "metric alert" notify_no_data = true notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = true new_host_delay = "${var.delay}" evaluation_delay = "${var.delay}" renotify_interval = 0 no_data_timeframe = 20 tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] } resource "datadog_monitor" "timeout_error_requests" { name = "[${var.environment}] Azure Storage {{value}}% of timeout error requests on {{name}}" message = "${var.message}" query = < ${var.timeout_error_requests_threshold_critical} EOF thresholds { critical = "${var.timeout_error_requests_threshold_critical}" } type = "metric alert" notify_no_data = true notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = true new_host_delay = "${var.delay}" evaluation_delay = "${var.delay}" renotify_interval = 0 no_data_timeframe = 20 tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] } resource "datadog_monitor" "network_error_requests" { name = "[${var.environment}] Azure Storage {{value}}% of network error requests on {{name}}" message = "${var.message}" query = < ${var.network_error_requests_threshold_critical} EOF thresholds { critical = "${var.network_error_requests_threshold_critical}" } type = "metric alert" notify_no_data = true notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = true new_host_delay = "${var.delay}" evaluation_delay = "${var.delay}" renotify_interval = 0 no_data_timeframe = 20 tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] } resource "datadog_monitor" "throttling_error_requests" { name = "[${var.environment}] Azure Storage {{value}}% of throttling error requests on {{name}}" message = "${var.message}" query = < ${var.throttling_error_requests_threshold_critical} EOF thresholds { critical = "${var.throttling_error_requests_threshold_critical}" } type = "metric alert" notify_no_data = true notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = true new_host_delay = "${var.delay}" evaluation_delay = "${var.delay}" renotify_interval = 0 no_data_timeframe = 20 tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] } resource "datadog_monitor" "server_other_error_requests" { name = "[${var.environment}] Azure Storage {{value}}% of server_other error requests on {{name}}" message = "${var.message}" query = < ${var.server_other_error_requests_threshold_critical} EOF thresholds { critical = "${var.server_other_error_requests_threshold_critical}" } type = "metric alert" notify_no_data = true notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = true new_host_delay = "${var.delay}" evaluation_delay = "${var.delay}" renotify_interval = 0 no_data_timeframe = 20 tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] } resource "datadog_monitor" "client_other_error_requests" { name = "[${var.environment}] Azure Storage {{value}}% of client_other error requests on {{name}}" message = "${var.message}" query = < ${var.client_other_error_requests_threshold_critical} EOF thresholds { critical = "${var.client_other_error_requests_threshold_critical}" } type = "metric alert" notify_no_data = true notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = true new_host_delay = "${var.delay}" evaluation_delay = "${var.delay}" renotify_interval = 0 no_data_timeframe = 20 tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] } resource "datadog_monitor" "authorization_error_requests" { name = "[${var.environment}] Azure Storage {{value}}% of authorization error requests on {{name}}" message = "${var.message}" query = < ${var.authorization_error_requests_threshold_critical} EOF thresholds { critical = "${var.authorization_error_requests_threshold_critical}" } type = "metric alert" notify_no_data = true notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = true new_host_delay = "${var.delay}" evaluation_delay = "${var.delay}" renotify_interval = 0 no_data_timeframe = 20 tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] }