MON-78 Changed filter to reach proper resources

This commit is contained in:
Jérémy NANCEL 2017-10-30 17:46:21 +01:00 committed by Jérôme Respaut
parent 0706a50bad
commit 1f059622ed
2 changed files with 6 additions and 6 deletions

View File

@ -6,8 +6,8 @@ variable "notify_no_data" {
default = "false"
}
variable "filter_tags" {
default = "*"
variable "use_filter_tags" {
default = "true"
}
variable "delay" {

View File

@ -2,7 +2,7 @@ resource "datadog_monitor" "su_utilization" {
name = "[${var.environment}] Streaming Units utilization at more than ${var.su_utilization_threshold_critical}% on {{name}}"
message = "${var.message}"
query = "avg(last_5m):avg:azure.streamanalytics_streamingjobs.resource_utilization{${var.filter_tags}} by {name,resource_group} > ${var.su_utilization_threshold_critical}"
query = "avg(last_5m):avg:azure.streamanalytics_streamingjobs.resource_utilization{${var.use_filter_tags == "true" ? format("dd_monitoring:enabled,dd_azure_eventhub:enabled,env:%s", var.environment) : "*"} by {name,resource_group} > ${var.su_utilization_threshold_critical}"
type = "query alert"
notify_no_data = "${var.notify_no_data}"
@ -25,7 +25,7 @@ resource "datadog_monitor" "failed_function_requests" {
name = "[${var.environment}] More than ${var.function_requests_threshold_critical} failed function requests on {{name}}"
message = "${var.message}"
query = "avg(last_5m):avg:azure.streamanalytics_streamingjobs.aml_callout_failed_requests{*} by {name,resource_group} > ${var.function_requests_threshold_critical}"
query = "avg(last_5m):avg:azure.streamanalytics_streamingjobs.aml_callout_failed_requests{${var.use_filter_tags == "true" ? format("dd_monitoring:enabled,dd_azure_eventhub:enabled,env:%s", var.environment) : "*"}} by {name,resource_group} > ${var.function_requests_threshold_critical}"
type = "query alert"
notify_no_data = "${var.notify_no_data}"
@ -48,7 +48,7 @@ resource "datadog_monitor" "conversion_errors" {
name = "[${var.environment}] More than ${var.conversion_errors_threshold_critical} conversion errors on {{name}}"
message = "${var.message}"
query = "avg(last_5m):avg:azure.streamanalytics_streamingjobs.conversion_errors{*} by {name,resource_group} > ${var.conversion_errors_threshold_critical}"
query = "avg(last_5m):avg:azure.streamanalytics_streamingjobs.conversion_errors{${var.use_filter_tags == "true" ? format("dd_monitoring:enabled,dd_azure_stream_analytics:enabled,env:%s", var.environment) : "*"}} by {name,resource_group} > ${var.conversion_errors_threshold_critical}"
type = "query alert"
notify_no_data = "${var.notify_no_data}"
@ -71,7 +71,7 @@ resource "datadog_monitor" "runtime_errors" {
name = "[${var.environment}] More than ${var.runtime_errors_threshold_critical} runtime errors on {{name}}"
message = "${var.message}"
query = "avg(last_5m):avg:azure.streamanalytics_streamingjobs.errors{*} by {name,resource_group} > ${var.runtime_errors_threshold_critical}"
query = "avg(last_5m):avg:azure.streamanalytics_streamingjobs.errors{${var.use_filter_tags == "true" ? format("dd_monitoring:enabled,dd_azure_eventhub:enabled,env:%s", var.environment) : "*"} by {name,resource_group}} > ${var.runtime_errors_threshold_critical}"
type = "query alert"
notify_no_data = "${var.notify_no_data}"