diff --git a/cloud/azure/stream-analytics/README.md b/cloud/azure/stream-analytics/README.md index 83d0af4..f115e70 100644 --- a/cloud/azure/stream-analytics/README.md +++ b/cloud/azure/stream-analytics/README.md @@ -9,8 +9,8 @@ module "datadog-monitors-azure-redis" { source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git//cloud/azure/stream-analytics?ref={revision}" message = "${module.datadog-message-alerting.alerting-message}" - environment = "${var.environment}" + subscription_id = "${var.subscription_id}" } ``` @@ -31,6 +31,7 @@ Inputs | runtime_errors_threshold_warning | | string | `0` | no | | su_utilization_threshold_critical | | string | `80` | no | | su_utilization_threshold_warning | Monitor specific | string | `60` | no | +| subscription_id | Azure account id used as filter for monitors | string | - | yes | | use_filter_tags | Filter the data with service tags if true | string | `true` | no | Related documentation diff --git a/cloud/azure/stream-analytics/inputs.tf b/cloud/azure/stream-analytics/inputs.tf index 29db469..8160547 100644 --- a/cloud/azure/stream-analytics/inputs.tf +++ b/cloud/azure/stream-analytics/inputs.tf @@ -8,14 +8,28 @@ variable "message" { description = "Message sent when a monitor is triggered" } -# Global DataDog -variable "use_filter_tags" { - description = "Filter the data with service tags if true" - default = "true" +variable "subscription_id" { + description = "Azure account id used as filter for monitors" + type = "string" } -variable "notify_no_data" { - default = "false" +variable "provider" { + description = "Cloud provider which the monitor and its based metric depend on" + type = "string" + default = "azure" +} + +variable "service" { + description = "Service monitored by this set of monitors" + type = "string" + default = "storage" +} + +# Global DataDog + + +variable "message" { + description = "Message sent when a Redis monitor is triggered" } variable "delay" { @@ -23,7 +37,12 @@ variable "delay" { default = 600 } -# Monitor specific +variable "use_filter_tags" { + description = "Filter the data with service tags if true" + default = "true" +} + +# Azure Stream Analytics specific variable "su_utilization_threshold_warning" { default = 60 } diff --git a/cloud/azure/stream-analytics/monitors-stream-analytics.tf b/cloud/azure/stream-analytics/monitors-stream-analytics.tf index 6e6f651..e464dd4 100644 --- a/cloud/azure/stream-analytics/monitors-stream-analytics.tf +++ b/cloud/azure/stream-analytics/monitors-stream-analytics.tf @@ -2,12 +2,12 @@ data "template_file" "filter" { template = "$${filter}" vars { - filter = "${var.use_filter_tags == "true" ? format("dd_monitoring:enabled,dd_azure_stream_analytics:enabled,env:%s", var.environment) : "*"}" + filter = "${var.use_filter_tags == "true" ? format("dd_monitoring:enabled,dd_azure_storage:enabled,env:%s", var.environment) : "subscription_id:${var.subscription_id}"}" } } resource "datadog_monitor" "su_utilization" { - name = "[${var.environment}] Streaming Units utilization at more than ${var.su_utilization_threshold_critical}% on {{name}}" + name = "[${var.environment}] Stram Analytics streaming Units utilization at more than ${var.su_utilization_threshold_critical}% on {{name}}" message = "${var.message}" query = <