diff --git a/cloud/azure/redis/README.md b/cloud/azure/redis/README.md index 8520c6b..45538d1 100644 --- a/cloud/azure/redis/README.md +++ b/cloud/azure/redis/README.md @@ -9,9 +9,8 @@ module "datadog-monitors-azure-redis" { source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git//cloud/azure/redis?ref={revision}" message = "${module.datadog-message-alerting.alerting-message}" - environment = "${var.environment}" - client_name = "${var.client_name}" + subscription_id = "${var.subscription_id}" } ``` @@ -29,7 +28,6 @@ Inputs | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| -| client_name | Client name | string | - | yes | | delay | Delay in seconds for the metric evaluation | string | `600` | no | | environment | Architecture environment | string | - | yes | | evictedkeys_limit_threshold_critical | Evicted keys limit (critical threshold) | string | `100` | no | @@ -37,9 +35,12 @@ Inputs | message | Message sent when a Redis monitor is triggered | string | - | yes | | percent_processor_time_threshold_critical | Processor time percent (critical threshold) | string | `80` | no | | percent_processor_time_threshold_warning | Processor time percent (warning threshold) | string | `60` | no | +| provider | What is the monitored provider | string | azure | no | | server_load_rate_threshold_critical | Server CPU load rate (critical threshold) | string | `90` | no | | server_load_rate_threshold_warning | Server CPU load rate (warning threshold) | string | `70` | no | | use_filter_tags | Filter the data with service tags if true | string | `true` | no | +| service | What is the monitored service | string | storage | no | +| subscription_id | Azure account id used as filter for monitors | string | - | yes | Related documentation --------------------- diff --git a/cloud/azure/redis/inputs.tf b/cloud/azure/redis/inputs.tf index 89385e8..7c57d63 100644 --- a/cloud/azure/redis/inputs.tf +++ b/cloud/azure/redis/inputs.tf @@ -1,12 +1,24 @@ # Global Terraform -variable "client_name" { - description = "Client name" - type = "string" -} - variable "environment" { description = "Architecture environment" - type = "string" + type = "string" +} + +variable "subscription_id" { + description = "Azure account id used as filter for monitors" + type = "string" +} + +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 diff --git a/cloud/azure/redis/monitors-azure-redis.tf b/cloud/azure/redis/monitors-azure-redis.tf index 92652e9..950e9a1 100644 --- a/cloud/azure/redis/monitors-azure-redis.tf +++ b/cloud/azure/redis/monitors-azure-redis.tf @@ -2,7 +2,7 @@ data "template_file" "filter" { template = "$${filter}" vars { - filter = "${var.use_filter_tags == "true" ? format("dd_monitoring:enabled,dd_azure_redis: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}"}" } } @@ -26,6 +26,8 @@ EOF require_full_window = true new_host_delay = "${var.delay}" no_data_timeframe = 20 + + tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] } resource "datadog_monitor" "evictedkeys" { @@ -55,6 +57,8 @@ EOF require_full_window = true new_host_delay = "${var.delay}" no_data_timeframe = 20 + + tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] } resource "datadog_monitor" "percent_processor_time" { @@ -84,6 +88,8 @@ EOF require_full_window = true new_host_delay = "${var.delay}" no_data_timeframe = 20 + + tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] } resource "datadog_monitor" "server_load" { @@ -113,4 +119,6 @@ EOF require_full_window = true new_host_delay = "${var.delay}" no_data_timeframe = 20 + + tags = ["env:${var.environment}","resource:${var.service}","team:${var.provider}"] }