diff --git a/cloud/azure/stream-analytics/inputs.tf b/cloud/azure/stream-analytics/inputs.tf index 4ea5ee6..529e669 100644 --- a/cloud/azure/stream-analytics/inputs.tf +++ b/cloud/azure/stream-analytics/inputs.tf @@ -1,5 +1,5 @@ -variable "hno_escalation_group" {} -variable "ho_escalation_group" {} +variable "critical_escalation_group" {} +variable "warning_escalation_group" {} variable "environment" {} @@ -7,6 +7,10 @@ variable "notify_no_data" { default = "false" } +variable "filter_tags" { + default = "*" +} + variable "delay" { default = "600" } diff --git a/cloud/azure/stream-analytics/monitors-stream-analytics.tf b/cloud/azure/stream-analytics/monitors-stream-analytics.tf index ea2920f..4e64044 100644 --- a/cloud/azure/stream-analytics/monitors-stream-analytics.tf +++ b/cloud/azure/stream-analytics/monitors-stream-analytics.tf @@ -1,8 +1,8 @@ resource "datadog_monitor" "SU_utilization" { name = "[${var.environment}] SU utilization at more than ${var.su_utilization_critical}% on {{name}}" - message = "{{#is_alert}}\n${var.hno_escalation_group} \n{{/is_alert}} \n{{#is_recovery}}\n${var.hno_escalation_group}\n{{/is_recovery}}" + message = "{{#is_alert}}\n${var.critical_escalation_group} \n{{/is_alert}} \n{{#is_recovery}}\n${var.critical_escalation_group}\n{{/is_recovery}}" - query = "avg(last_5m):avg:azure.streamanalytics_streamingjobs.resource_utilization{*} by {name,resource_group} > ${var.su_utilization_critical}" + query = "avg(last_5m):avg:azure.streamanalytics_streamingjobs.resource_utilization{${var.filter_tags}} by {name,resource_group} > ${var.su_utilization_critical}" type = "query alert" notify_no_data = "${var.notify_no_data}" @@ -23,7 +23,7 @@ resource "datadog_monitor" "SU_utilization" { resource "datadog_monitor" "failed_function_requests" { name = "[${var.environment}] More than ${var.failed_function_requests_critical} failed function requests on {{name}}" - message = "{{#is_alert}}\n${var.hno_escalation_group} \n{{/is_alert}} \n{{#is_recovery}}\n${var.hno_escalation_group}\n{{/is_recovery}}" + message = "{{#is_alert}}\n${var.critical_escalation_group} \n{{/is_alert}} \n{{#is_recovery}}\n${var.critical_escalation_group}\n{{/is_recovery}}" query = "avg(last_5m):avg:azure.streamanalytics_streamingjobs.aml_callout_failed_requests{*} by {name,resource_group} > ${var.failed_function_requests_critical}" type = "query alert" @@ -46,7 +46,7 @@ resource "datadog_monitor" "failed_function_requests" { resource "datadog_monitor" "conversion_errors" { name = "[${var.environment}] More than ${var.conversion_errors_critical} conversion errors on {{name}}" - message = "{{#is_alert}}\n${var.hno_escalation_group} \n{{/is_alert}} \n{{#is_recovery}}\n${var.hno_escalation_group}\n{{/is_recovery}}" + message = "{{#is_alert}}\n${var.critical_escalation_group} \n{{/is_alert}} \n{{#is_recovery}}\n${var.critical_escalation_group}\n{{/is_recovery}}" query = "avg(last_5m):avg:azure.streamanalytics_streamingjobs.conversion_errors{*} by {name,resource_group} > ${var.conversion_errors_critical}" type = "query alert" @@ -69,7 +69,7 @@ resource "datadog_monitor" "conversion_errors" { resource "datadog_monitor" "runtime_errors" { name = "[${var.environment}] More than ${var.runtime_errors_critical} runtime errors on {{name}}" - message = "{{#is_alert}}\n${var.hno_escalation_group} \n{{/is_alert}} \n{{#is_recovery}}\n${var.hno_escalation_group}\n{{/is_recovery}}" + message = "{{#is_alert}}\n${var.critical_escalation_group} \n{{/is_alert}} \n{{#is_recovery}}\n${var.critical_escalation_group}\n{{/is_recovery}}" query = "avg(last_5m):avg:azure.streamanalytics_streamingjobs.errors{*} by {name,resource_group} > ${var.runtime_errors_critical}" type = "query alert"