MON-224 Network Connections monitor removed. It is on the MySQL integration
This commit is contained in:
parent
a6e49ad094
commit
f07e0b59b6
@ -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 | `<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 | `<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 |
|
||||
|
||||
@ -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
|
||||
#
|
||||
|
||||
@ -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 = <<EOF
|
||||
avg(${var.network_connections_timeframe}):
|
||||
avg:gcp.cloudsql.database.network.connections{${data.template_file.filter.rendered}}
|
||||
by {database_id}
|
||||
> ${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
|
||||
#
|
||||
|
||||
@ -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}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user