diff --git a/cloud/gcp/cloud-sql/mysql/README.md b/cloud/gcp/cloud-sql/mysql/README.md index 12dfdd3..f798ee7 100644 --- a/cloud/gcp/cloud-sql/mysql/README.md +++ b/cloud/gcp/cloud-sql/mysql/README.md @@ -50,29 +50,28 @@ Inputs | network_connections_timeframe | Timeframe for the Network Connections monitor | string | `last_5m` | no | | project_id | ID of the GCP Project | string | - | yes | | queries_changing_anomaly_detection_algorithm | Anomaly Detection Algorithm used | string | `robust` | no | -| queries_changing_database_ids | Queries Changing Abnormally | list | `` | no | +| queries_changing_database_ids | List of database ids for the Queries Changing monitor | list | `` | no | | queries_changing_deviations | Deviations to detect the anomaly | string | `4` | no | | queries_changing_direction | Direction of the anomaly. It can be both, below or above. | string | `both` | no | | queries_changing_message | Custom message for the Queries Changing monitor | string | `` | no | -| queries_changing_region | | string | `` | no | | queries_changing_seasonality | Seasonality of the algorithm | string | `weekly` | no | | queries_changing_silenced | Groups to mute for GCP Cloud SQL Queries Changing monitor | map | `` | no | | queries_changing_threshold_critical | Queries Changing critical threshold | string | `1` | no | | queries_changing_threshold_warning | Queries Changing warning threshold | string | `0.5` | no | | queries_changing_timeframe | Timeframe for the Queries Changing mon monitor | string | `last_10m` | no | | questions_changing_anomaly_detection_algorithm | Anomaly Detection Algorithm used | string | `robust` | no | -| questions_changing_database_ids | | list | `` | no | +| questions_changing_database_ids | List of database ids for the Questions Changing monitor | list | `` | no | | questions_changing_deviations | Deviations to detect the anomaly | string | `4` | no | | questions_changing_direction | Direction of the anomaly. It can be both, below or above. | string | `both` | no | | questions_changing_message | Custom message for the Questions Changing monitor | string | `` | no | -| questions_changing_region | | string | `` | no | | questions_changing_seasonality | Seasonality of the algorithm | string | `weekly` | no | | questions_changing_silenced | Groups to mute for GCP Cloud SQL Network Connections monitor | map | `` | no | | questions_changing_threshold_critical | Questions Changing critical threshold | string | `1` | no | | questions_changing_threshold_warning | Questions Changing warning threshold | string | `0.5` | no | -| questions_changing_timeframe | Timeframe for the Questions Changing mon monitor | string | `last_10m` | no | +| questions_changing_timeframe | Timeframe for the Questions Changing monitor | string | `last_10m` | no | | replication_lag_message | Custom message for the Replication Lag monitor | string | `` | no | | replication_lag_silenced | Groups to mute for GCP Cloud SQL Replication Lag monitor | map | `` | no | | replication_lag_threshold_critical | Seconds behind the master (critical threshold) | string | `2700` | no | | replication_lag_threshold_warning | Seconds behind the master (warning threshold) | string | `2000` | no | | replication_lag_timeframe | Timeframe for the Replication Lag monitor | string | `last_10m` | no | + diff --git a/cloud/gcp/cloud-sql/mysql/inputs.tf b/cloud/gcp/cloud-sql/mysql/inputs.tf index e440edc..833d159 100644 --- a/cloud/gcp/cloud-sql/mysql/inputs.tf +++ b/cloud/gcp/cloud-sql/mysql/inputs.tf @@ -109,17 +109,11 @@ variable "replication_lag_silenced" { # Queries Changing Abnormally # variable "queries_changing_database_ids" { - description = "" + description = "List of database ids for the Queries Changing monitor" type = "list" default = [] } -variable "queries_changing_region" { - description = "" - type = "string" - default = "" -} - variable "queries_changing_message" { description = "Custom message for the Queries Changing monitor" type = "string" @@ -184,23 +178,17 @@ variable "questions_changing_message" { } variable "questions_changing_timeframe" { - description = "Timeframe for the Questions Changing mon monitor" + description = "Timeframe for the Questions Changing monitor" type = "string" default = "last_10m" } variable "questions_changing_database_ids" { - description = "" + description = "List of database ids for the Questions Changing monitor" type = "list" default = [] } -variable "questions_changing_region" { - description = "" - type = "string" - default = "" -} - variable "questions_changing_anomaly_detection_algorithm" { description = "Anomaly Detection Algorithm used" type = "string" diff --git a/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf b/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf index e24b5db..a81b8af 100644 --- a/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf +++ b/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf @@ -32,7 +32,6 @@ EOF critical = "${var.network_connections_threshold_critical}" } - include_tags = true notify_no_data = true require_full_window = false renotify_interval = 0 @@ -74,7 +73,6 @@ EOF warning = "${var.replication_lag_threshold_warning}" } - include_tags = true notify_no_data = true require_full_window = false renotify_interval = 0 @@ -101,7 +99,7 @@ EOF resource "datadog_monitor" "queries_changing_anomaly" { count = "${length(var.queries_changing_database_ids)}" - name = "[${var.environment}] Cloud SQL MySQL Queries Count changed abnormally on ${var.project_id}:${var.queries_changing_region}:${var.queries_changing_database_ids[count.index]} {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] Cloud SQL MySQL Queries Count changed abnormally on ${var.project_id}:${var.queries_changing_database_ids[count.index]} {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.queries_changing_message, var.message)}" type = "metric alert" @@ -110,7 +108,7 @@ resource "datadog_monitor" "queries_changing_anomaly" { avg(${var.queries_changing_timeframe}): anomalies( default( - avg:gcp.cloudsql.database.mysql.queries{project_id:${var.project_id},database_id:${var.project_id}:${var.queries_changing_region}:${var.queries_changing_database_ids[count.index]}}, + avg:gcp.cloudsql.database.mysql.queries{project_id:${var.project_id},database_id:${var.project_id}:${var.queries_changing_database_ids[count.index]}}, 0), '${var.queries_changing_anomaly_detection_algorithm}', ${var.queries_changing_deviations}, @@ -125,7 +123,6 @@ EOF critical = "${var.queries_changing_threshold_critical}" } - include_tags = true notify_no_data = true require_full_window = false renotify_interval = 0 @@ -143,7 +140,7 @@ EOF "env:${var.environment}", "resource:cloud-sql", "engine:mysql", - "database_id:${var.project_id}:${var.queries_changing_region}:${var.queries_changing_database_ids[count.index]}}", + "database_id:${var.project_id}:${var.queries_changing_database_ids[count.index]}}", ] } @@ -153,7 +150,7 @@ EOF resource "datadog_monitor" "questions_changing_anomaly" { count = "${length(var.questions_changing_database_ids)}" - name = "[${var.environment}] Cloud SQL MySQL Questions Count changed abnormally on ${var.project_id}:${var.questions_changing_region}:${var.questions_changing_database_ids[count.index]} {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] Cloud SQL MySQL Questions Count changed abnormally on ${var.project_id}:${var.questions_changing_database_ids[count.index]} {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.questions_changing_message, var.message)}" type = "metric alert" @@ -162,7 +159,7 @@ resource "datadog_monitor" "questions_changing_anomaly" { avg(${var.questions_changing_timeframe}): anomalies( default( - avg:gcp.cloudsql.database.mysql.questions{project_id:${var.project_id},database_id:${var.project_id}:${var.questions_changing_region}:${var.questions_changing_database_ids[count.index]}}, + avg:gcp.cloudsql.database.mysql.questions{project_id:${var.project_id},database_id:${var.project_id}:${var.questions_changing_database_ids[count.index]}}, 0), '${var.questions_changing_anomaly_detection_algorithm}', ${var.questions_changing_deviations}, @@ -177,7 +174,6 @@ EOF critical = "${var.questions_changing_threshold_critical}" } - include_tags = true notify_no_data = true require_full_window = false renotify_interval = 0 @@ -195,6 +191,6 @@ EOF "env:${var.environment}", "resource:cloud-sql", "engine:mysql", - "database_id:${var.project_id}:${var.questions_changing_region}:${var.questions_changing_database_ids[count.index]}", + "database_id:${var.project_id}:${var.questions_changing_database_ids[count.index]}", ] }