diff --git a/cloud/azure/serverfarms/inputs.tf b/cloud/azure/serverfarms/inputs.tf index f2cd6ce..3f88290 100644 --- a/cloud/azure/serverfarms/inputs.tf +++ b/cloud/azure/serverfarms/inputs.tf @@ -105,6 +105,16 @@ variable "cpu_percentage_timeframe" { default = "last_5m" } +variable "cpu_percentage_threshold_critical" { + description = "CPU percentage (critical threshold)" + default = 80 +} + +variable "cpu_percentage_threshold_warning" { + description = "CPU percentage (warning threshold)" + default = 60 +} + # Memory percentage variable "memory_percentage_enabled" { description = "Flag to enable the serverfarms memory_percentage monitor" @@ -141,3 +151,13 @@ variable "memory_percentage_timeframe" { type = "string" default = "last_5m" } + +variable "memory_percentage_threshold_critical" { + description = "Memory percentage (critical threshold)" + default = 80 +} + +variable "memory_percentage_threshold_warning" { + description = "Memory percentage (warning threshold)" + default = 60 +} diff --git a/cloud/azure/serverfarms/monitors-azure-serverfarms.tf b/cloud/azure/serverfarms/monitors-azure-serverfarms.tf index 54e9e89..f593c3c 100644 --- a/cloud/azure/serverfarms/monitors-azure-serverfarms.tf +++ b/cloud/azure/serverfarms/monitors-azure-serverfarms.tf @@ -34,11 +34,16 @@ resource "datadog_monitor" "cpu_percentage" { query = < ${var.cpu_percentage_threshold_critical} EOF type = "metric alert" + thresholds { + warning = "${var.cpu_percentage_threshold_warning}" + critical = "${var.cpu_percentage_threshold_critical}" + } + silenced = "${var.cpu_percentage_silenced}" notify_no_data = true @@ -62,11 +67,16 @@ resource "datadog_monitor" "memory_percentage" { query = < ${var.memory_percentage_threshold_critical} EOF type = "metric alert" + thresholds { + warning = "${var.memory_percentage_threshold_warning}" + critical = "${var.memory_percentage_threshold_critical}" + } + silenced = "${var.memory_percentage_silenced}" notify_no_data = true