resource "datadog_monitor" "servicebus_status" { count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Service Bus is down" message = "${coalesce(var.status_message, var.message)}" query = < ${var.user_errors_threshold_critical} EOF type = "metric alert" thresholds { critical = "${var.user_errors_threshold_critical}" warning = "${var.user_errors_threshold_warning}" } silenced = "${var.user_errors_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}", "resource:servicebus", "team:azure", "provider:azure"] } resource "datadog_monitor" "service_bus_server_errors" { count = "${var.server_errors_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Service Bus server errors rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.server_errors_message, var.message)}" query = < ${var.server_errors_threshold_critical} EOF type = "metric alert" thresholds { critical = "${var.server_errors_threshold_critical}" warning = "${var.server_errors_threshold_warning}" } silenced = "${var.server_errors_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}", "resource:servicebus", "team:azure", "provider:azure"] }