resource "datadog_monitor" "eventgrid_no_successful_message" { count = var.no_successful_message_rate_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Event Grid no successful message {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.no_successful_message_rate_message, var.message) type = "metric alert" # Query is a bit weird, but we only want to check the no-data query = < ${var.failed_messages_rate_thresold_critical} EOQ thresholds = { critical = var.failed_messages_rate_thresold_critical warning = var.failed_messages_rate_thresold_warning } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay notify_no_data = false renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventgrid", "team:claranet", "created-by:terraform", var.failed_messages_rate_extra_tags] } resource "datadog_monitor" "eventgrid_unmatched_events" { count = var.unmatched_events_rate_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Event Grid too many unmatched events {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.unmatched_events_rate_message, var.message) type = "query alert" query = < ${var.unmatched_events_rate_thresold_critical} EOQ thresholds = { critical = var.unmatched_events_rate_thresold_critical warning = var.unmatched_events_rate_thresold_warning } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay notify_no_data = false renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventgrid", "team:claranet", "created-by:terraform", var.unmatched_events_rate_extra_tags] }