# # Concurrent queries # resource "datadog_monitor" "concurrent_queries" { count = var.concurrent_queries_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Concurrent Queries {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = coalesce(var.concurrent_queries_message, var.message) type = "query alert" query = < ${var.concurrent_queries_threshold_critical} EOQ thresholds = { warning = var.concurrent_queries_threshold_warning critical = var.concurrent_queries_threshold_critical } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay include_tags = true notify_no_data = false require_full_window = false renotify_interval = 0 notify_audit = false timeout_h = 0 locked = false tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.concurrent_queries_extra_tags) } # # Execution Time # resource "datadog_monitor" "execution_time" { count = var.execution_time_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Execution Time {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" message = coalesce(var.execution_time_message, var.message) type = "query alert" query = < ${var.execution_time_threshold_critical} EOQ thresholds = { warning = var.execution_time_threshold_warning critical = var.execution_time_threshold_critical } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay include_tags = true notify_no_data = false require_full_window = false renotify_interval = 0 notify_audit = false timeout_h = 0 locked = false tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.execution_time_extra_tags) } # # Scanned Bytes # resource "datadog_monitor" "scanned_bytes" { count = var.scanned_bytes_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Scanned Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = coalesce(var.scanned_bytes_message, var.message) type = "query alert" query = < ${var.scanned_bytes_threshold_critical} EOQ thresholds = { warning = var.scanned_bytes_threshold_warning critical = var.scanned_bytes_threshold_critical } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay include_tags = true notify_no_data = false require_full_window = false renotify_interval = 0 notify_audit = false timeout_h = 0 locked = false tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.scanned_bytes_extra_tags) } # # Scanned Bytes Billed # resource "datadog_monitor" "scanned_bytes_billed" { count = var.scanned_bytes_billed_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Scanned Bytes Billed {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = coalesce(var.scanned_bytes_billed_message, var.message) type = "query alert" query = < ${var.scanned_bytes_billed_threshold_critical} EOQ thresholds = { warning = var.scanned_bytes_billed_threshold_warning critical = var.scanned_bytes_billed_threshold_critical } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay include_tags = true notify_no_data = false require_full_window = false renotify_interval = 0 notify_audit = false timeout_h = 0 locked = false tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.scanned_bytes_billed_extra_tags) } # # Available Slots # resource "datadog_monitor" "available_slots" { count = var.available_slots_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Available Slots {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = coalesce(var.available_slots_message, var.message) type = "metric alert" query = < ${var.stored_bytes_threshold_critical} EOQ thresholds = { warning = var.stored_bytes_threshold_warning critical = var.stored_bytes_threshold_critical } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay include_tags = true notify_no_data = false require_full_window = false renotify_interval = 0 notify_audit = false timeout_h = 0 locked = false tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.stored_bytes_extra_tags) } # # Table Count # resource "datadog_monitor" "table_count" { count = var.table_count_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Table Count {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = coalesce(var.table_count_message, var.message) type = "metric alert" query = < ${var.table_count_threshold_critical} EOQ thresholds = { warning = var.table_count_threshold_warning critical = var.table_count_threshold_critical } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay include_tags = true notify_no_data = false require_full_window = false renotify_interval = 0 notify_audit = false timeout_h = 0 locked = false tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.table_count_extra_tags) } # # Uploaded Bytes # resource "datadog_monitor" "uploaded_bytes" { count = var.uploaded_bytes_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Uploaded Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = coalesce(var.uploaded_bytes_message, var.message) type = "query alert" query = < ${var.uploaded_bytes_threshold_critical} EOQ thresholds = { warning = var.uploaded_bytes_threshold_warning critical = var.uploaded_bytes_threshold_critical } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay include_tags = true notify_no_data = false require_full_window = false renotify_interval = 0 notify_audit = false timeout_h = 0 locked = false tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.uploaded_bytes_extra_tags) } # # Uploaded Bytes Billed # resource "datadog_monitor" "uploaded_bytes_billed" { count = var.uploaded_bytes_billed_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Uploaded Bytes Billed {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = coalesce(var.uploaded_bytes_billed_message, var.message) type = "query alert" query = < ${var.uploaded_bytes_billed_threshold_critical} EOQ thresholds = { warning = var.uploaded_bytes_billed_threshold_warning critical = var.uploaded_bytes_billed_threshold_critical } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay include_tags = true notify_no_data = false require_full_window = false renotify_interval = 0 notify_audit = false timeout_h = 0 locked = false tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.uploaded_bytes_billed_extra_tags) }