Merge branch 'MON-383-remove-azure-monitors-using-comp' into 'master'
MON-383 - compute_consumption_percent monitors removed See merge request claranet/cloudnative/projects/datadog/terraform/monitors!11
This commit is contained in:
commit
919e0261c5
@ -16,7 +16,6 @@ module "datadog-monitors-cloud-azure-mysql" {
|
||||
|
||||
Creates DataDog monitors with the following checks:
|
||||
|
||||
- Mysql Server compute consumption
|
||||
- Mysql Server CPU usage
|
||||
- Mysql Server has no connection
|
||||
- Mysql Server IO consumption
|
||||
@ -27,14 +26,6 @@ Creates DataDog monitors with the following checks:
|
||||
|
||||
| Name | Description | Type | Default | Required |
|
||||
|------|-------------|:----:|:-----:|:-----:|
|
||||
| compute_consumption_enabled | Flag to enable Mysql status monitor | string | `true` | no |
|
||||
| compute_consumption_extra_tags | Extra tags for Mysql status monitor | list | `[]` | no |
|
||||
| compute_consumption_message | Custom message for Mysql compute consumption monitor | string | `` | no |
|
||||
| compute_consumption_silenced | Groups to mute for Mysql compute consumption monitor | map | `{}` | no |
|
||||
| compute_consumption_threshold_critical | Mysql compute consumption in percent (critical threshold) | string | `90` | no |
|
||||
| compute_consumption_threshold_warning | Mysql compute consumption in percent (warning threshold) | string | `80` | no |
|
||||
| compute_consumption_time_aggregator | Monitor aggregator for Mysql compute consumption [available values: min, max or avg] | string | `min` | no |
|
||||
| compute_consumption_timeframe | Monitor timeframe for Mysql compute consumption [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no |
|
||||
| cpu_usage_enabled | Flag to enable Mysql status monitor | string | `true` | no |
|
||||
| cpu_usage_extra_tags | Extra tags for Mysql status monitor | list | `[]` | no |
|
||||
| cpu_usage_message | Custom message for Mysql CPU monitor | string | `` | no |
|
||||
@ -84,7 +75,6 @@ Creates DataDog monitors with the following checks:
|
||||
|
||||
| Name | Description |
|
||||
|------|-------------|
|
||||
| mysql_compute_consumption_id | id for monitor mysql_compute_consumption |
|
||||
| mysql_cpu_usage_id | id for monitor mysql_cpu_usage |
|
||||
| mysql_free_storage_id | id for monitor mysql_free_storage |
|
||||
| mysql_io_consumption_id | id for monitor mysql_io_consumption |
|
||||
|
||||
@ -204,52 +204,6 @@ variable "io_consumption_threshold_critical" {
|
||||
default = "90"
|
||||
}
|
||||
|
||||
variable "compute_consumption_silenced" {
|
||||
description = "Groups to mute for Mysql compute consumption monitor"
|
||||
type = "map"
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "compute_consumption_enabled" {
|
||||
description = "Flag to enable Mysql status monitor"
|
||||
type = "string"
|
||||
default = "true"
|
||||
}
|
||||
|
||||
variable "compute_consumption_extra_tags" {
|
||||
description = "Extra tags for Mysql status monitor"
|
||||
type = "list"
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "compute_consumption_message" {
|
||||
description = "Custom message for Mysql compute consumption monitor"
|
||||
type = "string"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "compute_consumption_time_aggregator" {
|
||||
description = "Monitor aggregator for Mysql compute consumption [available values: min, max or avg]"
|
||||
type = "string"
|
||||
default = "min"
|
||||
}
|
||||
|
||||
variable "compute_consumption_timeframe" {
|
||||
description = "Monitor timeframe for Mysql compute consumption [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
|
||||
type = "string"
|
||||
default = "last_15m"
|
||||
}
|
||||
|
||||
variable "compute_consumption_threshold_warning" {
|
||||
description = "Mysql compute consumption in percent (warning threshold)"
|
||||
default = "80"
|
||||
}
|
||||
|
||||
variable "compute_consumption_threshold_critical" {
|
||||
description = "Mysql compute consumption in percent (critical threshold)"
|
||||
default = "90"
|
||||
}
|
||||
|
||||
variable "memory_usage_silenced" {
|
||||
description = "Groups to mute for Mysql memory monitor"
|
||||
type = "map"
|
||||
|
||||
@ -125,39 +125,6 @@ resource "datadog_monitor" "mysql_io_consumption" {
|
||||
tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform", "${var.io_consumption_extra_tags}"]
|
||||
}
|
||||
|
||||
resource "datadog_monitor" "mysql_compute_consumption" {
|
||||
count = "${var.compute_consumption_enabled ? 1 : 0}"
|
||||
name = "[${var.environment}] Mysql Server compute consumption {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
|
||||
message = "${coalesce(var.compute_consumption_message, var.message)}"
|
||||
|
||||
query = <<EOF
|
||||
${var.compute_consumption_time_aggregator}(${var.compute_consumption_timeframe}): (
|
||||
avg:azure.dbformysql_servers.compute_consumption_percent${module.filter-tags.query_alert} by {resource_group,region,name}
|
||||
) > ${var.compute_consumption_threshold_critical}
|
||||
EOF
|
||||
|
||||
type = "metric alert"
|
||||
|
||||
thresholds {
|
||||
critical = "${var.compute_consumption_threshold_critical}"
|
||||
warning = "${var.compute_consumption_threshold_warning}"
|
||||
}
|
||||
|
||||
silenced = "${var.compute_consumption_silenced}"
|
||||
|
||||
notify_no_data = false
|
||||
evaluation_delay = "${var.evaluation_delay}"
|
||||
renotify_interval = 0
|
||||
notify_audit = false
|
||||
timeout_h = 0
|
||||
include_tags = true
|
||||
locked = false
|
||||
require_full_window = false
|
||||
new_host_delay = "${var.new_host_delay}"
|
||||
|
||||
tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform", "${var.compute_consumption_extra_tags}"]
|
||||
}
|
||||
|
||||
resource "datadog_monitor" "mysql_memory_usage" {
|
||||
count = "${var.memory_usage_enabled ? 1 : 0}"
|
||||
name = "[${var.environment}] Mysql Server memory usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
|
||||
|
||||
@ -18,11 +18,6 @@ output "mysql_io_consumption_id" {
|
||||
value = "${datadog_monitor.mysql_io_consumption.*.id}"
|
||||
}
|
||||
|
||||
output "mysql_compute_consumption_id" {
|
||||
description = "id for monitor mysql_compute_consumption"
|
||||
value = "${datadog_monitor.mysql_compute_consumption.*.id}"
|
||||
}
|
||||
|
||||
output "mysql_memory_usage_id" {
|
||||
description = "id for monitor mysql_memory_usage"
|
||||
value = "${datadog_monitor.mysql_memory_usage.*.id}"
|
||||
|
||||
@ -16,7 +16,6 @@ module "datadog-monitors-cloud-azure-postgresql" {
|
||||
|
||||
Creates DataDog monitors with the following checks:
|
||||
|
||||
- Postgresql Server compute consumption
|
||||
- Postgresql Server CPU usage
|
||||
- Postgresql Server has no connection
|
||||
- Postgresql Server IO consumption
|
||||
@ -27,14 +26,6 @@ Creates DataDog monitors with the following checks:
|
||||
|
||||
| Name | Description | Type | Default | Required |
|
||||
|------|-------------|:----:|:-----:|:-----:|
|
||||
| compute_consumption_enabled | Flag to enable PostgreSQL status monitor | string | `true` | no |
|
||||
| compute_consumption_extra_tags | Extra tags for PostgreSQL status monitor | list | `[]` | no |
|
||||
| compute_consumption_message | Custom message for PostgreSQL compute consumption monitor | string | `` | no |
|
||||
| compute_consumption_silenced | Groups to mute for PostgreSQL compute consumption monitor | map | `{}` | no |
|
||||
| compute_consumption_threshold_critical | PostgreSQL compute consumption in percent (critical threshold) | string | `90` | no |
|
||||
| compute_consumption_threshold_warning | PostgreSQL compute consumption in percent (warning threshold) | string | `80` | no |
|
||||
| compute_consumption_time_aggregator | Monitor aggregator for PostgreSQL compute consumption [available values: min, max or avg] | string | `min` | no |
|
||||
| compute_consumption_timeframe | Monitor timeframe for PostgreSQL compute consumption [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no |
|
||||
| cpu_usage_enabled | Flag to enable PostgreSQL status monitor | string | `true` | no |
|
||||
| cpu_usage_extra_tags | Extra tags for PostgreSQL status monitor | list | `[]` | no |
|
||||
| cpu_usage_message | Custom message for PostgreSQL CPU monitor | string | `` | no |
|
||||
@ -84,7 +75,6 @@ Creates DataDog monitors with the following checks:
|
||||
|
||||
| Name | Description |
|
||||
|------|-------------|
|
||||
| postgresql_compute_consumption_id | id for monitor postgresql_compute_consumption |
|
||||
| postgresql_cpu_usage_id | id for monitor postgresql_cpu_usage |
|
||||
| postgresql_free_storage_id | id for monitor postgresql_free_storage |
|
||||
| postgresql_io_consumption_id | id for monitor postgresql_io_consumption |
|
||||
|
||||
@ -204,52 +204,6 @@ variable "io_consumption_threshold_critical" {
|
||||
default = "90"
|
||||
}
|
||||
|
||||
variable "compute_consumption_silenced" {
|
||||
description = "Groups to mute for PostgreSQL compute consumption monitor"
|
||||
type = "map"
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "compute_consumption_enabled" {
|
||||
description = "Flag to enable PostgreSQL status monitor"
|
||||
type = "string"
|
||||
default = "true"
|
||||
}
|
||||
|
||||
variable "compute_consumption_extra_tags" {
|
||||
description = "Extra tags for PostgreSQL status monitor"
|
||||
type = "list"
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "compute_consumption_message" {
|
||||
description = "Custom message for PostgreSQL compute consumption monitor"
|
||||
type = "string"
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "compute_consumption_time_aggregator" {
|
||||
description = "Monitor aggregator for PostgreSQL compute consumption [available values: min, max or avg]"
|
||||
type = "string"
|
||||
default = "min"
|
||||
}
|
||||
|
||||
variable "compute_consumption_timeframe" {
|
||||
description = "Monitor timeframe for PostgreSQL compute consumption [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
|
||||
type = "string"
|
||||
default = "last_15m"
|
||||
}
|
||||
|
||||
variable "compute_consumption_threshold_warning" {
|
||||
description = "PostgreSQL compute consumption in percent (warning threshold)"
|
||||
default = "80"
|
||||
}
|
||||
|
||||
variable "compute_consumption_threshold_critical" {
|
||||
description = "PostgreSQL compute consumption in percent (critical threshold)"
|
||||
default = "90"
|
||||
}
|
||||
|
||||
variable "memory_usage_silenced" {
|
||||
description = "Groups to mute for PostgreSQL memory monitor"
|
||||
type = "map"
|
||||
|
||||
@ -157,36 +157,3 @@ resource "datadog_monitor" "postgresql_memory_usage" {
|
||||
|
||||
tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:postgresql", "team:claranet", "created-by:terraform", "${var.memory_usage_extra_tags}"]
|
||||
}
|
||||
|
||||
resource "datadog_monitor" "postgresql_compute_consumption" {
|
||||
count = "${var.compute_consumption_enabled ? 1 : 0}"
|
||||
name = "[${var.environment}] Postgresql Server compute consumption {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
|
||||
message = "${coalesce(var.compute_consumption_message, var.message)}"
|
||||
|
||||
query = <<EOF
|
||||
${var.compute_consumption_time_aggregator}(${var.compute_consumption_timeframe}): (
|
||||
avg:azure.dbforpostgresql_servers.compute_consumption_percent${module.filter-tags.query_alert} by {resource_group,region,name}
|
||||
) > ${var.compute_consumption_threshold_critical}
|
||||
EOF
|
||||
|
||||
type = "metric alert"
|
||||
|
||||
thresholds {
|
||||
critical = "${var.compute_consumption_threshold_critical}"
|
||||
warning = "${var.compute_consumption_threshold_warning}"
|
||||
}
|
||||
|
||||
silenced = "${var.compute_consumption_silenced}"
|
||||
|
||||
notify_no_data = false
|
||||
evaluation_delay = "${var.evaluation_delay}"
|
||||
renotify_interval = 0
|
||||
notify_audit = false
|
||||
timeout_h = 0
|
||||
include_tags = true
|
||||
locked = false
|
||||
require_full_window = false
|
||||
new_host_delay = "${var.new_host_delay}"
|
||||
|
||||
tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:postgresql", "team:claranet", "created-by:terraform", "${var.compute_consumption_extra_tags}"]
|
||||
}
|
||||
|
||||
@ -22,8 +22,3 @@ output "postgresql_memory_usage_id" {
|
||||
description = "id for monitor postgresql_memory_usage"
|
||||
value = "${datadog_monitor.postgresql_memory_usage.*.id}"
|
||||
}
|
||||
|
||||
output "postgresql_compute_consumption_id" {
|
||||
description = "id for monitor postgresql_compute_consumption"
|
||||
value = "${datadog_monitor.postgresql_compute_consumption.*.id}"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user