resource "datadog_monitor" "too_many_jobs_failed" { name = "[${var.environment}] IOT Hub Too many jobs failed {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_jobs_rate_message, var.message)}" query = < ${var.failed_jobs_rate_threshold_critical} EOF type = "metric alert" thresholds { warning = "${var.failed_jobs_rate_threshold_warning}" critical = "${var.failed_jobs_rate_threshold_critical}" } silenced = "${var.failed_jobs_rate_silenced}" notify_no_data = false evaluation_delay = "${var.delay}" renotify_interval = 0 notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false new_host_delay = "${var.delay}" tags = ["env:${var.environment}", "resource:iothub", "team:azure", "provider:azure"] } resource "datadog_monitor" "too_many_list_jobs_failed" { name = "[${var.environment}] IOT Hub Too many list_jobs failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_listjobs_rate_message, var.message)}" query = < ${var.failed_listjobs_rate_threshold_critical} EOF type = "metric alert" thresholds { warning = "${var.failed_listjobs_rate_threshold_warning}" critical = "${var.failed_listjobs_rate_threshold_critical}" } silenced = "${var.failed_listjobs_rate_silenced}" notify_no_data = false evaluation_delay = "${var.delay}" renotify_interval = 0 notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false new_host_delay = "${var.delay}" tags = ["env:${var.environment}", "resource:iothub", "team:azure", "provider:azure"] } resource "datadog_monitor" "too_many_query_jobs_failed" { name = "[${var.environment}] IOT Hub Too many query_jobs failed {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_queryjobs_rate_message, var.message)}" query = < ${var.failed_queryjobs_rate_threshold_critical} EOF type = "metric alert" thresholds { warning = "${var.failed_queryjobs_rate_threshold_warning}" critical = "${var.failed_queryjobs_rate_threshold_critical}" } silenced = "${var.failed_queryjobs_rate_silenced}" notify_no_data = false evaluation_delay = "${var.delay}" renotify_interval = 0 notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false new_host_delay = "${var.delay}" tags = ["env:${var.environment}", "resource:iothub", "team:azure", "provider:azure"] } resource "datadog_monitor" "status" { name = "[${var.environment}] IOT Hub is down" message = "${coalesce(var.status_message, var.message)}" query = < ${var.failed_c2d_methods_rate_threshold_critical} EOF type = "metric alert" thresholds { warning = "${var.failed_c2d_methods_rate_threshold_warning}" critical = "${var.failed_c2d_methods_rate_threshold_critical}" } silenced = "${var.failed_c2d_methods_rate_silenced}" notify_no_data = false evaluation_delay = "${var.delay}" renotify_interval = 0 notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false new_host_delay = "${var.delay}" tags = ["env:${var.environment}", "resource:iothub", "team:azure", "provider:azure"] } resource "datadog_monitor" "too_many_c2d_twin_read_failed" { name = "[${var.environment}] IOT Hub Too many c2d twin read failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_c2d_twin_read_rate_message, var.message)}" query = < ${var.failed_c2d_twin_read_rate_threshold_critical} EOF type = "metric alert" thresholds { warning = "${var.failed_c2d_twin_read_rate_threshold_warning}" critical = "${var.failed_c2d_twin_read_rate_threshold_critical}" } silenced = "${var.failed_c2d_twin_read_rate_silenced}" notify_no_data = false evaluation_delay = "${var.delay}" renotify_interval = 0 notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false new_host_delay = "${var.delay}" tags = ["env:${var.environment}", "resource:iothub", "team:azure", "provider:azure"] } resource "datadog_monitor" "too_many_c2d_twin_update_failed" { name = "[${var.environment}] IOT Hub Too many c2d twin update failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_c2d_twin_update_rate_message, var.message)}" query = < ${var.failed_c2d_twin_update_rate_threshold_critical} EOF type = "metric alert" thresholds { warning = "${var.failed_c2d_twin_update_rate_threshold_warning}" critical = "${var.failed_c2d_twin_update_rate_threshold_critical}" } silenced = "${var.failed_c2d_twin_update_rate_silenced}" notify_no_data = false evaluation_delay = "${var.delay}" renotify_interval = 0 notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false new_host_delay = "${var.delay}" tags = ["env:${var.environment}", "resource:iothub", "team:azure", "provider:azure"] } resource "datadog_monitor" "too_many_d2c_twin_read_failed" { name = "[${var.environment}] IOT Hub Too many d2c twin read failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_d2c_twin_read_rate_message, var.message)}" query = < ${var.failed_d2c_twin_read_rate_threshold_critical} EOF type = "metric alert" thresholds { warning = "${var.failed_d2c_twin_read_rate_threshold_warning}" critical = "${var.failed_d2c_twin_read_rate_threshold_critical}" } silenced = "${var.failed_d2c_twin_read_rate_silenced}" notify_no_data = false evaluation_delay = "${var.delay}" renotify_interval = 0 notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false new_host_delay = "${var.delay}" tags = ["env:${var.environment}", "resource:iothub", "team:azure", "provider:azure"] } resource "datadog_monitor" "too_many_d2c_twin_update_failed" { name = "[${var.environment}] IOT Hub Too many d2c twin update failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_d2c_twin_update_rate_message, var.message)}" query = < ${var.failed_d2c_twin_update_rate_threshold_critical} EOF type = "metric alert" thresholds { warning = "${var.failed_d2c_twin_update_rate_threshold_warning}" critical = "${var.failed_d2c_twin_update_rate_threshold_critical}" } silenced = "${var.failed_d2c_twin_update_rate_silenced}" notify_no_data = false evaluation_delay = "${var.delay}" renotify_interval = 0 notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false new_host_delay = "${var.delay}" tags = ["env:${var.environment}", "resource:iothub", "team:azure", "provider:azure"] } resource "datadog_monitor" "too_many_d2c_telemetry_egress_dropped" { name = "[${var.environment}] IOT Hub Too many d2c telemetry egress dropped {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.dropped_d2c_telemetry_egress_message, var.message)}" query = < ${var.dropped_d2c_telemetry_egress_rate_threshold_critical} EOF type = "metric alert" thresholds { warning = "${var.dropped_d2c_telemetry_egress_rate_threshold_warning}" critical = "${var.dropped_d2c_telemetry_egress_rate_threshold_critical}" } silenced = "${var.dropped_d2c_telemetry_egress_silenced}" notify_no_data = false evaluation_delay = "${var.delay}" renotify_interval = 0 notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false new_host_delay = "${var.delay}" tags = ["env:${var.environment}", "resource:iothub", "team:azure", "provider:azure"] } resource "datadog_monitor" "too_many_d2c_telemetry_egress_orphaned" { name = "[${var.environment}] IOT Hub Too many d2c telemetry egress orphaned {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.orphaned_d2c_telemetry_egress_message, var.message)}" query = < ${var.orphaned_d2c_telemetry_egress_rate_threshold_critical} EOF type = "metric alert" thresholds { warning = "${var.orphaned_d2c_telemetry_egress_rate_threshold_warning}" critical = "${var.orphaned_d2c_telemetry_egress_rate_threshold_critical}" } silenced = "${var.orphaned_d2c_telemetry_egress_silenced}" notify_no_data = false evaluation_delay = "${var.delay}" renotify_interval = 0 notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false new_host_delay = "${var.delay}" tags = ["env:${var.environment}", "resource:iothub", "team:azure", "provider:azure"] } resource "datadog_monitor" "too_many_d2c_telemetry_egress_invalid" { name = "[${var.environment}] IOT Hub Too many d2c telemetry egress invalid {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.invalid_d2c_telemetry_egress_message, var.message)}" query = < ${var.invalid_d2c_telemetry_egress_rate_threshold_critical} EOF type = "metric alert" thresholds { warning = "${var.invalid_d2c_telemetry_egress_rate_threshold_warning}" critical = "${var.invalid_d2c_telemetry_egress_rate_threshold_critical}" } silenced = "${var.invalid_d2c_telemetry_egress_silenced}" notify_no_data = false evaluation_delay = "${var.delay}" renotify_interval = 0 notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false new_host_delay = "${var.delay}" tags = ["env:${var.environment}", "resource:iothub", "team:azure", "provider:azure"] } resource "datadog_monitor" "too_many_d2c_telemetry_ingress_nosent" { name = "[${var.environment}] IOT Hub Too many d2c telemetry ingress not sent {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.too_many_d2c_telemetry_ingress_nosent_message, var.message)}" query = < 0 EOF type = "metric alert" silenced = "${var.too_many_d2c_telemetry_ingress_nosent_silenced}" notify_no_data = false evaluation_delay = "${var.delay}" renotify_interval = 0 notify_audit = false timeout_h = 1 include_tags = true locked = false require_full_window = false new_host_delay = "${var.delay}" tags = ["env:${var.environment}", "resource:iothub", "team:azure", "provider:azure"] }