From f07e0b59b65f659b2a81d6e0d66d9b153d73a9bf Mon Sep 17 00:00:00 2001 From: Rafael Romero Carmona Date: Tue, 31 Jul 2018 10:26:58 +0200 Subject: [PATCH] MON-224 Network Connections monitor removed. It is on the MySQL integration --- cloud/gcp/cloud-sql/mysql/README.md | 10 ---- cloud/gcp/cloud-sql/mysql/inputs.tf | 51 ------------------- .../mysql/monitors-cloudsql-mysql.tf | 47 ----------------- cloud/gcp/cloud-sql/mysql/outputs.tf | 5 -- 4 files changed, 113 deletions(-) diff --git a/cloud/gcp/cloud-sql/mysql/README.md b/cloud/gcp/cloud-sql/mysql/README.md index 4c21190..1e3b7ce 100644 --- a/cloud/gcp/cloud-sql/mysql/README.md +++ b/cloud/gcp/cloud-sql/mysql/README.md @@ -16,7 +16,6 @@ module "datadog-monitors-cloud-gcp-cloud-sql-mysql" { Creates DataDog monitors with the following checks: -- Cloud SQL MySQL Network Connections (hard limit: ${var.network_connections_hard_limit}) - Cloud SQL MySQL Replication Lag - Cloud SQL MySQL Queries Count changed abnormally - Cloud SQL MySQL Questions Count changed abnormally @@ -30,14 +29,6 @@ Creates DataDog monitors with the following checks: | 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 | | message | Message sent when a monitor is triggered | string | - | yes | -| network_connections_enabled | Whether or not to create the monitor | string | `true` | no | -| network_connections_extra_tags | Extra tags for GCP Cloud SQL Network Connections monitor | list | `` | no | -| network_connections_hard_limit | Max number of connections for the CloudSQL Instance. Default value is the max value on https://cloud.google.com/sql/docs/quotas#fixed-limits for MySQL | string | `4000` | no | -| network_connections_message | Custom message for the Network Connections monitor | string | `` | no | -| network_connections_silenced | Groups to mute for GCP Cloud SQL Network Connections monitor | map | `` | no | -| network_connections_threshold_critical | Number of network connections (critical threshold) | string | `3600` | no | -| network_connections_threshold_warning | Number of network connections (warning threshold) | string | `3200` | no | -| network_connections_timeframe | Timeframe for the Network Connections monitor | string | `last_15m` | no | | project_id | ID of the GCP Project | string | - | yes | | queries_changing_anomaly_alert_window | Alert window. | string | `last_30m` | no | | queries_changing_anomaly_count_default_zero | Count default zero. | string | `false` | no | @@ -81,7 +72,6 @@ Creates DataDog monitors with the following checks: | Name | Description | |------|-------------| -| network_connections_id | id for monitor network_connections | | queries_changing_anomaly_id | id for monitor queries_changing_anomaly | | questions_changing_anomaly_id | id for monitor questions_changing_anomaly | | replication_lag_id | id for monitor replication_lag | diff --git a/cloud/gcp/cloud-sql/mysql/inputs.tf b/cloud/gcp/cloud-sql/mysql/inputs.tf index 2d7bdf4..997f66f 100644 --- a/cloud/gcp/cloud-sql/mysql/inputs.tf +++ b/cloud/gcp/cloud-sql/mysql/inputs.tf @@ -33,57 +33,6 @@ variable "project_id" { description = "ID of the GCP Project" } -# -# Network Connections -# -variable "network_connections_enabled" { - description = "Whether or not to create the monitor" - type = "string" - default = "true" -} - -variable "network_connections_message" { - description = "Custom message for the Network Connections monitor" - type = "string" - default = "" -} - -variable "network_connections_timeframe" { - description = "Timeframe for the Network Connections monitor" - type = "string" - default = "last_15m" -} - -variable "network_connections_hard_limit" { - description = "Max number of connections for the CloudSQL Instance. Default value is the max value on https://cloud.google.com/sql/docs/quotas#fixed-limits for MySQL" - type = "string" - default = 4000 -} - -variable "network_connections_threshold_warning" { - description = "Number of network connections (warning threshold)" - type = "string" - default = 3200 -} - -variable "network_connections_threshold_critical" { - description = "Number of network connections (critical threshold)" - type = "string" - default = 3600 -} - -variable "network_connections_silenced" { - description = "Groups to mute for GCP Cloud SQL Network Connections monitor" - type = "map" - default = {} -} - -variable "network_connections_extra_tags" { - description = "Extra tags for GCP Cloud SQL Network Connections monitor" - type = "list" - default = [] -} - # # Replication Lag # diff --git a/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf b/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf index d31ba08..1d90cad 100644 --- a/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf +++ b/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf @@ -11,53 +11,6 @@ data "template_file" "filter" { } } -# -# MySQL Network Connections -# -resource "datadog_monitor" "network_connections" { - count = "${var.network_connections_enabled == "true" ? 1 : 0 }" - - name = "[${var.environment}] Cloud SQL MySQL Network Connections (hard limit: ${var.network_connections_hard_limit}) {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.network_connections_message, var.message)}" - - type = "metric alert" - - query = < ${var.network_connections_threshold_critical} -EOF - - thresholds { - warning = "${var.network_connections_threshold_warning}" - critical = "${var.network_connections_threshold_critical}" - } - - notify_no_data = false - require_full_window = false - renotify_interval = 0 - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - - evaluation_delay = "${var.delay}" - new_host_delay = "${var.delay}" - - silenced = "${var.network_connections_silenced}" - - tags = [ - "team:gcp", - "provider:gcp", - "env:${var.environment}", - "created_by:terraform", - "resource:cloud-sql", - "engine:mysql", - "${var.network_connections_extra_tags}", - ] -} - # # Replication Lag # diff --git a/cloud/gcp/cloud-sql/mysql/outputs.tf b/cloud/gcp/cloud-sql/mysql/outputs.tf index e093106..ec11b98 100644 --- a/cloud/gcp/cloud-sql/mysql/outputs.tf +++ b/cloud/gcp/cloud-sql/mysql/outputs.tf @@ -1,8 +1,3 @@ -output "network_connections_id" { - description = "id for monitor network_connections" - value = "${datadog_monitor.network_connections.id}" -} - output "replication_lag_id" { description = "id for monitor replication_lag" value = "${datadog_monitor.replication_lag.id}"