MON-446 Azure SQL Elastic Pool monitors updates

Also harmonize SQL databases monitors
This commit is contained in:
Laurent Piroelle 2019-05-07 11:17:32 +02:00 committed by Quentin Manfroi
parent 97b313f3db
commit ce742a20a2
4 changed files with 11 additions and 9 deletions

View File

@ -19,8 +19,8 @@ Creates DataDog monitors with the following checks:
- SQL Database CPU too high - SQL Database CPU too high
- SQL Database Deadlocks too high - SQL Database Deadlocks too high
- SQL Database DTU Consumption too high - SQL Database DTU Consumption too high
- SQL Database high disk usage
- SQL Database is down - SQL Database is down
- SQL Database low free space
## Inputs ## Inputs

View File

@ -41,11 +41,12 @@ resource "datadog_monitor" "sql-database_cpu" {
thresholds { thresholds {
critical = "${var.cpu_threshold_critical}" critical = "${var.cpu_threshold_critical}"
warning = "${var.cpu_threshold_warning}"
} }
silenced = "${var.cpu_silenced}" silenced = "${var.cpu_silenced}"
notify_no_data = true notify_no_data = false
evaluation_delay = "${var.evaluation_delay}" evaluation_delay = "${var.evaluation_delay}"
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
@ -60,7 +61,7 @@ resource "datadog_monitor" "sql-database_cpu" {
resource "datadog_monitor" "sql-database_free_space_low" { resource "datadog_monitor" "sql-database_free_space_low" {
count = "${var.diskspace_enabled == "true" ? 1 : 0}" count = "${var.diskspace_enabled == "true" ? 1 : 0}"
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Database low free space {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Database high disk usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = "${coalesce(var.diskspace_message, var.message)}" message = "${coalesce(var.diskspace_message, var.message)}"
type = "metric alert" type = "metric alert"
@ -78,7 +79,7 @@ resource "datadog_monitor" "sql-database_free_space_low" {
silenced = "${var.diskspace_silenced}" silenced = "${var.diskspace_silenced}"
notify_no_data = true notify_no_data = false
evaluation_delay = "${var.evaluation_delay}" evaluation_delay = "${var.evaluation_delay}"
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
@ -111,7 +112,7 @@ resource "datadog_monitor" "sql-database_dtu_consumption_high" {
silenced = "${var.dtu_silenced}" silenced = "${var.dtu_silenced}"
notify_no_data = true notify_no_data = false
evaluation_delay = "${var.evaluation_delay}" evaluation_delay = "${var.evaluation_delay}"
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false

View File

@ -18,7 +18,7 @@ Creates DataDog monitors with the following checks:
- SQL Elastic Pool CPU too high - SQL Elastic Pool CPU too high
- SQL Elastic Pool DTU Consumption too high - SQL Elastic Pool DTU Consumption too high
- SQL Elastic Pool low free space - SQL Elastic Pool high disk usage
## Inputs ## Inputs

View File

@ -13,6 +13,7 @@ resource "datadog_monitor" "sql_elasticpool_cpu" {
thresholds { thresholds {
critical = "${var.cpu_threshold_critical}" critical = "${var.cpu_threshold_critical}"
warning = "${var.cpu_threshold_warning}"
} }
silenced = "${var.cpu_silenced}" silenced = "${var.cpu_silenced}"
@ -32,7 +33,7 @@ resource "datadog_monitor" "sql_elasticpool_cpu" {
resource "datadog_monitor" "sql_elasticpool_free_space_low" { resource "datadog_monitor" "sql_elasticpool_free_space_low" {
count = "${var.diskspace_enabled == "true" ? 1 : 0}" count = "${var.diskspace_enabled == "true" ? 1 : 0}"
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Elastic Pool low free space {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Elastic Pool high disk usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = "${coalesce(var.diskspace_message, var.message)}" message = "${coalesce(var.diskspace_message, var.message)}"
type = "metric alert" type = "metric alert"
@ -50,7 +51,7 @@ resource "datadog_monitor" "sql_elasticpool_free_space_low" {
silenced = "${var.diskspace_silenced}" silenced = "${var.diskspace_silenced}"
notify_no_data = true notify_no_data = false
evaluation_delay = "${var.evaluation_delay}" evaluation_delay = "${var.evaluation_delay}"
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
@ -83,7 +84,7 @@ resource "datadog_monitor" "sql_elasticpool_dtu_consumption_high" {
silenced = "${var.dtu_silenced}" silenced = "${var.dtu_silenced}"
notify_no_data = true notify_no_data = false
evaluation_delay = "${var.evaluation_delay}" evaluation_delay = "${var.evaluation_delay}"
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false