resource "datadog_monitor" "function_http_5xx_errors_rate" { count = "${var.http_5xx_errors_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Function App HTTP 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.http_5xx_errors_rate_message, var.message)}" query = < ${var.http_5xx_errors_rate_threshold_critical} EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" thresholds { warning = "${var.http_5xx_errors_rate_threshold_warning}" critical = "${var.http_5xx_errors_rate_threshold_critical}" } silenced = "${var.http_5xx_errors_rate_silenced}" notify_no_data = false renotify_interval = 0 require_full_window = false timeout_h = 1 include_tags = true tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure_functions", "team:claranet", "created-by:terraform", "${var.http_5xx_errors_rate_extra_tags}"] } resource "datadog_monitor" "function_high_connections_count" { count = "${var.high_connections_count_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Function App connections count too high {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" type = "metric alert" message = "${coalesce(var.high_connections_count_message, var.message)}" query = < ${var.high_connections_count_threshold_critical} EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" thresholds { warning = "${var.high_connections_count_threshold_warning}" critical = "${var.high_connections_count_threshold_critical}" } silenced = "${var.high_connections_count_silenced}" notify_no_data = false renotify_interval = 0 require_full_window = false timeout_h = 1 include_tags = true tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure_functions", "team:claranet", "created-by:terraform", "${var.high_connections_count_extra_tags}"] } resource "datadog_monitor" "function_high_threads_count" { count = "${var.high_threads_count_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Function App threads count too high {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" type = "metric alert" message = "${coalesce(var.high_threads_count_message, var.message)}" query = < ${var.high_threads_count_threshold_critical} EOQ evaluation_delay = "${var.evaluation_delay}" new_host_delay = "${var.new_host_delay}" thresholds { warning = "${var.high_threads_count_threshold_warning}" critical = "${var.high_threads_count_threshold_critical}" } silenced = "${var.high_threads_count_silenced}" notify_no_data = false renotify_interval = 0 require_full_window = false timeout_h = 1 include_tags = true tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure_functions", "team:claranet", "created-by:terraform", "${var.high_threads_count_extra_tags}"] }