diff --git a/cloud/gcp/big-query/README.md b/cloud/gcp/big-query/README.md index 06ef809..7de7482 100644 --- a/cloud/gcp/big-query/README.md +++ b/cloud/gcp/big-query/README.md @@ -42,18 +42,17 @@ Creates DataDog monitors with the following checks: | concurrent_queries_threshold_critical | Concurrent Queries (critical threshold) (hard limit 50) | string | `45` | no | | concurrent_queries_threshold_warning | Concurrent Queries (warning threshold) (hard limit 50) | string | `40` | no | | concurrent_queries_timeframe | Timeframe for the Concurrent Queries monitor | string | `last_5m` | no | -| delay | Delay in seconds for the metric evaluation | string | `900` | no | | environment | Architecture environment | string | - | yes | +| evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | | execution_time_extra_tags | Extra tags for GCP Big Query Execution Time monitor | list | `` | no | | execution_time_message | Custom message for the Execution Time monitor | string | `` | no | | execution_time_silenced | Groups to mute for GCP Big Query Execution Time monitor. Muted by default. | map | `` | no | | execution_time_threshold_critical | Average Execution Time in seconds (critical threshold) | string | `150` | no | | execution_time_threshold_warning | Average Execution Time in seconds (warning threshold) | string | `100` | no | | execution_time_timeframe | Timeframe for the Execution Time monitor | string | `last_5m` | no | -| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | -| filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | +| filter_tags | Tags used for filtering | string | `*` | no | | message | Message sent when a monitor is triggered | string | - | yes | -| project_id | ID of the GCP Project | string | - | yes | +| new_host_delay | Delay in seconds for the new host evaluation | string | `300` | no | | scanned_bytes_billed_extra_tags | Extra tags for GCP Big Query Scanned Bytes Billed monitor | list | `` | no | | scanned_bytes_billed_message | Custom message for the Scanned Bytes Billed monitor | string | `` | no | | scanned_bytes_billed_silenced | Groups to mute for GCP Big Query Scanned Bytes Billed monitor. Muted by default. | map | `` | no | diff --git a/cloud/gcp/big-query/inputs.tf b/cloud/gcp/big-query/inputs.tf index 70ec912..92dcb77 100644 --- a/cloud/gcp/big-query/inputs.tf +++ b/cloud/gcp/big-query/inputs.tf @@ -7,13 +7,8 @@ variable "environment" { type = "string" } -variable "filter_tags_use_defaults" { - description = "Use default filter tags convention" - default = "true" -} - -variable "filter_tags_custom" { - description = "Tags used for custom filtering when filter_tags_use_defaults is false" +variable "filter_tags" { + description = "Tags used for filtering" default = "*" } @@ -21,18 +16,14 @@ variable "message" { description = "Message sent when a monitor is triggered" } -variable "delay" { +variable "evaluation_delay" { description = "Delay in seconds for the metric evaluation" default = 900 } -# -# Filter variables -# - -variable "project_id" { - type = "string" - description = "ID of the GCP Project" +variable "new_host_delay" { + description = "Delay in seconds for the new host evaluation" + default = 300 } # diff --git a/cloud/gcp/big-query/monitors-big-query.tf b/cloud/gcp/big-query/monitors-big-query.tf index a851151..ca290f8 100644 --- a/cloud/gcp/big-query/monitors-big-query.tf +++ b/cloud/gcp/big-query/monitors-big-query.tf @@ -1,16 +1,3 @@ -# -# FILTER -# -data "template_file" "filter" { - template = "$${filter}" - - vars { - filter = "${var.filter_tags_use_defaults == "true" ? - format("project_id:%s", var.project_id) : - "${var.filter_tags_custom}"}" - } -} - # # Concurrent queries # @@ -21,7 +8,7 @@ resource "datadog_monitor" "concurrent_queries" { type = "metric alert" query = < ${var.concurrent_queries_threshold_critical} EOF @@ -38,8 +25,8 @@ EOF timeout_h = 0 locked = false - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.concurrent_queries_silenced}" @@ -63,7 +50,7 @@ resource "datadog_monitor" "execution_time" { type = "metric alert" query = < ${var.execution_time_threshold_critical} EOF @@ -80,8 +67,8 @@ EOF timeout_h = 0 locked = false - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.execution_time_silenced}" @@ -105,7 +92,7 @@ resource "datadog_monitor" "scanned_bytes" { type = "metric alert" query = < ${var.scanned_bytes_threshold_critical} EOF @@ -122,8 +109,8 @@ EOF timeout_h = 0 locked = false - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.scanned_bytes_silenced}" @@ -147,7 +134,7 @@ resource "datadog_monitor" "scanned_bytes_billed" { type = "metric alert" query = < ${var.scanned_bytes_billed_threshold_critical} EOF @@ -164,8 +151,8 @@ EOF timeout_h = 0 locked = false - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.scanned_bytes_billed_silenced}" @@ -189,7 +176,7 @@ resource "datadog_monitor" "available_slots" { type = "metric alert" query = < ${var.stored_bytes_threshold_critical} EOF @@ -249,8 +236,8 @@ EOF timeout_h = 0 locked = false - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.stored_bytes_silenced}" @@ -274,7 +261,7 @@ resource "datadog_monitor" "table_count" { type = "metric alert" query = < ${var.table_count_threshold_critical} EOF @@ -292,8 +279,8 @@ EOF timeout_h = 0 locked = false - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.table_count_silenced}" @@ -317,7 +304,7 @@ resource "datadog_monitor" "uploaded_bytes" { type = "metric alert" query = < ${var.uploaded_bytes_threshold_critical} EOF @@ -335,8 +322,8 @@ EOF timeout_h = 0 locked = false - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.uploaded_bytes_silenced}" @@ -360,7 +347,7 @@ resource "datadog_monitor" "uploaded_bytes_billed" { type = "metric alert" query = < ${var.uploaded_bytes_billed_threshold_critical} EOF @@ -378,8 +365,8 @@ EOF timeout_h = 0 locked = false - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" + evaluation_delay = "${var.evaluation_delay}" + new_host_delay = "${var.new_host_delay}" silenced = "${var.uploaded_bytes_billed_silenced}"