From e3d409b76a651959349438d9f81c65e6eeebc973 Mon Sep 17 00:00:00 2001 From: "gauthier.ampe@fr.clara.net" Date: Fri, 14 Jun 2019 11:53:13 +0200 Subject: [PATCH 01/17] AZ-97 Add monitor for storage queueservices --- cloud/azure/storage/README.md | 129 +- cloud/azure/storage/inputs.tf | 188 ++- cloud/azure/storage/modules.tf | 84 +- cloud/azure/storage/monitors-azure-storage.tf | 1187 +++++++++++++++-- cloud/azure/storage/outputs.tf | 193 ++- 5 files changed, 1536 insertions(+), 245 deletions(-) diff --git a/cloud/azure/storage/README.md b/cloud/azure/storage/README.md index 3a3993f..466104b 100644 --- a/cloud/azure/storage/README.md +++ b/cloud/azure/storage/README.md @@ -6,8 +6,8 @@ module "datadog-monitors-cloud-azure-storage" { source = "git::ssh://git@git.fr.clara.net/claranet/pt-monitoring/projects/datadog/terraform/monitors.git//cloud/azure/storage?ref={revision}" - environment = var.environment - message = module.datadog-message-alerting.alerting-message + environment = "${var.environment}" + message = "${module.datadog-message-alerting.alerting-message}" } ``` @@ -16,37 +16,68 @@ module "datadog-monitors-cloud-azure-storage" { Creates DataDog monitors with the following checks: +- Azure Blob Storage too many authorization errors +- Azure Blob Storage too many client_other errors +- Azure Blob Storage too many network errors +- Azure Blob Storage too many server_other errors +- Azure Blob Storage too many throttling errors +- Azure Blob Storage too many timeout errors +- Azure File Storage too many authorization errors +- Azure File Storage too many client_other errors +- Azure File Storage too many network errors +- Azure File Storage too many server_other errors +- Azure File Storage too many timeout errors +- Azure Queue Storage too many authorization errors +- Azure Queue Storage too many client_other errors +- Azure Queue Storage too many network errors +- Azure Queue Storage too many server_other errors +- Azure Queue Storage too many timeout errors +- Azure Storage Blob Service too few successful requests +- Azure Storage Blob Service too high end to end latency +- Azure Storage Blob services is down +- Azure Storage File Service too few successful requests +- Azure Storage File Service too high end to end latency +- Azure Storage File Services is down - Azure Storage is down -- Azure Storage too few successful requests -- Azure Storage too high end to end latency -- Azure Storage too many authorization errors -- Azure Storage too many client_other errors -- Azure Storage too many network errors -- Azure Storage too many server_other errors +- Azure Storage Queue service is down +- Azure Storage Queue Service too few successful requests +- Azure Storage Queue Service too high end to end latency +- Azure Storage Table service is down +- Azure Storage Table Service too few successful requests +- Azure Storage Table Service too high end to end latency - Azure Storage too many throttling errors -- Azure Storage too many timeout errors +- Azure Storage too many throttling errors +- Azure Storage too many throttling errors +- Azure Table Storage too many authorization errors +- Azure Table Storage too many client_other errors +- Azure Table Storage too many network errors +- Azure Table Storage too many server_other errors +- Azure Table Storage too many timeout errors ## Inputs | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| | authorization\_error\_requests\_enabled | Flag to enable Storage authorization errors monitor | string | `"true"` | no | -| authorization\_error\_requests\_extra\_tags | Extra tags for Storage authorization errors monitor | list(string) | `[]` | no | +| authorization\_error\_requests\_extra\_tags | Extra tags for Storage authorization errors monitor | list | `[]` | no | | authorization\_error\_requests\_message | Custom message for Storage authorization errors monitor | string | `""` | no | +| authorization\_error\_requests\_silenced | Groups to mute for Storage authorization errors monitor | map | `{}` | no | | authorization\_error\_requests\_threshold\_critical | Maximum acceptable percent of authorization error requests for a storage | string | `"90"` | no | | authorization\_error\_requests\_threshold\_warning | Warning regarding acceptable percent of authorization error requests for a storage | string | `"50"` | no | | authorization\_error\_requests\_time\_aggregator | Monitor aggregator for Storage authorization errors [available values: min, max or avg] | string | `"min"` | no | | authorization\_error\_requests\_timeframe | Monitor timeframe for Storage authorization errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | availability\_enabled | Flag to enable Storage availability monitor | string | `"true"` | no | -| availability\_extra\_tags | Extra tags for Storage availability monitor | list(string) | `[]` | no | +| availability\_extra\_tags | Extra tags for Storage availability monitor | list | `[]` | no | | availability\_message | Custom message for Storage availability monitor | string | `""` | no | +| availability\_silenced | Groups to mute for Storage availability monitor | map | `{}` | no | | availability\_threshold\_critical | Minimum acceptable percent of availability for a storage | string | `"50"` | no | | availability\_threshold\_warning | Warning regarding acceptable percent of availability for a storage | string | `"90"` | no | | availability\_time\_aggregator | Monitor aggregator for Storage availability [available values: min, max or avg] | string | `"max"` | no | | availability\_timeframe | Monitor timeframe for Storage availability [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | client\_other\_error\_requests\_enabled | Flag to enable Storage other errors monitor | string | `"true"` | no | -| client\_other\_error\_requests\_extra\_tags | Extra tags for Storage other errors monitor | list(string) | `[]` | no | +| client\_other\_error\_requests\_extra\_tags | Extra tags for Storage other errors monitor | list | `[]` | no | | client\_other\_error\_requests\_message | Custom message for Storage other errors monitor | string | `""` | no | +| client\_other\_error\_requests\_silenced | Groups to mute for Storage other errors monitor | map | `{}` | no | | client\_other\_error\_requests\_threshold\_critical | Maximum acceptable percent of client other error requests for a storage | string | `"90"` | no | | client\_other\_error\_requests\_threshold\_warning | Warning regarding acceptable percent of client other error requests for a storage | string | `"50"` | no | | client\_other\_error\_requests\_time\_aggregator | Monitor aggregator for Storage other errors [available values: min, max or avg] | string | `"min"` | no | @@ -57,16 +88,18 @@ Creates DataDog monitors with the following checks: | filter\_tags\_custom\_excluded | Tags excluded for custom filtering when filter_tags_use_defaults is false | string | `""` | no | | filter\_tags\_use\_defaults | Use default filter tags convention | string | `"true"` | no | | latency\_enabled | Flag to enable Storage latency monitor | string | `"true"` | no | -| latency\_extra\_tags | Extra tags for Storage latency monitor | list(string) | `[]` | no | +| latency\_extra\_tags | Extra tags for Storage latency monitor | list | `[]` | no | | latency\_message | Custom message for Storage latency monitor | string | `""` | no | +| latency\_silenced | Groups to mute for Storage latency monitor | map | `{}` | no | | latency\_threshold\_critical | Maximum acceptable end to end latency (ms) for a storage | string | `"2000"` | no | | latency\_threshold\_warning | Warning regarding acceptable end to end latency (ms) for a storage | string | `"1000"` | no | | latency\_time\_aggregator | Monitor aggregator for Storage latency [available values: min, max or avg] | string | `"min"` | no | | latency\_timeframe | Monitor timeframe for Storage latency [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | message | Message sent when a Redis monitor is triggered | string | n/a | yes | | network\_error\_requests\_enabled | Flag to enable Storage network errors monitor | string | `"true"` | no | -| network\_error\_requests\_extra\_tags | Extra tags for Storage network errors monitor | list(string) | `[]` | no | +| network\_error\_requests\_extra\_tags | Extra tags for Storage network errors monitor | list | `[]` | no | | network\_error\_requests\_message | Custom message for Storage network errors monitor | string | `""` | no | +| network\_error\_requests\_silenced | Groups to mute for Storage network errors monitor | map | `{}` | no | | network\_error\_requests\_threshold\_critical | Maximum acceptable percent of network error requests for a storage | string | `"90"` | no | | network\_error\_requests\_threshold\_warning | Warning regarding acceptable percent of network error requests for a storage | string | `"50"` | no | | network\_error\_requests\_time\_aggregator | Monitor aggregator for Storage network errors [available values: min, max or avg] | string | `"min"` | no | @@ -74,29 +107,39 @@ Creates DataDog monitors with the following checks: | new\_host\_delay | Delay in seconds before monitor new resource | string | `"300"` | no | | prefix\_slug | Prefix string to prepend between brackets on every monitors names | string | `""` | no | | server\_other\_error\_requests\_enabled | Flag to enable Storage server other errors monitor | string | `"true"` | no | -| server\_other\_error\_requests\_extra\_tags | Extra tags for Storage server other errors monitor | list(string) | `[]` | no | +| server\_other\_error\_requests\_extra\_tags | Extra tags for Storage server other errors monitor | list | `[]` | no | | server\_other\_error\_requests\_message | Custom message for Storage server other errors monitor | string | `""` | no | +| server\_other\_error\_requests\_silenced | Groups to mute for Storage server other errors monitor | map | `{}` | no | | server\_other\_error\_requests\_threshold\_critical | Maximum acceptable percent of server other error requests for a storage | string | `"90"` | no | | server\_other\_error\_requests\_threshold\_warning | Warning regarding acceptable percent of server other error requests for a storage | string | `"50"` | no | | server\_other\_error\_requests\_time\_aggregator | Monitor aggregator for Storage other errors [available values: min, max or avg] | string | `"min"` | no | | server\_other\_error\_requests\_timeframe | Monitor timeframe for Storage server other errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | +| status\_enabled | Flag to enable App Services status monitor | string | `"true"` | no | +| status\_extra\_tags | Extra tags for App Services status monitor | list | `[]` | no | +| status\_message | Custom message for storage Services status monitor | string | `""` | no | +| status\_silenced | Groups to mute for App Services status monitor | map | `{}` | no | +| status\_time\_aggregator | Monitor aggregator for Storage Services status [available values: min, max or avg] | string | `"max"` | no | +| status\_timeframe | Monitor timeframe for Storage Services status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | successful\_requests\_enabled | Flag to enable Storage sucessful requests monitor | string | `"true"` | no | -| successful\_requests\_extra\_tags | Extra tags for Storage sucessful requests monitor | list(string) | `[]` | no | +| successful\_requests\_extra\_tags | Extra tags for Storage sucessful requests monitor | list | `[]` | no | | successful\_requests\_message | Custom message for Storage sucessful requests monitor | string | `""` | no | -| successful\_requests\_threshold\_critical | Minimum acceptable percent of successful requests for a storage | string | `"10"` | no | -| successful\_requests\_threshold\_warning | Warning regarding acceptable percent of successful requests for a storage | string | `"30"` | no | +| successful\_requests\_silenced | Groups to mute for Storage sucessful requests monitor | map | `{}` | no | | successful\_requests\_time\_aggregator | Monitor aggregator for Storage sucessful requests [available values: min, max or avg] | string | `"max"` | no | | successful\_requests\_timeframe | Monitor timeframe for Storage sucessful requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | +| successful\_storage\_requests\_threshold\_critical | Minimum acceptable percent of successful requests for a storage | string | `"90"` | no | +| successful\_storage\_requests\_threshold\_warning | Warning regarding acceptable percent of successful requests for a storage | string | `"70"` | no | | throttling\_error\_requests\_enabled | Flag to enable Storage throttling error monitor | string | `"true"` | no | -| throttling\_error\_requests\_extra\_tags | Extra tags for Storage throttling error monitor | list(string) | `[]` | no | +| throttling\_error\_requests\_extra\_tags | Extra tags for Storage throttling error monitor | list | `[]` | no | | throttling\_error\_requests\_message | Custom message for Storage throttling error monitor | string | `""` | no | +| throttling\_error\_requests\_silenced | Groups to mute for Storage throttling error monitor | map | `{}` | no | | throttling\_error\_requests\_threshold\_critical | Maximum acceptable percent of throttling error requests for a storage | string | `"90"` | no | | throttling\_error\_requests\_threshold\_warning | Warning regarding acceptable percent of throttling error requests for a storage | string | `"50"` | no | | throttling\_error\_requests\_time\_aggregator | Monitor aggregator for Storage throttling errors [available values: min, max or avg] | string | `"min"` | no | | throttling\_error\_requests\_timeframe | Monitor timeframe for Storage throttling errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | timeout\_error\_requests\_enabled | Flag to enable Storage timeout monitor | string | `"true"` | no | -| timeout\_error\_requests\_extra\_tags | Extra tags for Storage timeout monitor | list(string) | `[]` | no | +| timeout\_error\_requests\_extra\_tags | Extra tags for Storage timeout monitor | list | `[]` | no | | timeout\_error\_requests\_message | Custom message for Storage timeout monitor | string | `""` | no | +| timeout\_error\_requests\_silenced | Groups to mute for Storage timeout monitor | map | `{}` | no | | timeout\_error\_requests\_threshold\_critical | Maximum acceptable percent of timeout error requests for a storage | string | `"90"` | no | | timeout\_error\_requests\_threshold\_warning | Warning regarding acceptable percent of timeout error requests for a storage | string | `"50"` | no | | timeout\_error\_requests\_time\_aggregator | Monitor aggregator for Storage timeout [available values: min, max or avg] | string | `"min"` | no | @@ -106,15 +149,43 @@ Creates DataDog monitors with the following checks: | Name | Description | |------|-------------| -| authorization\_error\_requests\_id | id for monitor authorization_error_requests | -| availability\_id | id for monitor availability | -| client\_other\_error\_requests\_id | id for monitor client_other_error_requests | -| latency\_id | id for monitor latency | -| network\_error\_requests\_id | id for monitor network_error_requests | -| server\_other\_error\_requests\_id | id for monitor server_other_error_requests | -| successful\_requests\_id | id for monitor successful_requests | -| throttling\_error\_requests\_id | id for monitor throttling_error_requests | -| timeout\_error\_requests\_id | id for monitor timeout_error_requests | +| blob\_authorization\_error\_requests\_id | id for monitor blob_authorization_error_requests | +| blob\_client\_other\_error\_requests\_id | id for monitor blob_client_other_error_requests | +| blob\_network\_error\_requests\_id | id for monitor blob_network_error_requests | +| blob\_server\_other\_error\_requests\_id | id for monitor blob_server_other_error_requests | +| blob\_throttling\_error\_requests\_id | id for monitor blob_throttling_error_requests | +| blob\_timeout\_error\_requests\_id | id for monitor blob_timeout_error_requests | +| blobservices\_availability\_id | id for monitor blobservices_availability | +| blobservices\_latency\_id | id for monitor blobservices_latency | +| blobservices\_requests\_error\_id | id for monitor blobservices_requests_error | +| file\_authorization\_error\_requests\_id | id for monitor file_authorization_error_requests | +| file\_client\_other\_error\_requests\_id | id for monitor file_client_other_error_requests | +| file\_network\_error\_requests\_id | id for monitor file_network_error_requests | +| file\_server\_other\_error\_requests\_id | id for monitor file_server_other_error_requests | +| file\_throttling\_error\_requests\_id | id for monitor file_throttling_error_requests | +| file\_timeout\_error\_requests\_id | id for monitor file_timeout_error_requests | +| fileservices\_availability\_id | id for monitor fileservices_availability | +| fileservices\_latency\_id | id for monitor fileservices_latency | +| fileservices\_requests\_error\_id | id for monitor fileservices_requests_error | +| queue\_authorization\_error\_requests\_id | id for monitor queue_authorization_error_requests | +| queue\_client\_other\_error\_requests\_id | id for monitor queue_client_other_error_requests | +| queue\_network\_error\_requests\_id | id for monitor queue_network_error_requests | +| queue\_server\_other\_error\_requests\_id | id for monitor queue_server_other_error_requests | +| queue\_throttling\_error\_requests\_id | id for monitor queue_throttling_error_requests | +| queue\_timeout\_error\_requests\_id | id for monitor queue_timeout_error_requests | +| queueservices\_availability\_id | id for monitor queueservices_availability | +| queueservices\_latency\_id | id for monitor queueservices_latency | +| queueservices\_requests\_error\_id | id for monitor queueservices_requests_error | +| storage\_status\_id | id for monitor storage_status | +| table\_authorization\_error\_requests\_id | id for monitor table_authorization_error_requests | +| table\_availability\_id | id for monitor table_availability | +| table\_client\_other\_error\_requests\_id | id for monitor table_client_other_error_requests | +| table\_network\_error\_requests\_id | id for monitor table_network_error_requests | +| table\_server\_other\_error\_requests\_id | id for monitor table_server_other_error_requests | +| table\_throttling\_error\_requests\_id | id for monitor table_throttling_error_requests | +| table\_timeout\_error\_requests\_id | id for monitor table_timeout_error_requests | +| tableservices\_latency\_id | id for monitor tableservices_latency | +| tableservices\_requests\_error\_id | id for monitor tableservices_requests_error | ## Related documentation diff --git a/cloud/azure/storage/inputs.tf b/cloud/azure/storage/inputs.tf index 9f9d73a..035e87f 100644 --- a/cloud/azure/storage/inputs.tf +++ b/cloud/azure/storage/inputs.tf @@ -1,7 +1,7 @@ # Global Terraform variable "environment" { description = "Architecture environment" - type = string + type = "string" } # Global DataDog @@ -40,34 +40,39 @@ variable "filter_tags_custom_excluded" { } # Azure Storage specific variables +variable "availability_silenced" { + description = "Groups to mute for Storage availability monitor" + type = "map" + default = {} +} variable "availability_enabled" { description = "Flag to enable Storage availability monitor" - type = string + type = "string" default = "true" } variable "availability_extra_tags" { description = "Extra tags for Storage availability monitor" - type = list(string) + type = "list" default = [] } variable "availability_message" { description = "Custom message for Storage availability monitor" - type = string + type = "string" default = "" } variable "availability_time_aggregator" { description = "Monitor aggregator for Storage availability [available values: min, max or avg]" - type = string + type = "string" default = "max" } variable "availability_timeframe" { description = "Monitor timeframe for Storage availability [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = string + type = "string" default = "last_5m" } @@ -81,73 +86,85 @@ variable "availability_threshold_warning" { default = 90 } +variable "successful_requests_silenced" { + description = "Groups to mute for Storage sucessful requests monitor" + type = "map" + default = {} +} + variable "successful_requests_enabled" { description = "Flag to enable Storage sucessful requests monitor" - type = string + type = "string" default = "true" } variable "successful_requests_extra_tags" { description = "Extra tags for Storage sucessful requests monitor" - type = list(string) + type = "list" default = [] } variable "successful_requests_message" { description = "Custom message for Storage sucessful requests monitor" - type = string + type = "string" default = "" } variable "successful_requests_time_aggregator" { description = "Monitor aggregator for Storage sucessful requests [available values: min, max or avg]" - type = string + type = "string" default = "max" } variable "successful_requests_timeframe" { description = "Monitor timeframe for Storage sucessful requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = string + type = "string" default = "last_5m" } -variable "successful_requests_threshold_critical" { +variable "successful_storage_requests_threshold_critical" { description = "Minimum acceptable percent of successful requests for a storage" - default = 10 + default = 90 } -variable "successful_requests_threshold_warning" { +variable "successful_storage_requests_threshold_warning" { description = "Warning regarding acceptable percent of successful requests for a storage" - default = 30 + default = 70 +} + +variable "latency_silenced" { + description = "Groups to mute for Storage latency monitor" + type = "map" + default = {} } variable "latency_enabled" { description = "Flag to enable Storage latency monitor" - type = string + type = "string" default = "true" } variable "latency_extra_tags" { description = "Extra tags for Storage latency monitor" - type = list(string) + type = "list" default = [] } variable "latency_message" { description = "Custom message for Storage latency monitor" - type = string + type = "string" default = "" } variable "latency_time_aggregator" { description = "Monitor aggregator for Storage latency [available values: min, max or avg]" - type = string + type = "string" default = "min" } variable "latency_timeframe" { description = "Monitor timeframe for Storage latency [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = string + type = "string" default = "last_5m" } @@ -161,33 +178,39 @@ variable "latency_threshold_warning" { default = 1000 } +variable "timeout_error_requests_silenced" { + description = "Groups to mute for Storage timeout monitor" + type = "map" + default = {} +} + variable "timeout_error_requests_enabled" { description = "Flag to enable Storage timeout monitor" - type = string + type = "string" default = "true" } variable "timeout_error_requests_extra_tags" { description = "Extra tags for Storage timeout monitor" - type = list(string) + type = "list" default = [] } variable "timeout_error_requests_message" { description = "Custom message for Storage timeout monitor" - type = string + type = "string" default = "" } variable "timeout_error_requests_time_aggregator" { description = "Monitor aggregator for Storage timeout [available values: min, max or avg]" - type = string + type = "string" default = "min" } variable "timeout_error_requests_timeframe" { description = "Monitor timeframe for Storage timeout [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = string + type = "string" default = "last_5m" } @@ -201,33 +224,39 @@ variable "timeout_error_requests_threshold_warning" { default = 50 } +variable "network_error_requests_silenced" { + description = "Groups to mute for Storage network errors monitor" + type = "map" + default = {} +} + variable "network_error_requests_enabled" { description = "Flag to enable Storage network errors monitor" - type = string + type = "string" default = "true" } variable "network_error_requests_extra_tags" { description = "Extra tags for Storage network errors monitor" - type = list(string) + type = "list" default = [] } variable "network_error_requests_message" { description = "Custom message for Storage network errors monitor" - type = string + type = "string" default = "" } variable "network_error_requests_time_aggregator" { description = "Monitor aggregator for Storage network errors [available values: min, max or avg]" - type = string + type = "string" default = "min" } variable "network_error_requests_timeframe" { description = "Monitor timeframe for Storage network errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = string + type = "string" default = "last_5m" } @@ -241,33 +270,39 @@ variable "network_error_requests_threshold_warning" { default = 50 } +variable "throttling_error_requests_silenced" { + description = "Groups to mute for Storage throttling error monitor" + type = "map" + default = {} +} + variable "throttling_error_requests_enabled" { description = "Flag to enable Storage throttling error monitor" - type = string + type = "string" default = "true" } variable "throttling_error_requests_extra_tags" { description = "Extra tags for Storage throttling error monitor" - type = list(string) + type = "list" default = [] } variable "throttling_error_requests_message" { description = "Custom message for Storage throttling error monitor" - type = string + type = "string" default = "" } variable "throttling_error_requests_time_aggregator" { description = "Monitor aggregator for Storage throttling errors [available values: min, max or avg]" - type = string + type = "string" default = "min" } variable "throttling_error_requests_timeframe" { description = "Monitor timeframe for Storage throttling errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = string + type = "string" default = "last_5m" } @@ -281,33 +316,39 @@ variable "throttling_error_requests_threshold_warning" { default = 50 } +variable "server_other_error_requests_silenced" { + description = "Groups to mute for Storage server other errors monitor" + type = "map" + default = {} +} + variable "server_other_error_requests_enabled" { description = "Flag to enable Storage server other errors monitor" - type = string + type = "string" default = "true" } variable "server_other_error_requests_extra_tags" { description = "Extra tags for Storage server other errors monitor" - type = list(string) + type = "list" default = [] } variable "server_other_error_requests_message" { description = "Custom message for Storage server other errors monitor" - type = string + type = "string" default = "" } variable "server_other_error_requests_time_aggregator" { description = "Monitor aggregator for Storage other errors [available values: min, max or avg]" - type = string + type = "string" default = "min" } variable "server_other_error_requests_timeframe" { description = "Monitor timeframe for Storage server other errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = string + type = "string" default = "last_5m" } @@ -321,33 +362,39 @@ variable "server_other_error_requests_threshold_warning" { default = 50 } +variable "client_other_error_requests_silenced" { + description = "Groups to mute for Storage other errors monitor" + type = "map" + default = {} +} + variable "client_other_error_requests_enabled" { description = "Flag to enable Storage other errors monitor" - type = string + type = "string" default = "true" } variable "client_other_error_requests_extra_tags" { description = "Extra tags for Storage other errors monitor" - type = list(string) + type = "list" default = [] } variable "client_other_error_requests_message" { description = "Custom message for Storage other errors monitor" - type = string + type = "string" default = "" } variable "client_other_error_requests_time_aggregator" { description = "Monitor aggregator for Storage other errors [available values: min, max or avg]" - type = string + type = "string" default = "min" } variable "client_other_error_requests_timeframe" { description = "Monitor timeframe for Storage other errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = string + type = "string" default = "last_5m" } @@ -361,33 +408,39 @@ variable "client_other_error_requests_threshold_warning" { default = 50 } +variable "authorization_error_requests_silenced" { + description = "Groups to mute for Storage authorization errors monitor" + type = "map" + default = {} +} + variable "authorization_error_requests_enabled" { description = "Flag to enable Storage authorization errors monitor" - type = string + type = "string" default = "true" } variable "authorization_error_requests_extra_tags" { description = "Extra tags for Storage authorization errors monitor" - type = list(string) + type = "list" default = [] } variable "authorization_error_requests_message" { description = "Custom message for Storage authorization errors monitor" - type = string + type = "string" default = "" } variable "authorization_error_requests_time_aggregator" { description = "Monitor aggregator for Storage authorization errors [available values: min, max or avg]" - type = string + type = "string" default = "min" } variable "authorization_error_requests_timeframe" { description = "Monitor timeframe for Storage authorization errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = string + type = "string" default = "last_5m" } @@ -401,3 +454,38 @@ variable "authorization_error_requests_threshold_warning" { default = 50 } +variable "status_time_aggregator" { + description = "Monitor aggregator for Storage Services status [available values: min, max or avg]" + type = "string" + default = "max" +} + +variable "status_timeframe" { + description = "Monitor timeframe for Storage Services status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" + type = "string" + default = "last_5m" +} + +variable "status_enabled" { + description = "Flag to enable App Services status monitor" + type = "string" + default = "true" +} + +variable "status_message" { + description = "Custom message for storage Services status monitor" + type = "string" + default = "" +} + +variable "status_silenced" { + description = "Groups to mute for App Services status monitor" + type = "map" + default = {} +} + +variable "status_extra_tags" { + description = "Extra tags for App Services status monitor" + type = "list" + default = [] +} diff --git a/cloud/azure/storage/modules.tf b/cloud/azure/storage/modules.tf index d60f90d..faf64fa 100644 --- a/cloud/azure/storage/modules.tf +++ b/cloud/azure/storage/modules.tf @@ -1,11 +1,87 @@ module "filter-tags" { source = "../../../common/filter-tags" - environment = var.environment + environment = "${var.environment}" resource = "azure_storage" - filter_tags_use_defaults = var.filter_tags_use_defaults - filter_tags_custom = var.filter_tags_custom - filter_tags_custom_excluded = var.filter_tags_custom_excluded + filter_tags_use_defaults = "${var.filter_tags_use_defaults}" + filter_tags_custom = "${var.filter_tags_custom}" + filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" extra_tags = ["transaction_type:all"] } +module "filter-tags-success" { + source = "../../../common/filter-tags" + + environment = "${var.environment}" + resource = "azure_storage" + filter_tags_use_defaults = "${var.filter_tags_use_defaults}" + filter_tags_custom = "${var.filter_tags_custom}" + filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + extra_tags = ["transaction_type:all,responsetype:success"] +} + +module "filter-tags-timeout-error" { + source = "../../../common/filter-tags" + + environment = "${var.environment}" + resource = "azure_storage" + filter_tags_use_defaults = "${var.filter_tags_use_defaults}" + filter_tags_custom = "${var.filter_tags_custom}" + filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + extra_tags = ["transaction_type:all,responsetype:ServerTimeoutError"] +} + +module "filter-tags-network-error" { + source = "../../../common/filter-tags" + + environment = "${var.environment}" + resource = "azure_storage" + filter_tags_use_defaults = "${var.filter_tags_use_defaults}" + filter_tags_custom = "${var.filter_tags_custom}" + filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + extra_tags = ["transaction_type:all,responsetype:NetworkError"] +} + +module "filter-tags-throttling-error" { + source = "../../../common/filter-tags" + + environment = "${var.environment}" + resource = "azure_storage" + filter_tags_use_defaults = "${var.filter_tags_use_defaults}" + filter_tags_custom = "${var.filter_tags_custom}" + filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + extra_tags = ["transaction_type:all,responsetype:ServerBusyError"] +} + +module "filter-tags-server-other-error" { + source = "../../../common/filter-tags" + + environment = "${var.environment}" + resource = "azure_storage" + filter_tags_use_defaults = "${var.filter_tags_use_defaults}" + filter_tags_custom = "${var.filter_tags_custom}" + filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + extra_tags = ["transaction_type:all,responsetype:ServerOtherError"] +} + +module "filter-tags-client-other-error" { + source = "../../../common/filter-tags" + + environment = "${var.environment}" + resource = "azure_storage" + filter_tags_use_defaults = "${var.filter_tags_use_defaults}" + filter_tags_custom = "${var.filter_tags_custom}" + filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + extra_tags = ["transaction_type:all,responsetype:ClientOtherError"] +} + +module "filter-tags-authorization-error" { + source = "../../../common/filter-tags" + + environment = "${var.environment}" + resource = "azure_storage" + filter_tags_use_defaults = "${var.filter_tags_use_defaults}" + filter_tags_custom = "${var.filter_tags_custom}" + filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + extra_tags = ["transaction_type:all,responsetype:AuthorizationError"] +} diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index a3187cd..9fcd3fa 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -1,306 +1,1223 @@ -resource "datadog_monitor" "availability" { - count = var.availability_enabled == "true" ? 1 : 0 +resource "datadog_monitor" "storage_status" { + count = "${var.status_enabled == "true" ? 1 : 0}" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage is down" - message = coalesce(var.availability_message, var.message) - type = "query alert" + message = "${coalesce(var.status_message, var.message)}" + + query = < ${var.successful_storage_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.successful_storage_requests_threshold_critical}" + warning = "${var.successful_storage_requests_threshold_warning}" + } + + silenced = "${var.successful_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.successful_requests_extra_tags}"] +} + +resource "datadog_monitor" "fileservices_requests_error" { + count = "${var.successful_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage File Service too few successful requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.successful_requests_message, var.message)}" + + query = < ${var.successful_storage_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.successful_storage_requests_threshold_critical}" + warning = "${var.successful_storage_requests_threshold_warning}" + } + + silenced = "${var.successful_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.successful_requests_extra_tags}"] +} + +resource "datadog_monitor" "queueservices_requests_error" { + count = "${var.successful_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Queue Service too few successful requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.successful_requests_message, var.message)}" + + query = < ${var.successful_storage_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.successful_storage_requests_threshold_critical}" + warning = "${var.successful_storage_requests_threshold_warning}" + } + + silenced = "${var.successful_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.successful_requests_extra_tags}"] +} + +resource "datadog_monitor" "tableservices_requests_error" { + count = "${var.successful_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Table Service too few successful requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.successful_requests_message, var.message)}" + + query = < ${var.successful_storage_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.successful_storage_requests_threshold_critical}" + warning = "${var.successful_storage_requests_threshold_warning}" + } + + silenced = "${var.successful_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.successful_requests_extra_tags}"] +} + +resource "datadog_monitor" "blobservices_latency" { + count = "${var.latency_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Blob Service too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" + message = "${coalesce(var.latency_message, var.message)}" + + query = < ${var.latency_threshold_critical} -EOQ + EOQ - thresholds = { - critical = var.latency_threshold_critical - warning = var.latency_threshold_warning + thresholds { + critical = "${var.latency_threshold_critical}" + warning = "${var.latency_threshold_warning}" } - new_host_delay = var.new_host_delay - evaluation_delay = var.evaluation_delay + silenced = "${var.latency_silenced}" + + type = "metric alert" notify_no_data = false notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags) + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.latency_extra_tags}"] +} + +resource "datadog_monitor" "fileservices_latency" { + count = "${var.latency_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage File Service too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" + message = "${coalesce(var.latency_message, var.message)}" + + query = < ${var.latency_threshold_critical} + EOQ + + thresholds { + critical = "${var.latency_threshold_critical}" + warning = "${var.latency_threshold_warning}" + } + + silenced = "${var.latency_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 lifecycle { ignore_changes = ["silenced"] } + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.latency_extra_tags}"] } -resource "datadog_monitor" "timeout_error_requests" { - count = var.timeout_error_requests_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = coalesce(var.timeout_error_requests_message, var.message) - type = "query alert" +resource "datadog_monitor" "queueservices_latency" { + count = "${var.latency_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Queue Service too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" + message = "${coalesce(var.latency_message, var.message)}" -query = < ${var.latency_threshold_critical} + EOQ + + thresholds { + critical = "${var.latency_threshold_critical}" + warning = "${var.latency_threshold_warning}" + } + + silenced = "${var.latency_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + lifecycle { + ignore_changes = ["silenced"] + } + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.latency_extra_tags}"] +} + +resource "datadog_monitor" "tableservices_latency" { + count = "${var.latency_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Table Service too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" + message = "${coalesce(var.latency_message, var.message)}" + + query = < ${var.latency_threshold_critical} + EOQ + + thresholds { + critical = "${var.latency_threshold_critical}" + warning = "${var.latency_threshold_warning}" + } + + silenced = "${var.latency_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + lifecycle { + ignore_changes = ["silenced"] + } + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.latency_extra_tags}"] +} + +resource "datadog_monitor" "blob_timeout_error_requests" { + count = "${var.timeout_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.timeout_error_requests_message, var.message)}" + + query = < ${var.timeout_error_requests_threshold_critical} -EOQ + EOQ - thresholds = { - critical = var.timeout_error_requests_threshold_critical - warning = var.timeout_error_requests_threshold_warning + thresholds { + critical = "${var.timeout_error_requests_threshold_critical}" + warning = "${var.timeout_error_requests_threshold_warning}" } - new_host_delay = var.new_host_delay - evaluation_delay = var.evaluation_delay + silenced = "${var.timeout_error_requests_silenced}" + + type = "metric alert" notify_no_data = false notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.timeout_error_requests_extra_tags) - - lifecycle { - ignore_changes = ["silenced"] - } + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.timeout_error_requests_extra_tags}"] } -resource "datadog_monitor" "network_error_requests" { - count = var.network_error_requests_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = coalesce(var.network_error_requests_message, var.message) - type = "query alert" +resource "datadog_monitor" "file_timeout_error_requests" { + count = "${var.timeout_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.timeout_error_requests_message, var.message)}" + + query = < ${var.timeout_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.timeout_error_requests_threshold_critical}" + warning = "${var.timeout_error_requests_threshold_warning}" + } + + silenced = "${var.timeout_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.timeout_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "queue_timeout_error_requests" { + count = "${var.timeout_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.timeout_error_requests_message, var.message)}" + + query = < ${var.timeout_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.timeout_error_requests_threshold_critical}" + warning = "${var.timeout_error_requests_threshold_warning}" + } + + silenced = "${var.timeout_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.timeout_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "table_timeout_error_requests" { + count = "${var.timeout_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Table Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.timeout_error_requests_message, var.message)}" + + query = < ${var.timeout_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.timeout_error_requests_threshold_critical}" + warning = "${var.timeout_error_requests_threshold_warning}" + } + + silenced = "${var.timeout_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.timeout_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "blob_network_error_requests" { + count = "${var.network_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.network_error_requests_message, var.message)}" query = < ${var.network_error_requests_threshold_critical} -EOQ + EOQ - thresholds = { - critical = var.network_error_requests_threshold_critical - warning = var.network_error_requests_threshold_warning + thresholds { + critical = "${var.network_error_requests_threshold_critical}" + warning = "${var.network_error_requests_threshold_warning}" } - new_host_delay = var.new_host_delay - evaluation_delay = var.evaluation_delay + silenced = "${var.network_error_requests_silenced}" + + type = "metric alert" notify_no_data = false notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.network_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "file_network_error_requests" { + count = "${var.network_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.network_error_requests_message, var.message)}" + + query = < ${var.network_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.network_error_requests_threshold_critical}" + warning = "${var.network_error_requests_threshold_warning}" + } + + silenced = "${var.network_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.network_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "queue_network_error_requests" { + count = "${var.network_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.network_error_requests_message, var.message)}" + + query = < ${var.network_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.network_error_requests_threshold_critical}" + warning = "${var.network_error_requests_threshold_warning}" + } + + silenced = "${var.network_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.network_error_requests_extra_tags) lifecycle { ignore_changes = ["silenced"] } + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.network_error_requests_extra_tags}"] + } -resource "datadog_monitor" "throttling_error_requests" { - count = var.throttling_error_requests_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = coalesce(var.throttling_error_requests_message, var.message) - type = "query alert" +resource "datadog_monitor" "table_network_error_requests" { + count = "${var.network_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Table Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.network_error_requests_message, var.message)}" + + query = < ${var.network_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.network_error_requests_threshold_critical}" + warning = "${var.network_error_requests_threshold_warning}" + } + + silenced = "${var.network_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.network_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "blob_throttling_error_requests" { + count = "${var.throttling_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.throttling_error_requests_message, var.message)}" query = < ${var.throttling_error_requests_threshold_critical} -EOQ + EOQ - thresholds = { - critical = var.throttling_error_requests_threshold_critical - warning = var.throttling_error_requests_threshold_warning + thresholds { + critical = "${var.throttling_error_requests_threshold_critical}" + warning = "${var.throttling_error_requests_threshold_warning}" } - new_host_delay = var.new_host_delay - evaluation_delay = var.evaluation_delay + silenced = "${var.throttling_error_requests_silenced}" + + type = "metric alert" notify_no_data = false notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.throttling_error_requests_extra_tags) - lifecycle { ignore_changes = ["silenced"] } + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.throttling_error_requests_extra_tags}"] } -resource "datadog_monitor" "server_other_error_requests" { - count = var.server_other_error_requests_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = coalesce(var.server_other_error_requests_message, var.message) - type = "query alert" +resource "datadog_monitor" "file_throttling_error_requests" { + count = "${var.throttling_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.throttling_error_requests_message, var.message)}" -query = < ${var.throttling_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.throttling_error_requests_threshold_critical}" + warning = "${var.throttling_error_requests_threshold_warning}" + } + + silenced = "${var.throttling_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.throttling_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "queue_throttling_error_requests" { + count = "${var.throttling_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.throttling_error_requests_message, var.message)}" + + query = < ${var.throttling_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.throttling_error_requests_threshold_critical}" + warning = "${var.throttling_error_requests_threshold_warning}" + } + + silenced = "${var.throttling_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.throttling_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "table_throttling_error_requests" { + count = "${var.throttling_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.throttling_error_requests_message, var.message)}" + + query = < ${var.throttling_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.throttling_error_requests_threshold_critical}" + warning = "${var.throttling_error_requests_threshold_warning}" + } + + silenced = "${var.throttling_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.throttling_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "blob_server_other_error_requests" { + count = "${var.server_other_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.server_other_error_requests_message, var.message)}" + + query = < ${var.server_other_error_requests_threshold_critical} -EOQ + EOQ - thresholds = { - critical = var.server_other_error_requests_threshold_critical - warning = var.server_other_error_requests_threshold_warning + thresholds { + critical = "${var.server_other_error_requests_threshold_critical}" + warning = "${var.server_other_error_requests_threshold_warning}" } - new_host_delay = var.new_host_delay - evaluation_delay = var.evaluation_delay + silenced = "${var.server_other_error_requests_silenced}" + + type = "metric alert" notify_no_data = false notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.server_other_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "file_server_other_error_requests" { + count = "${var.server_other_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.server_other_error_requests_message, var.message)}" + + query = < ${var.server_other_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.server_other_error_requests_threshold_critical}" + warning = "${var.server_other_error_requests_threshold_warning}" + } + + silenced = "${var.server_other_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.server_other_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "queue_server_other_error_requests" { + count = "${var.server_other_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.server_other_error_requests_message, var.message)}" + + query = < ${var.server_other_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.server_other_error_requests_threshold_critical}" + warning = "${var.server_other_error_requests_threshold_warning}" + } + + silenced = "${var.server_other_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.server_other_error_requests_extra_tags) lifecycle { ignore_changes = ["silenced"] } + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.server_other_error_requests_extra_tags}"] } -resource "datadog_monitor" "client_other_error_requests" { - count = var.client_other_error_requests_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = coalesce(var.client_other_error_requests_message, var.message) - type = "query alert" +resource "datadog_monitor" "table_server_other_error_requests" { + count = "${var.server_other_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Table Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.server_other_error_requests_message, var.message)}" -query = < ${var.server_other_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.server_other_error_requests_threshold_critical}" + warning = "${var.server_other_error_requests_threshold_warning}" + } + + silenced = "${var.server_other_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.server_other_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "blob_client_other_error_requests" { + count = "${var.client_other_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.client_other_error_requests_message, var.message)}" + + query = < ${var.client_other_error_requests_threshold_critical} -EOQ + EOQ - thresholds = { - critical = var.client_other_error_requests_threshold_critical - warning = var.client_other_error_requests_threshold_warning + thresholds { + critical = "${var.client_other_error_requests_threshold_critical}" + warning = "${var.client_other_error_requests_threshold_warning}" } - new_host_delay = var.new_host_delay - evaluation_delay = var.evaluation_delay + silenced = "${var.client_other_error_requests_silenced}" + + type = "metric alert" notify_no_data = false notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.client_other_error_requests_extra_tags) + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.client_other_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "file_client_other_error_requests" { + count = "${var.client_other_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.client_other_error_requests_message, var.message)}" + + query = < ${var.client_other_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.client_other_error_requests_threshold_critical}" + warning = "${var.client_other_error_requests_threshold_warning}" + } + + silenced = "${var.client_other_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 lifecycle { ignore_changes = ["silenced"] } + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.client_other_error_requests_extra_tags}"] + } -resource "datadog_monitor" "authorization_error_requests" { - count = var.authorization_error_requests_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = coalesce(var.authorization_error_requests_message, var.message) - type = "query alert" +resource "datadog_monitor" "queue_client_other_error_requests" { + count = "${var.client_other_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.client_other_error_requests_message, var.message)}" + + query = < ${var.client_other_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.client_other_error_requests_threshold_critical}" + warning = "${var.client_other_error_requests_threshold_warning}" + } + + silenced = "${var.client_other_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + lifecycle { + ignore_changes = ["silenced"] + } + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.client_other_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "table_client_other_error_requests" { + count = "${var.client_other_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Table Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.client_other_error_requests_message, var.message)}" + + query = < ${var.client_other_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.client_other_error_requests_threshold_critical}" + warning = "${var.client_other_error_requests_threshold_warning}" + } + + silenced = "${var.client_other_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.client_other_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "blob_authorization_error_requests" { + count = "${var.authorization_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.authorization_error_requests_message, var.message)}" query = < ${var.authorization_error_requests_threshold_critical} -EOQ + EOQ - thresholds = { - critical = var.authorization_error_requests_threshold_critical - warning = var.authorization_error_requests_threshold_warning + thresholds { + critical = "${var.authorization_error_requests_threshold_critical}" + warning = "${var.authorization_error_requests_threshold_warning}" } - new_host_delay = var.new_host_delay - evaluation_delay = var.evaluation_delay + silenced = "${var.authorization_error_requests_silenced}" + + type = "metric alert" notify_no_data = false notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.authorization_error_requests_extra_tags) + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.authorization_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "file_authorization_error_requests" { + count = "${var.authorization_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.authorization_error_requests_message, var.message)}" + + query = < ${var.authorization_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.authorization_error_requests_threshold_critical}" + warning = "${var.authorization_error_requests_threshold_warning}" + } + + silenced = "${var.authorization_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 lifecycle { ignore_changes = ["silenced"] } + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.authorization_error_requests_extra_tags}"] } +resource "datadog_monitor" "queue_authorization_error_requests" { + count = "${var.authorization_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.authorization_error_requests_message, var.message)}" + + query = < ${var.authorization_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.authorization_error_requests_threshold_critical}" + warning = "${var.authorization_error_requests_threshold_warning}" + } + + silenced = "${var.authorization_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.authorization_error_requests_extra_tags}"] +} + +resource "datadog_monitor" "table_authorization_error_requests" { + count = "${var.authorization_error_requests_enabled == "true" ? 1 : 0}" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Table Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = "${coalesce(var.authorization_error_requests_message, var.message)}" + + query = < ${var.authorization_error_requests_threshold_critical} + EOQ + + thresholds { + critical = "${var.authorization_error_requests_threshold_critical}" + warning = "${var.authorization_error_requests_threshold_warning}" + } + + silenced = "${var.authorization_error_requests_silenced}" + + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = "${var.new_host_delay}" + evaluation_delay = "${var.evaluation_delay}" + renotify_interval = 0 + + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.authorization_error_requests_extra_tags}"] +} diff --git a/cloud/azure/storage/outputs.tf b/cloud/azure/storage/outputs.tf index bc3bb1a..880acf1 100644 --- a/cloud/azure/storage/outputs.tf +++ b/cloud/azure/storage/outputs.tf @@ -1,45 +1,184 @@ -output "availability_id" { - description = "id for monitor availability" - value = datadog_monitor.availability.*.id +output "storage_status_id" { + description = "id for monitor storage_status" + value = "${datadog_monitor.storage_status.*.id}" } -output "successful_requests_id" { - description = "id for monitor successful_requests" - value = datadog_monitor.successful_requests.*.id +output "blobservices_availability_id" { + description = "id for monitor blobservices_availability" + value = "${datadog_monitor.blobservices_availability.*.id}" } -output "latency_id" { - description = "id for monitor latency" - value = datadog_monitor.latency.*.id +output "fileservices_availability_id" { + description = "id for monitor fileservices_availability" + value = "${datadog_monitor.fileservices_availability.*.id}" } -output "timeout_error_requests_id" { - description = "id for monitor timeout_error_requests" - value = datadog_monitor.timeout_error_requests.*.id +output "queueservices_availability_id" { + description = "id for monitor queueservices_availability" + value = "${datadog_monitor.queueservices_availability.*.id}" } -output "network_error_requests_id" { - description = "id for monitor network_error_requests" - value = datadog_monitor.network_error_requests.*.id +output "table_availability_id" { + description = "id for monitor table_availability" + value = "${datadog_monitor.table_availability.*.id}" } -output "throttling_error_requests_id" { - description = "id for monitor throttling_error_requests" - value = datadog_monitor.throttling_error_requests.*.id +output "blobservices_requests_error_id" { + description = "id for monitor blobservices_requests_error" + value = "${datadog_monitor.blobservices_requests_error.*.id}" } -output "server_other_error_requests_id" { - description = "id for monitor server_other_error_requests" - value = datadog_monitor.server_other_error_requests.*.id +output "fileservices_requests_error_id" { + description = "id for monitor fileservices_requests_error" + value = "${datadog_monitor.fileservices_requests_error.*.id}" } -output "client_other_error_requests_id" { - description = "id for monitor client_other_error_requests" - value = datadog_monitor.client_other_error_requests.*.id +output "queueservices_requests_error_id" { + description = "id for monitor queueservices_requests_error" + value = "${datadog_monitor.queueservices_requests_error.*.id}" } -output "authorization_error_requests_id" { - description = "id for monitor authorization_error_requests" - value = datadog_monitor.authorization_error_requests.*.id +output "tableservices_requests_error_id" { + description = "id for monitor tableservices_requests_error" + value = "${datadog_monitor.tableservices_requests_error.*.id}" } +output "blobservices_latency_id" { + description = "id for monitor blobservices_latency" + value = "${datadog_monitor.blobservices_latency.*.id}" +} + +output "fileservices_latency_id" { + description = "id for monitor fileservices_latency" + value = "${datadog_monitor.fileservices_latency.*.id}" +} + +output "queueservices_latency_id" { + description = "id for monitor queueservices_latency" + value = "${datadog_monitor.queueservices_latency.*.id}" +} + +output "tableservices_latency_id" { + description = "id for monitor tableservices_latency" + value = "${datadog_monitor.tableservices_latency.*.id}" +} + +output "blob_timeout_error_requests_id" { + description = "id for monitor blob_timeout_error_requests" + value = "${datadog_monitor.blob_timeout_error_requests.*.id}" +} + +output "file_timeout_error_requests_id" { + description = "id for monitor file_timeout_error_requests" + value = "${datadog_monitor.file_timeout_error_requests.*.id}" +} + +output "queue_timeout_error_requests_id" { + description = "id for monitor queue_timeout_error_requests" + value = "${datadog_monitor.queue_timeout_error_requests.*.id}" +} + +output "table_timeout_error_requests_id" { + description = "id for monitor table_timeout_error_requests" + value = "${datadog_monitor.table_timeout_error_requests.*.id}" +} + +output "blob_network_error_requests_id" { + description = "id for monitor blob_network_error_requests" + value = "${datadog_monitor.blob_network_error_requests.*.id}" +} + +output "file_network_error_requests_id" { + description = "id for monitor file_network_error_requests" + value = "${datadog_monitor.file_network_error_requests.*.id}" +} + +output "queue_network_error_requests_id" { + description = "id for monitor queue_network_error_requests" + value = "${datadog_monitor.queue_network_error_requests.*.id}" +} + +output "table_network_error_requests_id" { + description = "id for monitor table_network_error_requests" + value = "${datadog_monitor.table_network_error_requests.*.id}" +} + +output "blob_throttling_error_requests_id" { + description = "id for monitor blob_throttling_error_requests" + value = "${datadog_monitor.blob_throttling_error_requests.*.id}" +} + +output "file_throttling_error_requests_id" { + description = "id for monitor file_throttling_error_requests" + value = "${datadog_monitor.file_throttling_error_requests.*.id}" +} + +output "queue_throttling_error_requests_id" { + description = "id for monitor queue_throttling_error_requests" + value = "${datadog_monitor.queue_throttling_error_requests.*.id}" +} + +output "table_throttling_error_requests_id" { + description = "id for monitor table_throttling_error_requests" + value = "${datadog_monitor.table_throttling_error_requests.*.id}" +} + +output "blob_server_other_error_requests_id" { + description = "id for monitor blob_server_other_error_requests" + value = "${datadog_monitor.blob_server_other_error_requests.*.id}" +} + +output "file_server_other_error_requests_id" { + description = "id for monitor file_server_other_error_requests" + value = "${datadog_monitor.file_server_other_error_requests.*.id}" +} + +output "queue_server_other_error_requests_id" { + description = "id for monitor queue_server_other_error_requests" + value = "${datadog_monitor.queue_server_other_error_requests.*.id}" +} + +output "table_server_other_error_requests_id" { + description = "id for monitor table_server_other_error_requests" + value = "${datadog_monitor.table_server_other_error_requests.*.id}" +} + +output "blob_client_other_error_requests_id" { + description = "id for monitor blob_client_other_error_requests" + value = "${datadog_monitor.blob_client_other_error_requests.*.id}" +} + +output "file_client_other_error_requests_id" { + description = "id for monitor file_client_other_error_requests" + value = "${datadog_monitor.file_client_other_error_requests.*.id}" +} + +output "queue_client_other_error_requests_id" { + description = "id for monitor queue_client_other_error_requests" + value = "${datadog_monitor.queue_client_other_error_requests.*.id}" +} + +output "table_client_other_error_requests_id" { + description = "id for monitor table_client_other_error_requests" + value = "${datadog_monitor.table_client_other_error_requests.*.id}" +} + +output "blob_authorization_error_requests_id" { + description = "id for monitor blob_authorization_error_requests" + value = "${datadog_monitor.blob_authorization_error_requests.*.id}" +} + +output "file_authorization_error_requests_id" { + description = "id for monitor file_authorization_error_requests" + value = "${datadog_monitor.file_authorization_error_requests.*.id}" +} + +output "queue_authorization_error_requests_id" { + description = "id for monitor queue_authorization_error_requests" + value = "${datadog_monitor.queue_authorization_error_requests.*.id}" +} + +output "table_authorization_error_requests_id" { + description = "id for monitor table_authorization_error_requests" + value = "${datadog_monitor.table_authorization_error_requests.*.id}" +} From 2d0fff3567bfa5b680a211c7aaeb77b44e85f67e Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Fri, 21 Jun 2019 11:38:18 +0200 Subject: [PATCH 02/17] AZ-97 homogenize case for service --- cloud/azure/storage/README.md | 18 +++++++++--------- cloud/azure/storage/monitors-azure-storage.tf | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cloud/azure/storage/README.md b/cloud/azure/storage/README.md index 466104b..8ef8f37 100644 --- a/cloud/azure/storage/README.md +++ b/cloud/azure/storage/README.md @@ -32,19 +32,19 @@ Creates DataDog monitors with the following checks: - Azure Queue Storage too many network errors - Azure Queue Storage too many server_other errors - Azure Queue Storage too many timeout errors -- Azure Storage Blob Service too few successful requests -- Azure Storage Blob Service too high end to end latency +- Azure Storage Blob service too few successful requests +- Azure Storage Blob service too high end to end latency - Azure Storage Blob services is down -- Azure Storage File Service too few successful requests -- Azure Storage File Service too high end to end latency -- Azure Storage File Services is down +- Azure Storage File service too few successful requests +- Azure Storage File service too high end to end latency +- Azure Storage File services is down - Azure Storage is down - Azure Storage Queue service is down -- Azure Storage Queue Service too few successful requests -- Azure Storage Queue Service too high end to end latency +- Azure Storage Queue service too few successful requests +- Azure Storage Queue service too high end to end latency - Azure Storage Table service is down -- Azure Storage Table Service too few successful requests -- Azure Storage Table Service too high end to end latency +- Azure Storage Table service too few successful requests +- Azure Storage Table service too high end to end latency - Azure Storage too many throttling errors - Azure Storage too many throttling errors - Azure Storage too many throttling errors diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index 9fcd3fa..2c45a9f 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -60,7 +60,7 @@ resource "datadog_monitor" "blobservices_availability" { resource "datadog_monitor" "fileservices_availability" { count = "${var.availability_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage File Services is down" + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage File services is down" message = "${coalesce(var.availability_message, var.message)}" query = < Date: Fri, 19 Jul 2019 11:02:36 +0200 Subject: [PATCH 03/17] AZ-97: Backport and bump to HCL2/tf0.12 --- cloud/azure/storage/inputs.tf | 123 +- cloud/azure/storage/modules.tf | 65 +- cloud/azure/storage/monitors-azure-storage.tf | 1331 +++++++++-------- cloud/azure/storage/outputs.tf | 75 +- cloud/azure/storage/versions.tf | 4 + 5 files changed, 819 insertions(+), 779 deletions(-) create mode 100644 cloud/azure/storage/versions.tf diff --git a/cloud/azure/storage/inputs.tf b/cloud/azure/storage/inputs.tf index 035e87f..f8a1acc 100644 --- a/cloud/azure/storage/inputs.tf +++ b/cloud/azure/storage/inputs.tf @@ -1,7 +1,7 @@ # Global Terraform variable "environment" { description = "Architecture environment" - type = "string" + type = string } # Global DataDog @@ -42,37 +42,37 @@ variable "filter_tags_custom_excluded" { # Azure Storage specific variables variable "availability_silenced" { description = "Groups to mute for Storage availability monitor" - type = "map" + type = map(string) default = {} } variable "availability_enabled" { description = "Flag to enable Storage availability monitor" - type = "string" + type = string default = "true" } variable "availability_extra_tags" { description = "Extra tags for Storage availability monitor" - type = "list" + type = list(string) default = [] } variable "availability_message" { description = "Custom message for Storage availability monitor" - type = "string" + type = string default = "" } variable "availability_time_aggregator" { description = "Monitor aggregator for Storage availability [available values: min, max or avg]" - type = "string" + type = string default = "max" } variable "availability_timeframe" { description = "Monitor timeframe for Storage availability [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = "string" + type = string default = "last_5m" } @@ -88,37 +88,37 @@ variable "availability_threshold_warning" { variable "successful_requests_silenced" { description = "Groups to mute for Storage sucessful requests monitor" - type = "map" + type = map(string) default = {} } variable "successful_requests_enabled" { description = "Flag to enable Storage sucessful requests monitor" - type = "string" + type = string default = "true" } variable "successful_requests_extra_tags" { description = "Extra tags for Storage sucessful requests monitor" - type = "list" + type = list(string) default = [] } variable "successful_requests_message" { description = "Custom message for Storage sucessful requests monitor" - type = "string" + type = string default = "" } variable "successful_requests_time_aggregator" { description = "Monitor aggregator for Storage sucessful requests [available values: min, max or avg]" - type = "string" + type = string default = "max" } variable "successful_requests_timeframe" { description = "Monitor timeframe for Storage sucessful requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = "string" + type = string default = "last_5m" } @@ -134,37 +134,37 @@ variable "successful_storage_requests_threshold_warning" { variable "latency_silenced" { description = "Groups to mute for Storage latency monitor" - type = "map" + type = map(string) default = {} } variable "latency_enabled" { description = "Flag to enable Storage latency monitor" - type = "string" + type = string default = "true" } variable "latency_extra_tags" { description = "Extra tags for Storage latency monitor" - type = "list" + type = list(string) default = [] } variable "latency_message" { description = "Custom message for Storage latency monitor" - type = "string" + type = string default = "" } variable "latency_time_aggregator" { description = "Monitor aggregator for Storage latency [available values: min, max or avg]" - type = "string" + type = string default = "min" } variable "latency_timeframe" { description = "Monitor timeframe for Storage latency [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = "string" + type = string default = "last_5m" } @@ -180,37 +180,37 @@ variable "latency_threshold_warning" { variable "timeout_error_requests_silenced" { description = "Groups to mute for Storage timeout monitor" - type = "map" + type = map(string) default = {} } variable "timeout_error_requests_enabled" { description = "Flag to enable Storage timeout monitor" - type = "string" + type = string default = "true" } variable "timeout_error_requests_extra_tags" { description = "Extra tags for Storage timeout monitor" - type = "list" + type = list(string) default = [] } variable "timeout_error_requests_message" { description = "Custom message for Storage timeout monitor" - type = "string" + type = string default = "" } variable "timeout_error_requests_time_aggregator" { description = "Monitor aggregator for Storage timeout [available values: min, max or avg]" - type = "string" + type = string default = "min" } variable "timeout_error_requests_timeframe" { description = "Monitor timeframe for Storage timeout [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = "string" + type = string default = "last_5m" } @@ -226,37 +226,37 @@ variable "timeout_error_requests_threshold_warning" { variable "network_error_requests_silenced" { description = "Groups to mute for Storage network errors monitor" - type = "map" + type = map(string) default = {} } variable "network_error_requests_enabled" { description = "Flag to enable Storage network errors monitor" - type = "string" + type = string default = "true" } variable "network_error_requests_extra_tags" { description = "Extra tags for Storage network errors monitor" - type = "list" + type = list(string) default = [] } variable "network_error_requests_message" { description = "Custom message for Storage network errors monitor" - type = "string" + type = string default = "" } variable "network_error_requests_time_aggregator" { description = "Monitor aggregator for Storage network errors [available values: min, max or avg]" - type = "string" + type = string default = "min" } variable "network_error_requests_timeframe" { description = "Monitor timeframe for Storage network errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = "string" + type = string default = "last_5m" } @@ -272,37 +272,37 @@ variable "network_error_requests_threshold_warning" { variable "throttling_error_requests_silenced" { description = "Groups to mute for Storage throttling error monitor" - type = "map" + type = map(string) default = {} } variable "throttling_error_requests_enabled" { description = "Flag to enable Storage throttling error monitor" - type = "string" + type = string default = "true" } variable "throttling_error_requests_extra_tags" { description = "Extra tags for Storage throttling error monitor" - type = "list" + type = list(string) default = [] } variable "throttling_error_requests_message" { description = "Custom message for Storage throttling error monitor" - type = "string" + type = string default = "" } variable "throttling_error_requests_time_aggregator" { description = "Monitor aggregator for Storage throttling errors [available values: min, max or avg]" - type = "string" + type = string default = "min" } variable "throttling_error_requests_timeframe" { description = "Monitor timeframe for Storage throttling errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = "string" + type = string default = "last_5m" } @@ -318,37 +318,37 @@ variable "throttling_error_requests_threshold_warning" { variable "server_other_error_requests_silenced" { description = "Groups to mute for Storage server other errors monitor" - type = "map" + type = map(string) default = {} } variable "server_other_error_requests_enabled" { description = "Flag to enable Storage server other errors monitor" - type = "string" + type = string default = "true" } variable "server_other_error_requests_extra_tags" { description = "Extra tags for Storage server other errors monitor" - type = "list" + type = list(string) default = [] } variable "server_other_error_requests_message" { description = "Custom message for Storage server other errors monitor" - type = "string" + type = string default = "" } variable "server_other_error_requests_time_aggregator" { description = "Monitor aggregator for Storage other errors [available values: min, max or avg]" - type = "string" + type = string default = "min" } variable "server_other_error_requests_timeframe" { description = "Monitor timeframe for Storage server other errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = "string" + type = string default = "last_5m" } @@ -364,37 +364,37 @@ variable "server_other_error_requests_threshold_warning" { variable "client_other_error_requests_silenced" { description = "Groups to mute for Storage other errors monitor" - type = "map" + type = map(string) default = {} } variable "client_other_error_requests_enabled" { description = "Flag to enable Storage other errors monitor" - type = "string" + type = string default = "true" } variable "client_other_error_requests_extra_tags" { description = "Extra tags for Storage other errors monitor" - type = "list" + type = list(string) default = [] } variable "client_other_error_requests_message" { description = "Custom message for Storage other errors monitor" - type = "string" + type = string default = "" } variable "client_other_error_requests_time_aggregator" { description = "Monitor aggregator for Storage other errors [available values: min, max or avg]" - type = "string" + type = string default = "min" } variable "client_other_error_requests_timeframe" { description = "Monitor timeframe for Storage other errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = "string" + type = string default = "last_5m" } @@ -410,37 +410,37 @@ variable "client_other_error_requests_threshold_warning" { variable "authorization_error_requests_silenced" { description = "Groups to mute for Storage authorization errors monitor" - type = "map" + type = map(string) default = {} } variable "authorization_error_requests_enabled" { description = "Flag to enable Storage authorization errors monitor" - type = "string" + type = string default = "true" } variable "authorization_error_requests_extra_tags" { description = "Extra tags for Storage authorization errors monitor" - type = "list" + type = list(string) default = [] } variable "authorization_error_requests_message" { description = "Custom message for Storage authorization errors monitor" - type = "string" + type = string default = "" } variable "authorization_error_requests_time_aggregator" { description = "Monitor aggregator for Storage authorization errors [available values: min, max or avg]" - type = "string" + type = string default = "min" } variable "authorization_error_requests_timeframe" { description = "Monitor timeframe for Storage authorization errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = "string" + type = string default = "last_5m" } @@ -456,36 +456,37 @@ variable "authorization_error_requests_threshold_warning" { variable "status_time_aggregator" { description = "Monitor aggregator for Storage Services status [available values: min, max or avg]" - type = "string" + type = string default = "max" } variable "status_timeframe" { description = "Monitor timeframe for Storage Services status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" - type = "string" + type = string default = "last_5m" } variable "status_enabled" { description = "Flag to enable App Services status monitor" - type = "string" + type = string default = "true" } variable "status_message" { description = "Custom message for storage Services status monitor" - type = "string" + type = string default = "" } variable "status_silenced" { description = "Groups to mute for App Services status monitor" - type = "map" + type = map(string) default = {} } variable "status_extra_tags" { description = "Extra tags for App Services status monitor" - type = "list" + type = list(string) default = [] } + diff --git a/cloud/azure/storage/modules.tf b/cloud/azure/storage/modules.tf index faf64fa..4ba508d 100644 --- a/cloud/azure/storage/modules.tf +++ b/cloud/azure/storage/modules.tf @@ -1,87 +1,88 @@ module "filter-tags" { source = "../../../common/filter-tags" - environment = "${var.environment}" + environment = var.environment resource = "azure_storage" - filter_tags_use_defaults = "${var.filter_tags_use_defaults}" - filter_tags_custom = "${var.filter_tags_custom}" - filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + filter_tags_use_defaults = var.filter_tags_use_defaults + filter_tags_custom = var.filter_tags_custom + filter_tags_custom_excluded = var.filter_tags_custom_excluded extra_tags = ["transaction_type:all"] } module "filter-tags-success" { source = "../../../common/filter-tags" - environment = "${var.environment}" + environment = var.environment resource = "azure_storage" - filter_tags_use_defaults = "${var.filter_tags_use_defaults}" - filter_tags_custom = "${var.filter_tags_custom}" - filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + filter_tags_use_defaults = var.filter_tags_use_defaults + filter_tags_custom = var.filter_tags_custom + filter_tags_custom_excluded = var.filter_tags_custom_excluded extra_tags = ["transaction_type:all,responsetype:success"] } module "filter-tags-timeout-error" { source = "../../../common/filter-tags" - environment = "${var.environment}" + environment = var.environment resource = "azure_storage" - filter_tags_use_defaults = "${var.filter_tags_use_defaults}" - filter_tags_custom = "${var.filter_tags_custom}" - filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + filter_tags_use_defaults = var.filter_tags_use_defaults + filter_tags_custom = var.filter_tags_custom + filter_tags_custom_excluded = var.filter_tags_custom_excluded extra_tags = ["transaction_type:all,responsetype:ServerTimeoutError"] } module "filter-tags-network-error" { source = "../../../common/filter-tags" - environment = "${var.environment}" + environment = var.environment resource = "azure_storage" - filter_tags_use_defaults = "${var.filter_tags_use_defaults}" - filter_tags_custom = "${var.filter_tags_custom}" - filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + filter_tags_use_defaults = var.filter_tags_use_defaults + filter_tags_custom = var.filter_tags_custom + filter_tags_custom_excluded = var.filter_tags_custom_excluded extra_tags = ["transaction_type:all,responsetype:NetworkError"] } module "filter-tags-throttling-error" { source = "../../../common/filter-tags" - environment = "${var.environment}" + environment = var.environment resource = "azure_storage" - filter_tags_use_defaults = "${var.filter_tags_use_defaults}" - filter_tags_custom = "${var.filter_tags_custom}" - filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + filter_tags_use_defaults = var.filter_tags_use_defaults + filter_tags_custom = var.filter_tags_custom + filter_tags_custom_excluded = var.filter_tags_custom_excluded extra_tags = ["transaction_type:all,responsetype:ServerBusyError"] } module "filter-tags-server-other-error" { source = "../../../common/filter-tags" - environment = "${var.environment}" + environment = var.environment resource = "azure_storage" - filter_tags_use_defaults = "${var.filter_tags_use_defaults}" - filter_tags_custom = "${var.filter_tags_custom}" - filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + filter_tags_use_defaults = var.filter_tags_use_defaults + filter_tags_custom = var.filter_tags_custom + filter_tags_custom_excluded = var.filter_tags_custom_excluded extra_tags = ["transaction_type:all,responsetype:ServerOtherError"] } module "filter-tags-client-other-error" { source = "../../../common/filter-tags" - environment = "${var.environment}" + environment = var.environment resource = "azure_storage" - filter_tags_use_defaults = "${var.filter_tags_use_defaults}" - filter_tags_custom = "${var.filter_tags_custom}" - filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + filter_tags_use_defaults = var.filter_tags_use_defaults + filter_tags_custom = var.filter_tags_custom + filter_tags_custom_excluded = var.filter_tags_custom_excluded extra_tags = ["transaction_type:all,responsetype:ClientOtherError"] } module "filter-tags-authorization-error" { source = "../../../common/filter-tags" - environment = "${var.environment}" + environment = var.environment resource = "azure_storage" - filter_tags_use_defaults = "${var.filter_tags_use_defaults}" - filter_tags_custom = "${var.filter_tags_custom}" - filter_tags_custom_excluded = "${var.filter_tags_custom_excluded}" + filter_tags_use_defaults = var.filter_tags_use_defaults + filter_tags_custom = var.filter_tags_custom + filter_tags_custom_excluded = var.filter_tags_custom_excluded extra_tags = ["transaction_type:all,responsetype:AuthorizationError"] } + diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index 2c45a9f..c083dc8 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -1,112 +1,116 @@ resource "datadog_monitor" "storage_status" { - count = "${var.status_enabled == "true" ? 1 : 0}" + count = var.status_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage is down" - message = "${coalesce(var.status_message, var.message)}" + message = coalesce(var.status_message, var.message) query = < ${var.successful_storage_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.successful_storage_requests_threshold_critical}" - warning = "${var.successful_storage_requests_threshold_warning}" - } - silenced = "${var.successful_requests_silenced}" +thresholds = { +critical = var.successful_storage_requests_threshold_critical +warning = var.successful_storage_requests_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.successful_requests_silenced - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.successful_requests_extra_tags}"] +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 + +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.successful_requests_extra_tags] } resource "datadog_monitor" "fileservices_requests_error" { - count = "${var.successful_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage File service too few successful requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.successful_requests_message, var.message)}" +count = var.successful_requests_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage File service too few successful requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" +message = coalesce(var.successful_requests_message, var.message) - query = < ${var.successful_storage_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.successful_storage_requests_threshold_critical}" - warning = "${var.successful_storage_requests_threshold_warning}" - } - silenced = "${var.successful_requests_silenced}" +thresholds = { +critical = var.successful_storage_requests_threshold_critical +warning = var.successful_storage_requests_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.successful_requests_silenced - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.successful_requests_extra_tags}"] +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 + +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.successful_requests_extra_tags] } resource "datadog_monitor" "queueservices_requests_error" { - count = "${var.successful_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Queue service too few successful requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.successful_requests_message, var.message)}" +count = var.successful_requests_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Queue service too few successful requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" +message = coalesce(var.successful_requests_message, var.message) - query = < ${var.successful_storage_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.successful_storage_requests_threshold_critical}" - warning = "${var.successful_storage_requests_threshold_warning}" + + thresholds = { + critical = var.successful_storage_requests_threshold_critical + warning = var.successful_storage_requests_threshold_warning } - silenced = "${var.successful_requests_silenced}" + silenced = var.successful_requests_silenced type = "metric alert" notify_no_data = false @@ -246,131 +254,135 @@ resource "datadog_monitor" "queueservices_requests_error" { include_tags = true locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.successful_requests_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.successful_requests_extra_tags] } resource "datadog_monitor" "tableservices_requests_error" { - count = "${var.successful_requests_enabled == "true" ? 1 : 0}" + count = var.successful_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Table service too few successful requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.successful_requests_message, var.message)}" + message = coalesce(var.successful_requests_message, var.message) query = < ${var.successful_storage_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.successful_storage_requests_threshold_critical}" - warning = "${var.successful_storage_requests_threshold_warning}" + + thresholds = { + critical = var.successful_storage_requests_threshold_critical + warning = var.successful_storage_requests_threshold_warning } - silenced = "${var.successful_requests_silenced}" + silenced = var.successful_requests_silenced - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay + renotify_interval = 0 - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.successful_requests_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.successful_requests_extra_tags] } resource "datadog_monitor" "blobservices_latency" { - count = "${var.latency_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Blob service too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" - message = "${coalesce(var.latency_message, var.message)}" + count = var.latency_enabled == "true" ? 1 : 0 + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Blob service too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" + message = coalesce(var.latency_message, var.message) query = < ${var.latency_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.latency_threshold_critical}" - warning = "${var.latency_threshold_warning}" - } - silenced = "${var.latency_silenced}" +thresholds = { +critical = var.latency_threshold_critical +warning = var.latency_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.latency_silenced - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.latency_extra_tags}"] +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 + +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.latency_extra_tags] } resource "datadog_monitor" "fileservices_latency" { - count = "${var.latency_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage File service too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" - message = "${coalesce(var.latency_message, var.message)}" +count = var.latency_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage File service too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" +message = coalesce(var.latency_message, var.message) - query = < ${var.latency_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.latency_threshold_critical}" - warning = "${var.latency_threshold_warning}" - } - silenced = "${var.latency_silenced}" +thresholds = { +critical = var.latency_threshold_critical +warning = var.latency_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.latency_silenced + +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 lifecycle { ignore_changes = ["silenced"] } - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.latency_extra_tags}"] +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.latency_extra_tags] } resource "datadog_monitor" "queueservices_latency" { - count = "${var.latency_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Queue service too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" - message = "${coalesce(var.latency_message, var.message)}" +count = var.latency_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Queue service too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" +message = coalesce(var.latency_message, var.message) - query = < ${var.latency_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.latency_threshold_critical}" - warning = "${var.latency_threshold_warning}" + + thresholds = { + critical = var.latency_threshold_critical + warning = var.latency_threshold_warning } - silenced = "${var.latency_silenced}" + silenced = var.latency_silenced type = "metric alert" notify_no_data = false @@ -379,134 +391,138 @@ resource "datadog_monitor" "queueservices_latency" { include_tags = true locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay renotify_interval = 0 lifecycle { ignore_changes = ["silenced"] } - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.latency_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.latency_extra_tags] } resource "datadog_monitor" "tableservices_latency" { - count = "${var.latency_enabled == "true" ? 1 : 0}" + count = var.latency_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Table service too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" - message = "${coalesce(var.latency_message, var.message)}" + message = coalesce(var.latency_message, var.message) query = < ${var.latency_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.latency_threshold_critical}" - warning = "${var.latency_threshold_warning}" + + thresholds = { + critical = var.latency_threshold_critical + warning = var.latency_threshold_warning } - silenced = "${var.latency_silenced}" + silenced = var.latency_silenced - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay + renotify_interval = 0 lifecycle { ignore_changes = ["silenced"] } - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.latency_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.latency_extra_tags] } resource "datadog_monitor" "blob_timeout_error_requests" { - count = "${var.timeout_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.timeout_error_requests_message, var.message)}" + count = var.timeout_error_requests_enabled == "true" ? 1 : 0 + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = coalesce(var.timeout_error_requests_message, var.message) query = < ${var.timeout_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.timeout_error_requests_threshold_critical}" - warning = "${var.timeout_error_requests_threshold_warning}" - } - silenced = "${var.timeout_error_requests_silenced}" +thresholds = { +critical = var.timeout_error_requests_threshold_critical +warning = var.timeout_error_requests_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.timeout_error_requests_silenced - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.timeout_error_requests_extra_tags}"] +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 + +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.timeout_error_requests_extra_tags] } resource "datadog_monitor" "file_timeout_error_requests" { - count = "${var.timeout_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.timeout_error_requests_message, var.message)}" +count = var.timeout_error_requests_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" +message = coalesce(var.timeout_error_requests_message, var.message) - query = < ${var.timeout_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.timeout_error_requests_threshold_critical}" - warning = "${var.timeout_error_requests_threshold_warning}" - } - silenced = "${var.timeout_error_requests_silenced}" +thresholds = { +critical = var.timeout_error_requests_threshold_critical +warning = var.timeout_error_requests_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.timeout_error_requests_silenced - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.timeout_error_requests_extra_tags}"] +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 + +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.timeout_error_requests_extra_tags] } resource "datadog_monitor" "queue_timeout_error_requests" { - count = "${var.timeout_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.timeout_error_requests_message, var.message)}" +count = var.timeout_error_requests_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" +message = coalesce(var.timeout_error_requests_message, var.message) - query = < ${var.timeout_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.timeout_error_requests_threshold_critical}" - warning = "${var.timeout_error_requests_threshold_warning}" + + thresholds = { + critical = var.timeout_error_requests_threshold_critical + warning = var.timeout_error_requests_threshold_warning } - silenced = "${var.timeout_error_requests_silenced}" + silenced = var.timeout_error_requests_silenced type = "metric alert" notify_no_data = false @@ -515,126 +531,130 @@ resource "datadog_monitor" "queue_timeout_error_requests" { include_tags = true locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.timeout_error_requests_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.timeout_error_requests_extra_tags] } resource "datadog_monitor" "table_timeout_error_requests" { - count = "${var.timeout_error_requests_enabled == "true" ? 1 : 0}" + count = var.timeout_error_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Table Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.timeout_error_requests_message, var.message)}" + message = coalesce(var.timeout_error_requests_message, var.message) query = < ${var.timeout_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.timeout_error_requests_threshold_critical}" - warning = "${var.timeout_error_requests_threshold_warning}" + + thresholds = { + critical = var.timeout_error_requests_threshold_critical + warning = var.timeout_error_requests_threshold_warning } - silenced = "${var.timeout_error_requests_silenced}" + silenced = var.timeout_error_requests_silenced - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay + renotify_interval = 0 - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.timeout_error_requests_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.timeout_error_requests_extra_tags] } resource "datadog_monitor" "blob_network_error_requests" { - count = "${var.network_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.network_error_requests_message, var.message)}" + count = var.network_error_requests_enabled == "true" ? 1 : 0 + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = coalesce(var.network_error_requests_message, var.message) query = < ${var.network_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.network_error_requests_threshold_critical}" - warning = "${var.network_error_requests_threshold_warning}" - } - silenced = "${var.network_error_requests_silenced}" +thresholds = { +critical = var.network_error_requests_threshold_critical +warning = var.network_error_requests_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.network_error_requests_silenced - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.network_error_requests_extra_tags}"] +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 + +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.network_error_requests_extra_tags] } resource "datadog_monitor" "file_network_error_requests" { - count = "${var.network_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.network_error_requests_message, var.message)}" +count = var.network_error_requests_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" +message = coalesce(var.network_error_requests_message, var.message) - query = < ${var.network_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.network_error_requests_threshold_critical}" - warning = "${var.network_error_requests_threshold_warning}" - } - silenced = "${var.network_error_requests_silenced}" +thresholds = { +critical = var.network_error_requests_threshold_critical +warning = var.network_error_requests_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.network_error_requests_silenced - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.network_error_requests_extra_tags}"] +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 + +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.network_error_requests_extra_tags] } resource "datadog_monitor" "queue_network_error_requests" { - count = "${var.network_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.network_error_requests_message, var.message)}" +count = var.network_error_requests_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" +message = coalesce(var.network_error_requests_message, var.message) - query = < ${var.network_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.network_error_requests_threshold_critical}" - warning = "${var.network_error_requests_threshold_warning}" + + thresholds = { + critical = var.network_error_requests_threshold_critical + warning = var.network_error_requests_threshold_warning } - silenced = "${var.network_error_requests_silenced}" + silenced = var.network_error_requests_silenced type = "metric alert" notify_no_data = false @@ -643,136 +663,138 @@ resource "datadog_monitor" "queue_network_error_requests" { include_tags = true locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay renotify_interval = 0 - lifecycle { ignore_changes = ["silenced"] } - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.network_error_requests_extra_tags}"] - + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.network_error_requests_extra_tags] } resource "datadog_monitor" "table_network_error_requests" { - count = "${var.network_error_requests_enabled == "true" ? 1 : 0}" + count = var.network_error_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Table Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.network_error_requests_message, var.message)}" + message = coalesce(var.network_error_requests_message, var.message) query = < ${var.network_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.network_error_requests_threshold_critical}" - warning = "${var.network_error_requests_threshold_warning}" + + thresholds = { + critical = var.network_error_requests_threshold_critical + warning = var.network_error_requests_threshold_warning } - silenced = "${var.network_error_requests_silenced}" + silenced = var.network_error_requests_silenced - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay + renotify_interval = 0 - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.network_error_requests_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.network_error_requests_extra_tags] } resource "datadog_monitor" "blob_throttling_error_requests" { - count = "${var.throttling_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.throttling_error_requests_message, var.message)}" + count = var.throttling_error_requests_enabled == "true" ? 1 : 0 + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = coalesce(var.throttling_error_requests_message, var.message) query = < ${var.throttling_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.throttling_error_requests_threshold_critical}" - warning = "${var.throttling_error_requests_threshold_warning}" - } - silenced = "${var.throttling_error_requests_silenced}" +thresholds = { +critical = var.throttling_error_requests_threshold_critical +warning = var.throttling_error_requests_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.throttling_error_requests_silenced + +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 lifecycle { ignore_changes = ["silenced"] } - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.throttling_error_requests_extra_tags}"] +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.throttling_error_requests_extra_tags] } resource "datadog_monitor" "file_throttling_error_requests" { - count = "${var.throttling_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.throttling_error_requests_message, var.message)}" +count = var.throttling_error_requests_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" +message = coalesce(var.throttling_error_requests_message, var.message) - query = < ${var.throttling_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.throttling_error_requests_threshold_critical}" - warning = "${var.throttling_error_requests_threshold_warning}" - } - silenced = "${var.throttling_error_requests_silenced}" +thresholds = { +critical = var.throttling_error_requests_threshold_critical +warning = var.throttling_error_requests_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.throttling_error_requests_silenced - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.throttling_error_requests_extra_tags}"] +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 + +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.throttling_error_requests_extra_tags] } resource "datadog_monitor" "queue_throttling_error_requests" { - count = "${var.throttling_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.throttling_error_requests_message, var.message)}" +count = var.throttling_error_requests_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" +message = coalesce(var.throttling_error_requests_message, var.message) - query = < ${var.throttling_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.throttling_error_requests_threshold_critical}" - warning = "${var.throttling_error_requests_threshold_warning}" + + thresholds = { + critical = var.throttling_error_requests_threshold_critical + warning = var.throttling_error_requests_threshold_warning } - silenced = "${var.throttling_error_requests_silenced}" + silenced = var.throttling_error_requests_silenced type = "metric alert" notify_no_data = false @@ -781,126 +803,130 @@ resource "datadog_monitor" "queue_throttling_error_requests" { include_tags = true locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.throttling_error_requests_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.throttling_error_requests_extra_tags] } resource "datadog_monitor" "table_throttling_error_requests" { - count = "${var.throttling_error_requests_enabled == "true" ? 1 : 0}" + count = var.throttling_error_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.throttling_error_requests_message, var.message)}" + message = coalesce(var.throttling_error_requests_message, var.message) query = < ${var.throttling_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.throttling_error_requests_threshold_critical}" - warning = "${var.throttling_error_requests_threshold_warning}" + + thresholds = { + critical = var.throttling_error_requests_threshold_critical + warning = var.throttling_error_requests_threshold_warning } - silenced = "${var.throttling_error_requests_silenced}" + silenced = var.throttling_error_requests_silenced - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay + renotify_interval = 0 - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.throttling_error_requests_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.throttling_error_requests_extra_tags] } resource "datadog_monitor" "blob_server_other_error_requests" { - count = "${var.server_other_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.server_other_error_requests_message, var.message)}" + count = var.server_other_error_requests_enabled == "true" ? 1 : 0 + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = coalesce(var.server_other_error_requests_message, var.message) query = < ${var.server_other_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.server_other_error_requests_threshold_critical}" - warning = "${var.server_other_error_requests_threshold_warning}" - } - silenced = "${var.server_other_error_requests_silenced}" +thresholds = { +critical = var.server_other_error_requests_threshold_critical +warning = var.server_other_error_requests_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.server_other_error_requests_silenced - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.server_other_error_requests_extra_tags}"] +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 + +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.server_other_error_requests_extra_tags] } resource "datadog_monitor" "file_server_other_error_requests" { - count = "${var.server_other_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.server_other_error_requests_message, var.message)}" +count = var.server_other_error_requests_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" +message = coalesce(var.server_other_error_requests_message, var.message) - query = < ${var.server_other_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.server_other_error_requests_threshold_critical}" - warning = "${var.server_other_error_requests_threshold_warning}" - } - silenced = "${var.server_other_error_requests_silenced}" +thresholds = { +critical = var.server_other_error_requests_threshold_critical +warning = var.server_other_error_requests_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.server_other_error_requests_silenced - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.server_other_error_requests_extra_tags}"] +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 + +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.server_other_error_requests_extra_tags] } resource "datadog_monitor" "queue_server_other_error_requests" { - count = "${var.server_other_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.server_other_error_requests_message, var.message)}" +count = var.server_other_error_requests_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" +message = coalesce(var.server_other_error_requests_message, var.message) - query = < ${var.server_other_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.server_other_error_requests_threshold_critical}" - warning = "${var.server_other_error_requests_threshold_warning}" + + thresholds = { + critical = var.server_other_error_requests_threshold_critical + warning = var.server_other_error_requests_threshold_warning } - silenced = "${var.server_other_error_requests_silenced}" + silenced = var.server_other_error_requests_silenced type = "metric alert" notify_no_data = false @@ -909,136 +935,138 @@ resource "datadog_monitor" "queue_server_other_error_requests" { include_tags = true locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay renotify_interval = 0 - lifecycle { ignore_changes = ["silenced"] } - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.server_other_error_requests_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.server_other_error_requests_extra_tags] } resource "datadog_monitor" "table_server_other_error_requests" { - count = "${var.server_other_error_requests_enabled == "true" ? 1 : 0}" + count = var.server_other_error_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Table Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.server_other_error_requests_message, var.message)}" + message = coalesce(var.server_other_error_requests_message, var.message) query = < ${var.server_other_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.server_other_error_requests_threshold_critical}" - warning = "${var.server_other_error_requests_threshold_warning}" + + thresholds = { + critical = var.server_other_error_requests_threshold_critical + warning = var.server_other_error_requests_threshold_warning } - silenced = "${var.server_other_error_requests_silenced}" + silenced = var.server_other_error_requests_silenced - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay + renotify_interval = 0 - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.server_other_error_requests_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.server_other_error_requests_extra_tags] } resource "datadog_monitor" "blob_client_other_error_requests" { - count = "${var.client_other_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.client_other_error_requests_message, var.message)}" + count = var.client_other_error_requests_enabled == "true" ? 1 : 0 + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = coalesce(var.client_other_error_requests_message, var.message) query = < ${var.client_other_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.client_other_error_requests_threshold_critical}" - warning = "${var.client_other_error_requests_threshold_warning}" - } - silenced = "${var.client_other_error_requests_silenced}" +thresholds = { +critical = var.client_other_error_requests_threshold_critical +warning = var.client_other_error_requests_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.client_other_error_requests_silenced - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.client_other_error_requests_extra_tags}"] +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 + +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.client_other_error_requests_extra_tags] } resource "datadog_monitor" "file_client_other_error_requests" { - count = "${var.client_other_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.client_other_error_requests_message, var.message)}" +count = var.client_other_error_requests_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" +message = coalesce(var.client_other_error_requests_message, var.message) - query = < ${var.client_other_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.client_other_error_requests_threshold_critical}" - warning = "${var.client_other_error_requests_threshold_warning}" - } - silenced = "${var.client_other_error_requests_silenced}" +thresholds = { +critical = var.client_other_error_requests_threshold_critical +warning = var.client_other_error_requests_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.client_other_error_requests_silenced lifecycle { ignore_changes = ["silenced"] } - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.client_other_error_requests_extra_tags}"] +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.client_other_error_requests_extra_tags] } resource "datadog_monitor" "queue_client_other_error_requests" { - count = "${var.client_other_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.client_other_error_requests_message, var.message)}" +count = var.client_other_error_requests_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" +message = coalesce(var.client_other_error_requests_message, var.message) - query = < ${var.client_other_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.client_other_error_requests_threshold_critical}" - warning = "${var.client_other_error_requests_threshold_warning}" + + thresholds = { + critical = var.client_other_error_requests_threshold_critical + warning = var.client_other_error_requests_threshold_warning } - silenced = "${var.client_other_error_requests_silenced}" + silenced = var.client_other_error_requests_silenced type = "metric alert" notify_no_data = false @@ -1047,134 +1075,138 @@ resource "datadog_monitor" "queue_client_other_error_requests" { include_tags = true locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay renotify_interval = 0 lifecycle { ignore_changes = ["silenced"] } - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.client_other_error_requests_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.client_other_error_requests_extra_tags] } resource "datadog_monitor" "table_client_other_error_requests" { - count = "${var.client_other_error_requests_enabled == "true" ? 1 : 0}" + count = var.client_other_error_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Table Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.client_other_error_requests_message, var.message)}" + message = coalesce(var.client_other_error_requests_message, var.message) query = < ${var.client_other_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.client_other_error_requests_threshold_critical}" - warning = "${var.client_other_error_requests_threshold_warning}" + + thresholds = { + critical = var.client_other_error_requests_threshold_critical + warning = var.client_other_error_requests_threshold_warning } - silenced = "${var.client_other_error_requests_silenced}" + silenced = var.client_other_error_requests_silenced - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay + renotify_interval = 0 - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.client_other_error_requests_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.client_other_error_requests_extra_tags] } resource "datadog_monitor" "blob_authorization_error_requests" { - count = "${var.authorization_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.authorization_error_requests_message, var.message)}" + count = var.authorization_error_requests_enabled == "true" ? 1 : 0 + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + message = coalesce(var.authorization_error_requests_message, var.message) query = < ${var.authorization_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.authorization_error_requests_threshold_critical}" - warning = "${var.authorization_error_requests_threshold_warning}" - } - silenced = "${var.authorization_error_requests_silenced}" +thresholds = { +critical = var.authorization_error_requests_threshold_critical +warning = var.authorization_error_requests_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.authorization_error_requests_silenced - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.authorization_error_requests_extra_tags}"] +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 + +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.authorization_error_requests_extra_tags] } resource "datadog_monitor" "file_authorization_error_requests" { - count = "${var.authorization_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.authorization_error_requests_message, var.message)}" +count = var.authorization_error_requests_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" +message = coalesce(var.authorization_error_requests_message, var.message) - query = < ${var.authorization_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.authorization_error_requests_threshold_critical}" - warning = "${var.authorization_error_requests_threshold_warning}" - } - silenced = "${var.authorization_error_requests_silenced}" +thresholds = { +critical = var.authorization_error_requests_threshold_critical +warning = var.authorization_error_requests_threshold_warning +} - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 +silenced = var.authorization_error_requests_silenced + +type = "metric alert" +notify_no_data = false +notify_audit = false +timeout_h = 0 +include_tags = true +locked = false +require_full_window = false +new_host_delay = var.new_host_delay +evaluation_delay = var.evaluation_delay +renotify_interval = 0 lifecycle { ignore_changes = ["silenced"] } - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.authorization_error_requests_extra_tags}"] +tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.authorization_error_requests_extra_tags] } resource "datadog_monitor" "queue_authorization_error_requests" { - count = "${var.authorization_error_requests_enabled == "true" ? 1 : 0}" - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.authorization_error_requests_message, var.message)}" +count = var.authorization_error_requests_enabled == "true" ? 1 : 0 +name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" +message = coalesce(var.authorization_error_requests_message, var.message) - query = < ${var.authorization_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.authorization_error_requests_threshold_critical}" - warning = "${var.authorization_error_requests_threshold_warning}" + + thresholds = { + critical = var.authorization_error_requests_threshold_critical + warning = var.authorization_error_requests_threshold_warning } - silenced = "${var.authorization_error_requests_silenced}" + silenced = var.authorization_error_requests_silenced type = "metric alert" notify_no_data = false @@ -1183,41 +1215,42 @@ resource "datadog_monitor" "queue_authorization_error_requests" { include_tags = true locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.authorization_error_requests_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.authorization_error_requests_extra_tags] } resource "datadog_monitor" "table_authorization_error_requests" { - count = "${var.authorization_error_requests_enabled == "true" ? 1 : 0}" + count = var.authorization_error_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Table Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" - message = "${coalesce(var.authorization_error_requests_message, var.message)}" + message = coalesce(var.authorization_error_requests_message, var.message) query = < ${var.authorization_error_requests_threshold_critical} - EOQ +EOQ - thresholds { - critical = "${var.authorization_error_requests_threshold_critical}" - warning = "${var.authorization_error_requests_threshold_warning}" + + thresholds = { + critical = var.authorization_error_requests_threshold_critical + warning = var.authorization_error_requests_threshold_warning } - silenced = "${var.authorization_error_requests_silenced}" + silenced = var.authorization_error_requests_silenced - type = "metric alert" - notify_no_data = false - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false require_full_window = false - new_host_delay = "${var.new_host_delay}" - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay + renotify_interval = 0 - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", "${var.authorization_error_requests_extra_tags}"] + tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.authorization_error_requests_extra_tags] } diff --git a/cloud/azure/storage/outputs.tf b/cloud/azure/storage/outputs.tf index 880acf1..8e4c820 100644 --- a/cloud/azure/storage/outputs.tf +++ b/cloud/azure/storage/outputs.tf @@ -1,184 +1,185 @@ output "storage_status_id" { description = "id for monitor storage_status" - value = "${datadog_monitor.storage_status.*.id}" + value = datadog_monitor.storage_status.*.id } output "blobservices_availability_id" { description = "id for monitor blobservices_availability" - value = "${datadog_monitor.blobservices_availability.*.id}" + value = datadog_monitor.blobservices_availability.*.id } output "fileservices_availability_id" { description = "id for monitor fileservices_availability" - value = "${datadog_monitor.fileservices_availability.*.id}" + value = datadog_monitor.fileservices_availability.*.id } output "queueservices_availability_id" { description = "id for monitor queueservices_availability" - value = "${datadog_monitor.queueservices_availability.*.id}" + value = datadog_monitor.queueservices_availability.*.id } output "table_availability_id" { description = "id for monitor table_availability" - value = "${datadog_monitor.table_availability.*.id}" + value = datadog_monitor.table_availability.*.id } output "blobservices_requests_error_id" { description = "id for monitor blobservices_requests_error" - value = "${datadog_monitor.blobservices_requests_error.*.id}" + value = datadog_monitor.blobservices_requests_error.*.id } output "fileservices_requests_error_id" { description = "id for monitor fileservices_requests_error" - value = "${datadog_monitor.fileservices_requests_error.*.id}" + value = datadog_monitor.fileservices_requests_error.*.id } output "queueservices_requests_error_id" { description = "id for monitor queueservices_requests_error" - value = "${datadog_monitor.queueservices_requests_error.*.id}" + value = datadog_monitor.queueservices_requests_error.*.id } output "tableservices_requests_error_id" { description = "id for monitor tableservices_requests_error" - value = "${datadog_monitor.tableservices_requests_error.*.id}" + value = datadog_monitor.tableservices_requests_error.*.id } output "blobservices_latency_id" { description = "id for monitor blobservices_latency" - value = "${datadog_monitor.blobservices_latency.*.id}" + value = datadog_monitor.blobservices_latency.*.id } output "fileservices_latency_id" { description = "id for monitor fileservices_latency" - value = "${datadog_monitor.fileservices_latency.*.id}" + value = datadog_monitor.fileservices_latency.*.id } output "queueservices_latency_id" { description = "id for monitor queueservices_latency" - value = "${datadog_monitor.queueservices_latency.*.id}" + value = datadog_monitor.queueservices_latency.*.id } output "tableservices_latency_id" { description = "id for monitor tableservices_latency" - value = "${datadog_monitor.tableservices_latency.*.id}" + value = datadog_monitor.tableservices_latency.*.id } output "blob_timeout_error_requests_id" { description = "id for monitor blob_timeout_error_requests" - value = "${datadog_monitor.blob_timeout_error_requests.*.id}" + value = datadog_monitor.blob_timeout_error_requests.*.id } output "file_timeout_error_requests_id" { description = "id for monitor file_timeout_error_requests" - value = "${datadog_monitor.file_timeout_error_requests.*.id}" + value = datadog_monitor.file_timeout_error_requests.*.id } output "queue_timeout_error_requests_id" { description = "id for monitor queue_timeout_error_requests" - value = "${datadog_monitor.queue_timeout_error_requests.*.id}" + value = datadog_monitor.queue_timeout_error_requests.*.id } output "table_timeout_error_requests_id" { description = "id for monitor table_timeout_error_requests" - value = "${datadog_monitor.table_timeout_error_requests.*.id}" + value = datadog_monitor.table_timeout_error_requests.*.id } output "blob_network_error_requests_id" { description = "id for monitor blob_network_error_requests" - value = "${datadog_monitor.blob_network_error_requests.*.id}" + value = datadog_monitor.blob_network_error_requests.*.id } output "file_network_error_requests_id" { description = "id for monitor file_network_error_requests" - value = "${datadog_monitor.file_network_error_requests.*.id}" + value = datadog_monitor.file_network_error_requests.*.id } output "queue_network_error_requests_id" { description = "id for monitor queue_network_error_requests" - value = "${datadog_monitor.queue_network_error_requests.*.id}" + value = datadog_monitor.queue_network_error_requests.*.id } output "table_network_error_requests_id" { description = "id for monitor table_network_error_requests" - value = "${datadog_monitor.table_network_error_requests.*.id}" + value = datadog_monitor.table_network_error_requests.*.id } output "blob_throttling_error_requests_id" { description = "id for monitor blob_throttling_error_requests" - value = "${datadog_monitor.blob_throttling_error_requests.*.id}" + value = datadog_monitor.blob_throttling_error_requests.*.id } output "file_throttling_error_requests_id" { description = "id for monitor file_throttling_error_requests" - value = "${datadog_monitor.file_throttling_error_requests.*.id}" + value = datadog_monitor.file_throttling_error_requests.*.id } output "queue_throttling_error_requests_id" { description = "id for monitor queue_throttling_error_requests" - value = "${datadog_monitor.queue_throttling_error_requests.*.id}" + value = datadog_monitor.queue_throttling_error_requests.*.id } output "table_throttling_error_requests_id" { description = "id for monitor table_throttling_error_requests" - value = "${datadog_monitor.table_throttling_error_requests.*.id}" + value = datadog_monitor.table_throttling_error_requests.*.id } output "blob_server_other_error_requests_id" { description = "id for monitor blob_server_other_error_requests" - value = "${datadog_monitor.blob_server_other_error_requests.*.id}" + value = datadog_monitor.blob_server_other_error_requests.*.id } output "file_server_other_error_requests_id" { description = "id for monitor file_server_other_error_requests" - value = "${datadog_monitor.file_server_other_error_requests.*.id}" + value = datadog_monitor.file_server_other_error_requests.*.id } output "queue_server_other_error_requests_id" { description = "id for monitor queue_server_other_error_requests" - value = "${datadog_monitor.queue_server_other_error_requests.*.id}" + value = datadog_monitor.queue_server_other_error_requests.*.id } output "table_server_other_error_requests_id" { description = "id for monitor table_server_other_error_requests" - value = "${datadog_monitor.table_server_other_error_requests.*.id}" + value = datadog_monitor.table_server_other_error_requests.*.id } output "blob_client_other_error_requests_id" { description = "id for monitor blob_client_other_error_requests" - value = "${datadog_monitor.blob_client_other_error_requests.*.id}" + value = datadog_monitor.blob_client_other_error_requests.*.id } output "file_client_other_error_requests_id" { description = "id for monitor file_client_other_error_requests" - value = "${datadog_monitor.file_client_other_error_requests.*.id}" + value = datadog_monitor.file_client_other_error_requests.*.id } output "queue_client_other_error_requests_id" { description = "id for monitor queue_client_other_error_requests" - value = "${datadog_monitor.queue_client_other_error_requests.*.id}" + value = datadog_monitor.queue_client_other_error_requests.*.id } output "table_client_other_error_requests_id" { description = "id for monitor table_client_other_error_requests" - value = "${datadog_monitor.table_client_other_error_requests.*.id}" + value = datadog_monitor.table_client_other_error_requests.*.id } output "blob_authorization_error_requests_id" { description = "id for monitor blob_authorization_error_requests" - value = "${datadog_monitor.blob_authorization_error_requests.*.id}" + value = datadog_monitor.blob_authorization_error_requests.*.id } output "file_authorization_error_requests_id" { description = "id for monitor file_authorization_error_requests" - value = "${datadog_monitor.file_authorization_error_requests.*.id}" + value = datadog_monitor.file_authorization_error_requests.*.id } output "queue_authorization_error_requests_id" { description = "id for monitor queue_authorization_error_requests" - value = "${datadog_monitor.queue_authorization_error_requests.*.id}" + value = datadog_monitor.queue_authorization_error_requests.*.id } output "table_authorization_error_requests_id" { description = "id for monitor table_authorization_error_requests" - value = "${datadog_monitor.table_authorization_error_requests.*.id}" + value = datadog_monitor.table_authorization_error_requests.*.id } + diff --git a/cloud/azure/storage/versions.tf b/cloud/azure/storage/versions.tf new file mode 100644 index 0000000..ac97c6a --- /dev/null +++ b/cloud/azure/storage/versions.tf @@ -0,0 +1,4 @@ + +terraform { + required_version = ">= 0.12" +} From 8d0ff1cd486b2761a8abbe08b5b1d46b2b6d875c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Respaut?= Date: Fri, 19 Jul 2019 11:31:08 +0200 Subject: [PATCH 04/17] AZ-97: Auto-update with CI scripts --- cloud/azure/storage/README.md | 80 +- cloud/azure/storage/monitors-azure-storage.tf | 722 +++++++++--------- 2 files changed, 392 insertions(+), 410 deletions(-) diff --git a/cloud/azure/storage/README.md b/cloud/azure/storage/README.md index 8ef8f37..ae40173 100644 --- a/cloud/azure/storage/README.md +++ b/cloud/azure/storage/README.md @@ -6,8 +6,8 @@ module "datadog-monitors-cloud-azure-storage" { source = "git::ssh://git@git.fr.clara.net/claranet/pt-monitoring/projects/datadog/terraform/monitors.git//cloud/azure/storage?ref={revision}" - environment = "${var.environment}" - message = "${module.datadog-message-alerting.alerting-message}" + environment = var.environment + message = module.datadog-message-alerting.alerting-message } ``` @@ -16,68 +16,50 @@ module "datadog-monitors-cloud-azure-storage" { Creates DataDog monitors with the following checks: -- Azure Blob Storage too many authorization errors -- Azure Blob Storage too many client_other errors -- Azure Blob Storage too many network errors -- Azure Blob Storage too many server_other errors -- Azure Blob Storage too many throttling errors -- Azure Blob Storage too many timeout errors -- Azure File Storage too many authorization errors -- Azure File Storage too many client_other errors -- Azure File Storage too many network errors -- Azure File Storage too many server_other errors -- Azure File Storage too many timeout errors -- Azure Queue Storage too many authorization errors -- Azure Queue Storage too many client_other errors -- Azure Queue Storage too many network errors -- Azure Queue Storage too many server_other errors -- Azure Queue Storage too many timeout errors -- Azure Storage Blob service too few successful requests -- Azure Storage Blob service too high end to end latency -- Azure Storage Blob services is down -- Azure Storage File service too few successful requests -- Azure Storage File service too high end to end latency -- Azure Storage File services is down - Azure Storage is down -- Azure Storage Queue service is down -- Azure Storage Queue service too few successful requests -- Azure Storage Queue service too high end to end latency - Azure Storage Table service is down - Azure Storage Table service too few successful requests - Azure Storage Table service too high end to end latency - Azure Storage too many throttling errors -- Azure Storage too many throttling errors -- Azure Storage too many throttling errors - Azure Table Storage too many authorization errors - Azure Table Storage too many client_other errors - Azure Table Storage too many network errors - Azure Table Storage too many server_other errors - Azure Table Storage too many timeout errors +- Azure Blob Storage too many authorization errors +- Azure Blob Storage too many client_other errors +- Azure Blob Storage too many network errors +- Azure Blob Storage too many server_other errors +- Azure Blob Storage too many throttling errors +- Azure Blob Storage too many timeout errors +- Azure Storage Blob service too few successful requests +- Azure Storage Blob service too high end to end latency +- Azure Storage Blob services is down ## Inputs | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| | authorization\_error\_requests\_enabled | Flag to enable Storage authorization errors monitor | string | `"true"` | no | -| authorization\_error\_requests\_extra\_tags | Extra tags for Storage authorization errors monitor | list | `[]` | no | +| authorization\_error\_requests\_extra\_tags | Extra tags for Storage authorization errors monitor | list(string) | `[]` | no | | authorization\_error\_requests\_message | Custom message for Storage authorization errors monitor | string | `""` | no | -| authorization\_error\_requests\_silenced | Groups to mute for Storage authorization errors monitor | map | `{}` | no | +| authorization\_error\_requests\_silenced | Groups to mute for Storage authorization errors monitor | map(string) | `{}` | no | | authorization\_error\_requests\_threshold\_critical | Maximum acceptable percent of authorization error requests for a storage | string | `"90"` | no | | authorization\_error\_requests\_threshold\_warning | Warning regarding acceptable percent of authorization error requests for a storage | string | `"50"` | no | | authorization\_error\_requests\_time\_aggregator | Monitor aggregator for Storage authorization errors [available values: min, max or avg] | string | `"min"` | no | | authorization\_error\_requests\_timeframe | Monitor timeframe for Storage authorization errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | availability\_enabled | Flag to enable Storage availability monitor | string | `"true"` | no | -| availability\_extra\_tags | Extra tags for Storage availability monitor | list | `[]` | no | +| availability\_extra\_tags | Extra tags for Storage availability monitor | list(string) | `[]` | no | | availability\_message | Custom message for Storage availability monitor | string | `""` | no | -| availability\_silenced | Groups to mute for Storage availability monitor | map | `{}` | no | +| availability\_silenced | Groups to mute for Storage availability monitor | map(string) | `{}` | no | | availability\_threshold\_critical | Minimum acceptable percent of availability for a storage | string | `"50"` | no | | availability\_threshold\_warning | Warning regarding acceptable percent of availability for a storage | string | `"90"` | no | | availability\_time\_aggregator | Monitor aggregator for Storage availability [available values: min, max or avg] | string | `"max"` | no | | availability\_timeframe | Monitor timeframe for Storage availability [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | client\_other\_error\_requests\_enabled | Flag to enable Storage other errors monitor | string | `"true"` | no | -| client\_other\_error\_requests\_extra\_tags | Extra tags for Storage other errors monitor | list | `[]` | no | +| client\_other\_error\_requests\_extra\_tags | Extra tags for Storage other errors monitor | list(string) | `[]` | no | | client\_other\_error\_requests\_message | Custom message for Storage other errors monitor | string | `""` | no | -| client\_other\_error\_requests\_silenced | Groups to mute for Storage other errors monitor | map | `{}` | no | +| client\_other\_error\_requests\_silenced | Groups to mute for Storage other errors monitor | map(string) | `{}` | no | | client\_other\_error\_requests\_threshold\_critical | Maximum acceptable percent of client other error requests for a storage | string | `"90"` | no | | client\_other\_error\_requests\_threshold\_warning | Warning regarding acceptable percent of client other error requests for a storage | string | `"50"` | no | | client\_other\_error\_requests\_time\_aggregator | Monitor aggregator for Storage other errors [available values: min, max or avg] | string | `"min"` | no | @@ -88,18 +70,18 @@ Creates DataDog monitors with the following checks: | filter\_tags\_custom\_excluded | Tags excluded for custom filtering when filter_tags_use_defaults is false | string | `""` | no | | filter\_tags\_use\_defaults | Use default filter tags convention | string | `"true"` | no | | latency\_enabled | Flag to enable Storage latency monitor | string | `"true"` | no | -| latency\_extra\_tags | Extra tags for Storage latency monitor | list | `[]` | no | +| latency\_extra\_tags | Extra tags for Storage latency monitor | list(string) | `[]` | no | | latency\_message | Custom message for Storage latency monitor | string | `""` | no | -| latency\_silenced | Groups to mute for Storage latency monitor | map | `{}` | no | +| latency\_silenced | Groups to mute for Storage latency monitor | map(string) | `{}` | no | | latency\_threshold\_critical | Maximum acceptable end to end latency (ms) for a storage | string | `"2000"` | no | | latency\_threshold\_warning | Warning regarding acceptable end to end latency (ms) for a storage | string | `"1000"` | no | | latency\_time\_aggregator | Monitor aggregator for Storage latency [available values: min, max or avg] | string | `"min"` | no | | latency\_timeframe | Monitor timeframe for Storage latency [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | message | Message sent when a Redis monitor is triggered | string | n/a | yes | | network\_error\_requests\_enabled | Flag to enable Storage network errors monitor | string | `"true"` | no | -| network\_error\_requests\_extra\_tags | Extra tags for Storage network errors monitor | list | `[]` | no | +| network\_error\_requests\_extra\_tags | Extra tags for Storage network errors monitor | list(string) | `[]` | no | | network\_error\_requests\_message | Custom message for Storage network errors monitor | string | `""` | no | -| network\_error\_requests\_silenced | Groups to mute for Storage network errors monitor | map | `{}` | no | +| network\_error\_requests\_silenced | Groups to mute for Storage network errors monitor | map(string) | `{}` | no | | network\_error\_requests\_threshold\_critical | Maximum acceptable percent of network error requests for a storage | string | `"90"` | no | | network\_error\_requests\_threshold\_warning | Warning regarding acceptable percent of network error requests for a storage | string | `"50"` | no | | network\_error\_requests\_time\_aggregator | Monitor aggregator for Storage network errors [available values: min, max or avg] | string | `"min"` | no | @@ -107,39 +89,39 @@ Creates DataDog monitors with the following checks: | new\_host\_delay | Delay in seconds before monitor new resource | string | `"300"` | no | | prefix\_slug | Prefix string to prepend between brackets on every monitors names | string | `""` | no | | server\_other\_error\_requests\_enabled | Flag to enable Storage server other errors monitor | string | `"true"` | no | -| server\_other\_error\_requests\_extra\_tags | Extra tags for Storage server other errors monitor | list | `[]` | no | +| server\_other\_error\_requests\_extra\_tags | Extra tags for Storage server other errors monitor | list(string) | `[]` | no | | server\_other\_error\_requests\_message | Custom message for Storage server other errors monitor | string | `""` | no | -| server\_other\_error\_requests\_silenced | Groups to mute for Storage server other errors monitor | map | `{}` | no | +| server\_other\_error\_requests\_silenced | Groups to mute for Storage server other errors monitor | map(string) | `{}` | no | | server\_other\_error\_requests\_threshold\_critical | Maximum acceptable percent of server other error requests for a storage | string | `"90"` | no | | server\_other\_error\_requests\_threshold\_warning | Warning regarding acceptable percent of server other error requests for a storage | string | `"50"` | no | | server\_other\_error\_requests\_time\_aggregator | Monitor aggregator for Storage other errors [available values: min, max or avg] | string | `"min"` | no | | server\_other\_error\_requests\_timeframe | Monitor timeframe for Storage server other errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | status\_enabled | Flag to enable App Services status monitor | string | `"true"` | no | -| status\_extra\_tags | Extra tags for App Services status monitor | list | `[]` | no | +| status\_extra\_tags | Extra tags for App Services status monitor | list(string) | `[]` | no | | status\_message | Custom message for storage Services status monitor | string | `""` | no | -| status\_silenced | Groups to mute for App Services status monitor | map | `{}` | no | +| status\_silenced | Groups to mute for App Services status monitor | map(string) | `{}` | no | | status\_time\_aggregator | Monitor aggregator for Storage Services status [available values: min, max or avg] | string | `"max"` | no | | status\_timeframe | Monitor timeframe for Storage Services status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | successful\_requests\_enabled | Flag to enable Storage sucessful requests monitor | string | `"true"` | no | -| successful\_requests\_extra\_tags | Extra tags for Storage sucessful requests monitor | list | `[]` | no | +| successful\_requests\_extra\_tags | Extra tags for Storage sucessful requests monitor | list(string) | `[]` | no | | successful\_requests\_message | Custom message for Storage sucessful requests monitor | string | `""` | no | -| successful\_requests\_silenced | Groups to mute for Storage sucessful requests monitor | map | `{}` | no | +| successful\_requests\_silenced | Groups to mute for Storage sucessful requests monitor | map(string) | `{}` | no | | successful\_requests\_time\_aggregator | Monitor aggregator for Storage sucessful requests [available values: min, max or avg] | string | `"max"` | no | | successful\_requests\_timeframe | Monitor timeframe for Storage sucessful requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | successful\_storage\_requests\_threshold\_critical | Minimum acceptable percent of successful requests for a storage | string | `"90"` | no | | successful\_storage\_requests\_threshold\_warning | Warning regarding acceptable percent of successful requests for a storage | string | `"70"` | no | | throttling\_error\_requests\_enabled | Flag to enable Storage throttling error monitor | string | `"true"` | no | -| throttling\_error\_requests\_extra\_tags | Extra tags for Storage throttling error monitor | list | `[]` | no | +| throttling\_error\_requests\_extra\_tags | Extra tags for Storage throttling error monitor | list(string) | `[]` | no | | throttling\_error\_requests\_message | Custom message for Storage throttling error monitor | string | `""` | no | -| throttling\_error\_requests\_silenced | Groups to mute for Storage throttling error monitor | map | `{}` | no | +| throttling\_error\_requests\_silenced | Groups to mute for Storage throttling error monitor | map(string) | `{}` | no | | throttling\_error\_requests\_threshold\_critical | Maximum acceptable percent of throttling error requests for a storage | string | `"90"` | no | | throttling\_error\_requests\_threshold\_warning | Warning regarding acceptable percent of throttling error requests for a storage | string | `"50"` | no | | throttling\_error\_requests\_time\_aggregator | Monitor aggregator for Storage throttling errors [available values: min, max or avg] | string | `"min"` | no | | throttling\_error\_requests\_timeframe | Monitor timeframe for Storage throttling errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | timeout\_error\_requests\_enabled | Flag to enable Storage timeout monitor | string | `"true"` | no | -| timeout\_error\_requests\_extra\_tags | Extra tags for Storage timeout monitor | list | `[]` | no | +| timeout\_error\_requests\_extra\_tags | Extra tags for Storage timeout monitor | list(string) | `[]` | no | | timeout\_error\_requests\_message | Custom message for Storage timeout monitor | string | `""` | no | -| timeout\_error\_requests\_silenced | Groups to mute for Storage timeout monitor | map | `{}` | no | +| timeout\_error\_requests\_silenced | Groups to mute for Storage timeout monitor | map(string) | `{}` | no | | timeout\_error\_requests\_threshold\_critical | Maximum acceptable percent of timeout error requests for a storage | string | `"90"` | no | | timeout\_error\_requests\_threshold\_warning | Warning regarding acceptable percent of timeout error requests for a storage | string | `"50"` | no | | timeout\_error\_requests\_time\_aggregator | Monitor aggregator for Storage timeout [available values: min, max or avg] | string | `"min"` | no | diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index c083dc8..90c6457 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -24,7 +24,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.status_extra_tags] + tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.status_extra_tags) } resource "datadog_monitor" "blobservices_availability" { @@ -39,31 +39,31 @@ resource "datadog_monitor" "blobservices_availability" { EOQ -thresholds = { -critical = var.availability_threshold_critical -warning = var.availability_threshold_warning -} + thresholds = { + critical = var.availability_threshold_critical + warning = var.availability_threshold_warning + } -silenced = var.availability_silenced + silenced = var.availability_silenced -type = "metric alert" -notify_no_data = false -notify_audit = false -timeout_h = 0 -include_tags = true -locked = false -require_full_window = false -new_host_delay = var.new_host_delay -evaluation_delay = var.evaluation_delay -renotify_interval = 0 + type = "metric alert" + notify_no_data = false + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false + require_full_window = false + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay + renotify_interval = 0 -tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform", var.availability_extra_tags] + tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.availability_extra_tags) } resource "datadog_monitor" "fileservices_availability" { -count = var.availability_enabled == "true" ? 1 : 0 -name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage File services is down" -message = coalesce(var.availability_message, var.message) + count = var.availability_enabled == "true" ? 1 : 0 + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage File services is down" + message = coalesce(var.availability_message, var.message) query = < Date: Fri, 19 Jul 2019 11:49:01 +0200 Subject: [PATCH 05/17] AZ-97: Rebase with silenced new way --- cloud/azure/storage/README.md | 38 +- cloud/azure/storage/monitors-azure-storage.tf | 452 +++++++++--------- 2 files changed, 254 insertions(+), 236 deletions(-) diff --git a/cloud/azure/storage/README.md b/cloud/azure/storage/README.md index ae40173..68bae3c 100644 --- a/cloud/azure/storage/README.md +++ b/cloud/azure/storage/README.md @@ -16,25 +16,43 @@ module "datadog-monitors-cloud-azure-storage" { Creates DataDog monitors with the following checks: -- Azure Storage is down -- Azure Storage Table service is down -- Azure Storage Table service too few successful requests -- Azure Storage Table service too high end to end latency -- Azure Storage too many throttling errors -- Azure Table Storage too many authorization errors -- Azure Table Storage too many client_other errors -- Azure Table Storage too many network errors -- Azure Table Storage too many server_other errors -- Azure Table Storage too many timeout errors - Azure Blob Storage too many authorization errors - Azure Blob Storage too many client_other errors - Azure Blob Storage too many network errors - Azure Blob Storage too many server_other errors - Azure Blob Storage too many throttling errors - Azure Blob Storage too many timeout errors +- Azure File Storage too many authorization errors +- Azure File Storage too many client_other errors +- Azure File Storage too many network errors +- Azure File Storage too many server_other errors +- Azure File Storage too many timeout errors +- Azure Queue Storage too many authorization errors +- Azure Queue Storage too many client_other errors +- Azure Queue Storage too many network errors +- Azure Queue Storage too many server_other errors +- Azure Queue Storage too many timeout errors - Azure Storage Blob service too few successful requests - Azure Storage Blob service too high end to end latency - Azure Storage Blob services is down +- Azure Storage File service too few successful requests +- Azure Storage File service too high end to end latency +- Azure Storage File services is down +- Azure Storage is down +- Azure Storage Queue service is down +- Azure Storage Queue service too few successful requests +- Azure Storage Queue service too high end to end latency +- Azure Storage Table service is down +- Azure Storage Table service too few successful requests +- Azure Storage Table service too high end to end latency +- Azure Storage too many throttling errors +- Azure Storage too many throttling errors +- Azure Storage too many throttling errors +- Azure Table Storage too many authorization errors +- Azure Table Storage too many client_other errors +- Azure Table Storage too many network errors +- Azure Table Storage too many server_other errors +- Azure Table Storage too many timeout errors ## Inputs diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index 90c6457..0a19b03 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -12,24 +12,24 @@ EOQ critical = 1 } - silenced = var.status_silenced - type = "metric alert" - notify_no_data = true - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false + silenced = var.status_silenced + type = "metric alert" + notify_no_data = true + notify_audit = false + timeout_h = 0 + include_tags = true + locked = false require_full_window = false - new_host_delay = var.new_host_delay - evaluation_delay = var.evaluation_delay - renotify_interval = 0 + new_host_delay = var.new_host_delay + evaluation_delay = var.evaluation_delay + renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.status_extra_tags) } resource "datadog_monitor" "blobservices_availability" { - count = var.availability_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Blob services is down" + count = var.availability_enabled == "true" ? 1 : 0 + name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Blob services is down" message = coalesce(var.availability_message, var.message) query = < Date: Fri, 19 Jul 2019 12:29:30 +0200 Subject: [PATCH 06/17] MON-482: Backport ignore change on silenced --- cloud/azure/storage/monitors-azure-storage.tf | 123 +++++++++++++++++- 1 file changed, 119 insertions(+), 4 deletions(-) diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index 0a19b03..b38db2a 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -25,6 +25,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.status_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "blobservices_availability" { @@ -58,6 +62,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.availability_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "fileservices_availability" { @@ -91,6 +99,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.availability_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "queueservices_availability" { @@ -124,6 +136,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.availability_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "table_availability" { @@ -157,6 +173,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.availability_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "blobservices_requests_error" { @@ -191,6 +211,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.successful_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "fileservices_requests_error" { @@ -225,6 +249,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.successful_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "queueservices_requests_error" { @@ -259,6 +287,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.successful_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "tableservices_requests_error" { @@ -293,6 +325,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.successful_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "blobservices_latency" { @@ -326,6 +362,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "fileservices_latency" { @@ -400,6 +440,7 @@ EOQ } tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags) + } resource "datadog_monitor" "tableservices_latency" { @@ -437,6 +478,7 @@ EOQ } tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags) + } resource "datadog_monitor" "blob_timeout_error_requests" { @@ -470,6 +512,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.timeout_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "file_timeout_error_requests" { @@ -503,6 +549,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.timeout_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "queue_timeout_error_requests" { @@ -536,6 +586,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.timeout_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "table_timeout_error_requests" { @@ -569,6 +623,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.timeout_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "blob_network_error_requests" { @@ -602,6 +660,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.network_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "file_network_error_requests" { @@ -635,6 +697,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.network_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "queue_network_error_requests" { @@ -672,6 +738,7 @@ EOQ } tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.network_error_requests_extra_tags) + } resource "datadog_monitor" "table_network_error_requests" { @@ -705,6 +772,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.network_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "blob_throttling_error_requests" { @@ -775,6 +846,7 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.throttling_error_requests_extra_tags) + } resource "datadog_monitor" "queue_throttling_error_requests" { @@ -808,6 +880,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.throttling_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "table_throttling_error_requests" { @@ -841,6 +917,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.throttling_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "blob_server_other_error_requests" { @@ -874,6 +954,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.server_other_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "file_server_other_error_requests" { @@ -907,6 +991,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.server_other_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "queue_server_other_error_requests" { @@ -944,6 +1032,7 @@ EOQ } tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.server_other_error_requests_extra_tags) + } resource "datadog_monitor" "table_server_other_error_requests" { @@ -977,6 +1066,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.server_other_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "blob_client_other_error_requests" { @@ -1010,6 +1103,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.client_other_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "file_client_other_error_requests" { @@ -1031,10 +1128,6 @@ EOQ silenced = var.client_other_error_requests_silenced - lifecycle { - ignore_changes = ["silenced"] - } - type = "metric alert" notify_no_data = false notify_audit = false @@ -1047,6 +1140,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.client_other_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "queue_client_other_error_requests" { @@ -1084,6 +1181,7 @@ EOQ } tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.client_other_error_requests_extra_tags) + } resource "datadog_monitor" "table_client_other_error_requests" { @@ -1117,6 +1215,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.client_other_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "blob_authorization_error_requests" { @@ -1150,6 +1252,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.authorization_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "file_authorization_error_requests" { @@ -1187,6 +1293,7 @@ EOQ } tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.authorization_error_requests_extra_tags) + } resource "datadog_monitor" "queue_authorization_error_requests" { @@ -1220,6 +1327,10 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.authorization_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } resource "datadog_monitor" "table_authorization_error_requests" { @@ -1253,4 +1364,8 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.authorization_error_requests_extra_tags) + + lifecycle { + ignore_changes = ["silenced"] + } } From 0c95cb45e22095bf26a79db801afa0792d2755ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Respaut?= Date: Tue, 23 Jul 2019 10:13:48 +0200 Subject: [PATCH 07/17] AZ-97: Drop unused version.tf file generated by 0.12upgrade --- cloud/azure/storage/versions.tf | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 cloud/azure/storage/versions.tf diff --git a/cloud/azure/storage/versions.tf b/cloud/azure/storage/versions.tf deleted file mode 100644 index ac97c6a..0000000 --- a/cloud/azure/storage/versions.tf +++ /dev/null @@ -1,4 +0,0 @@ - -terraform { - required_version = ">= 0.12" -} From ffe2aa0f3e78b2ab81d2621ac288bcceb7c7a173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Respaut?= Date: Tue, 23 Jul 2019 10:50:13 +0200 Subject: [PATCH 08/17] AZ-97: Update filter-tags with the new integration --- cloud/azure/storage/modules.tf | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/cloud/azure/storage/modules.tf b/cloud/azure/storage/modules.tf index 4ba508d..fd47013 100644 --- a/cloud/azure/storage/modules.tf +++ b/cloud/azure/storage/modules.tf @@ -6,7 +6,7 @@ module "filter-tags" { filter_tags_use_defaults = var.filter_tags_use_defaults filter_tags_custom = var.filter_tags_custom filter_tags_custom_excluded = var.filter_tags_custom_excluded - extra_tags = ["transaction_type:all"] + extra_tags = [] } module "filter-tags-success" { @@ -17,7 +17,7 @@ module "filter-tags-success" { filter_tags_use_defaults = var.filter_tags_use_defaults filter_tags_custom = var.filter_tags_custom filter_tags_custom_excluded = var.filter_tags_custom_excluded - extra_tags = ["transaction_type:all,responsetype:success"] + extra_tags = ["responsetype:success"] } module "filter-tags-timeout-error" { @@ -28,7 +28,7 @@ module "filter-tags-timeout-error" { filter_tags_use_defaults = var.filter_tags_use_defaults filter_tags_custom = var.filter_tags_custom filter_tags_custom_excluded = var.filter_tags_custom_excluded - extra_tags = ["transaction_type:all,responsetype:ServerTimeoutError"] + extra_tags = ["responsetype:servertimeouterror"] } module "filter-tags-network-error" { @@ -39,7 +39,7 @@ module "filter-tags-network-error" { filter_tags_use_defaults = var.filter_tags_use_defaults filter_tags_custom = var.filter_tags_custom filter_tags_custom_excluded = var.filter_tags_custom_excluded - extra_tags = ["transaction_type:all,responsetype:NetworkError"] + extra_tags = ["responsetype:networkerror"] } module "filter-tags-throttling-error" { @@ -50,7 +50,7 @@ module "filter-tags-throttling-error" { filter_tags_use_defaults = var.filter_tags_use_defaults filter_tags_custom = var.filter_tags_custom filter_tags_custom_excluded = var.filter_tags_custom_excluded - extra_tags = ["transaction_type:all,responsetype:ServerBusyError"] + extra_tags = ["responsetype:serverbusyerror"] } module "filter-tags-server-other-error" { @@ -61,7 +61,7 @@ module "filter-tags-server-other-error" { filter_tags_use_defaults = var.filter_tags_use_defaults filter_tags_custom = var.filter_tags_custom filter_tags_custom_excluded = var.filter_tags_custom_excluded - extra_tags = ["transaction_type:all,responsetype:ServerOtherError"] + extra_tags = ["responsetype:serverothererror"] } module "filter-tags-client-other-error" { @@ -72,7 +72,7 @@ module "filter-tags-client-other-error" { filter_tags_use_defaults = var.filter_tags_use_defaults filter_tags_custom = var.filter_tags_custom filter_tags_custom_excluded = var.filter_tags_custom_excluded - extra_tags = ["transaction_type:all,responsetype:ClientOtherError"] + extra_tags = ["responsetype:clientothererror"] } module "filter-tags-authorization-error" { @@ -83,6 +83,5 @@ module "filter-tags-authorization-error" { filter_tags_use_defaults = var.filter_tags_use_defaults filter_tags_custom = var.filter_tags_custom filter_tags_custom_excluded = var.filter_tags_custom_excluded - extra_tags = ["transaction_type:all,responsetype:AuthorizationError"] + extra_tags = ["responsetype:authorizationerror"] } - From 9796401cc2fd2ff7ed984a99cfdc1e4660f84351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Respaut?= Date: Mon, 29 Jul 2019 10:47:30 +0200 Subject: [PATCH 09/17] AZ-97: Drop by resource_group_name, this tag seems not there for Storage metrics --- cloud/azure/storage/monitors-azure-storage.tf | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index b38db2a..8b3d103 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -4,7 +4,7 @@ resource "datadog_monitor" "storage_status" { message = coalesce(var.status_message, var.message) query = < ${var.successful_storage_requests_threshold_critical} EOQ @@ -224,8 +224,8 @@ resource "datadog_monitor" "fileservices_requests_error" { query = < ${var.successful_storage_requests_threshold_critical} EOQ @@ -262,8 +262,8 @@ resource "datadog_monitor" "queueservices_requests_error" { query = < ${var.successful_storage_requests_threshold_critical} EOQ @@ -300,8 +300,8 @@ resource "datadog_monitor" "tableservices_requests_error" { query = < ${var.successful_storage_requests_threshold_critical} EOQ @@ -338,7 +338,7 @@ resource "datadog_monitor" "blobservices_latency" { query = < ${var.latency_threshold_critical} EOQ @@ -375,7 +375,7 @@ resource "datadog_monitor" "fileservices_latency" { query = < ${var.latency_threshold_critical} EOQ @@ -412,7 +412,7 @@ resource "datadog_monitor" "queueservices_latency" { query = < ${var.latency_threshold_critical} EOQ @@ -450,7 +450,7 @@ resource "datadog_monitor" "tableservices_latency" { query = < ${var.latency_threshold_critical} EOQ @@ -488,7 +488,7 @@ resource "datadog_monitor" "blob_timeout_error_requests" { query = < ${var.timeout_error_requests_threshold_critical} EOQ @@ -525,7 +525,7 @@ resource "datadog_monitor" "file_timeout_error_requests" { query = < ${var.timeout_error_requests_threshold_critical} EOQ @@ -562,7 +562,7 @@ resource "datadog_monitor" "queue_timeout_error_requests" { query = < ${var.timeout_error_requests_threshold_critical} EOQ @@ -599,7 +599,7 @@ resource "datadog_monitor" "table_timeout_error_requests" { query = < ${var.timeout_error_requests_threshold_critical} EOQ @@ -636,7 +636,7 @@ resource "datadog_monitor" "blob_network_error_requests" { query = < ${var.network_error_requests_threshold_critical} EOQ @@ -673,7 +673,7 @@ resource "datadog_monitor" "file_network_error_requests" { query = < ${var.network_error_requests_threshold_critical} EOQ @@ -710,7 +710,7 @@ resource "datadog_monitor" "queue_network_error_requests" { query = < ${var.network_error_requests_threshold_critical} EOQ @@ -748,7 +748,7 @@ resource "datadog_monitor" "table_network_error_requests" { query = < ${var.network_error_requests_threshold_critical} EOQ @@ -785,7 +785,7 @@ resource "datadog_monitor" "blob_throttling_error_requests" { query = < ${var.throttling_error_requests_threshold_critical} EOQ @@ -822,7 +822,7 @@ resource "datadog_monitor" "file_throttling_error_requests" { query = < ${var.throttling_error_requests_threshold_critical} EOQ @@ -856,7 +856,7 @@ resource "datadog_monitor" "queue_throttling_error_requests" { query = < ${var.throttling_error_requests_threshold_critical} EOQ @@ -893,7 +893,7 @@ resource "datadog_monitor" "table_throttling_error_requests" { query = < ${var.throttling_error_requests_threshold_critical} EOQ @@ -930,7 +930,7 @@ resource "datadog_monitor" "blob_server_other_error_requests" { query = < ${var.server_other_error_requests_threshold_critical} EOQ @@ -967,7 +967,7 @@ resource "datadog_monitor" "file_server_other_error_requests" { query = < ${var.server_other_error_requests_threshold_critical} EOQ @@ -1004,7 +1004,7 @@ resource "datadog_monitor" "queue_server_other_error_requests" { query = < ${var.server_other_error_requests_threshold_critical} EOQ @@ -1042,7 +1042,7 @@ resource "datadog_monitor" "table_server_other_error_requests" { query = < ${var.server_other_error_requests_threshold_critical} EOQ @@ -1079,7 +1079,7 @@ resource "datadog_monitor" "blob_client_other_error_requests" { query = < ${var.client_other_error_requests_threshold_critical} EOQ @@ -1116,7 +1116,7 @@ resource "datadog_monitor" "file_client_other_error_requests" { query = < ${var.client_other_error_requests_threshold_critical} EOQ @@ -1153,7 +1153,7 @@ resource "datadog_monitor" "queue_client_other_error_requests" { query = < ${var.client_other_error_requests_threshold_critical} EOQ @@ -1191,7 +1191,7 @@ resource "datadog_monitor" "table_client_other_error_requests" { query = < ${var.client_other_error_requests_threshold_critical} EOQ @@ -1228,7 +1228,7 @@ resource "datadog_monitor" "blob_authorization_error_requests" { query = < ${var.authorization_error_requests_threshold_critical} EOQ @@ -1265,7 +1265,7 @@ resource "datadog_monitor" "file_authorization_error_requests" { query = < ${var.authorization_error_requests_threshold_critical} EOQ @@ -1303,7 +1303,7 @@ resource "datadog_monitor" "queue_authorization_error_requests" { query = < ${var.authorization_error_requests_threshold_critical} EOQ @@ -1340,7 +1340,7 @@ resource "datadog_monitor" "table_authorization_error_requests" { query = < ${var.authorization_error_requests_threshold_critical} EOQ From 08512ea9ccac5e6ac880980cb7feaeab03f089d6 Mon Sep 17 00:00:00 2001 From: "gauthier.ampe@fr.clara.net" Date: Mon, 29 Jul 2019 15:26:06 +0200 Subject: [PATCH 10/17] AZ-97 Delete monitor for service availabity and fix some metric name --- cloud/azure/storage/monitors-azure-storage.tf | 151 +----------------- 1 file changed, 2 insertions(+), 149 deletions(-) diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index 8b3d103..4fa71cc 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -31,153 +31,6 @@ EOQ } } -resource "datadog_monitor" "blobservices_availability" { - count = var.availability_enabled == "true" ? 1 : 0 - name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Blob services is down" - message = coalesce(var.availability_message, var.message) - - query = < ${var.latency_threshold_critical} EOQ @@ -412,7 +265,7 @@ resource "datadog_monitor" "queueservices_latency" { query = < ${var.latency_threshold_critical} EOQ From 2fa3ef691560053512e4c1958b40dae108b7d24d Mon Sep 17 00:00:00 2001 From: "gauthier.ampe@fr.clara.net" Date: Mon, 29 Jul 2019 15:31:30 +0200 Subject: [PATCH 11/17] AZ-97 Delete output for service availability --- cloud/azure/storage/outputs.tf | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/cloud/azure/storage/outputs.tf b/cloud/azure/storage/outputs.tf index 8e4c820..7d7650c 100644 --- a/cloud/azure/storage/outputs.tf +++ b/cloud/azure/storage/outputs.tf @@ -3,26 +3,6 @@ output "storage_status_id" { value = datadog_monitor.storage_status.*.id } -output "blobservices_availability_id" { - description = "id for monitor blobservices_availability" - value = datadog_monitor.blobservices_availability.*.id -} - -output "fileservices_availability_id" { - description = "id for monitor fileservices_availability" - value = datadog_monitor.fileservices_availability.*.id -} - -output "queueservices_availability_id" { - description = "id for monitor queueservices_availability" - value = datadog_monitor.queueservices_availability.*.id -} - -output "table_availability_id" { - description = "id for monitor table_availability" - value = datadog_monitor.table_availability.*.id -} - output "blobservices_requests_error_id" { description = "id for monitor blobservices_requests_error" value = datadog_monitor.blobservices_requests_error.*.id @@ -182,4 +162,3 @@ output "table_authorization_error_requests_id" { description = "id for monitor table_authorization_error_requests" value = datadog_monitor.table_authorization_error_requests.*.id } - From aa16d78d8d9e3991bb9fe592d6a1503b3da965d2 Mon Sep 17 00:00:00 2001 From: "gauthier.ampe@fr.clara.net" Date: Tue, 30 Jul 2019 09:23:09 +0200 Subject: [PATCH 12/17] AZ-97 improve tableservice monitor (test) --- cloud/azure/storage/monitors-azure-storage.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index 4fa71cc..9579999 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -153,9 +153,9 @@ resource "datadog_monitor" "tableservices_requests_error" { query = < ${var.successful_storage_requests_threshold_critical} + default(100-(default(sum:azure.storage_storageaccounts_tableservices.transactions${module.filter-tags-success.query_alert} by {name}.as_rate(),0) / + default(sum:azure.storage_storageaccounts_tableservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.successful_storage_requests_threshold_critical} EOQ From 33421acc3e498055d62ca43310fb8e84bf490bfb Mon Sep 17 00:00:00 2001 From: "gauthier.ampe@fr.clara.net" Date: Tue, 30 Jul 2019 09:47:42 +0200 Subject: [PATCH 13/17] AZ-97 improve requests_error monitor --- cloud/azure/storage/monitors-azure-storage.tf | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index 9579999..926c18d 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -39,9 +39,9 @@ resource "datadog_monitor" "blobservices_requests_error" { query = < ${var.successful_storage_requests_threshold_critical} + default(100-(default(sum:azure.storage_storageaccounts_blobservices.transactions${module.filter-tags-success.query_alert} by {name}.as_rate(),0) / + default(sum:azure.storage_storageaccounts_blobservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.successful_storage_requests_threshold_critical} EOQ @@ -77,9 +77,9 @@ resource "datadog_monitor" "fileservices_requests_error" { query = < ${var.successful_storage_requests_threshold_critical} + default(100-(default(sum:azure.storage_storageaccounts_fileservices.transactions${module.filter-tags-success.query_alert} by {name}.as_rate(),0) / + default(sum:azure.storage_storageaccounts_fileservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.successful_storage_requests_threshold_critical} EOQ @@ -115,9 +115,9 @@ resource "datadog_monitor" "queueservices_requests_error" { query = < ${var.successful_storage_requests_threshold_critical} + default(100-(default(sum:azure.storage_storageaccounts_queueservices.transactions${module.filter-tags-success.query_alert} by {name}.as_rate(),0 / + default(sum:azure.storage_storageaccounts_queueservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.successful_storage_requests_threshold_critical} EOQ From b7689becaf399b6a587f9203a869ebc28c87bdb9 Mon Sep 17 00:00:00 2001 From: "gauthier.ampe@fr.clara.net" Date: Tue, 30 Jul 2019 09:50:19 +0200 Subject: [PATCH 14/17] AZ-97 fix requests_error monitor --- cloud/azure/storage/monitors-azure-storage.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index 926c18d..4717e1d 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -115,7 +115,7 @@ resource "datadog_monitor" "queueservices_requests_error" { query = < ${var.successful_storage_requests_threshold_critical} EOQ From d718947f99e5fe4d47f9f77fd256ff0212c2c5f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Respaut?= Date: Tue, 30 Jul 2019 11:20:41 +0200 Subject: [PATCH 15/17] AZ-97: Auto update --- cloud/azure/storage/README.md | 8 -------- cloud/azure/storage/outputs.tf | 1 + 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/cloud/azure/storage/README.md b/cloud/azure/storage/README.md index 68bae3c..1f4c360 100644 --- a/cloud/azure/storage/README.md +++ b/cloud/azure/storage/README.md @@ -34,15 +34,11 @@ Creates DataDog monitors with the following checks: - Azure Queue Storage too many timeout errors - Azure Storage Blob service too few successful requests - Azure Storage Blob service too high end to end latency -- Azure Storage Blob services is down - Azure Storage File service too few successful requests - Azure Storage File service too high end to end latency -- Azure Storage File services is down - Azure Storage is down -- Azure Storage Queue service is down - Azure Storage Queue service too few successful requests - Azure Storage Queue service too high end to end latency -- Azure Storage Table service is down - Azure Storage Table service too few successful requests - Azure Storage Table service too high end to end latency - Azure Storage too many throttling errors @@ -155,7 +151,6 @@ Creates DataDog monitors with the following checks: | blob\_server\_other\_error\_requests\_id | id for monitor blob_server_other_error_requests | | blob\_throttling\_error\_requests\_id | id for monitor blob_throttling_error_requests | | blob\_timeout\_error\_requests\_id | id for monitor blob_timeout_error_requests | -| blobservices\_availability\_id | id for monitor blobservices_availability | | blobservices\_latency\_id | id for monitor blobservices_latency | | blobservices\_requests\_error\_id | id for monitor blobservices_requests_error | | file\_authorization\_error\_requests\_id | id for monitor file_authorization_error_requests | @@ -164,7 +159,6 @@ Creates DataDog monitors with the following checks: | file\_server\_other\_error\_requests\_id | id for monitor file_server_other_error_requests | | file\_throttling\_error\_requests\_id | id for monitor file_throttling_error_requests | | file\_timeout\_error\_requests\_id | id for monitor file_timeout_error_requests | -| fileservices\_availability\_id | id for monitor fileservices_availability | | fileservices\_latency\_id | id for monitor fileservices_latency | | fileservices\_requests\_error\_id | id for monitor fileservices_requests_error | | queue\_authorization\_error\_requests\_id | id for monitor queue_authorization_error_requests | @@ -173,12 +167,10 @@ Creates DataDog monitors with the following checks: | queue\_server\_other\_error\_requests\_id | id for monitor queue_server_other_error_requests | | queue\_throttling\_error\_requests\_id | id for monitor queue_throttling_error_requests | | queue\_timeout\_error\_requests\_id | id for monitor queue_timeout_error_requests | -| queueservices\_availability\_id | id for monitor queueservices_availability | | queueservices\_latency\_id | id for monitor queueservices_latency | | queueservices\_requests\_error\_id | id for monitor queueservices_requests_error | | storage\_status\_id | id for monitor storage_status | | table\_authorization\_error\_requests\_id | id for monitor table_authorization_error_requests | -| table\_availability\_id | id for monitor table_availability | | table\_client\_other\_error\_requests\_id | id for monitor table_client_other_error_requests | | table\_network\_error\_requests\_id | id for monitor table_network_error_requests | | table\_server\_other\_error\_requests\_id | id for monitor table_server_other_error_requests | diff --git a/cloud/azure/storage/outputs.tf b/cloud/azure/storage/outputs.tf index 7d7650c..98895de 100644 --- a/cloud/azure/storage/outputs.tf +++ b/cloud/azure/storage/outputs.tf @@ -162,3 +162,4 @@ output "table_authorization_error_requests_id" { description = "id for monitor table_authorization_error_requests" value = datadog_monitor.table_authorization_error_requests.*.id } + From 85ea51a055cfa619565a30b4d6f88ef1f384acc8 Mon Sep 17 00:00:00 2001 From: "gauthier.ampe@fr.clara.net" Date: Tue, 30 Jul 2019 17:14:30 +0200 Subject: [PATCH 16/17] AZ-97 fix multiple monitor --- cloud/azure/storage/inputs.tf | 1 - cloud/azure/storage/monitors-azure-storage.tf | 215 ++++++++++-------- 2 files changed, 115 insertions(+), 101 deletions(-) diff --git a/cloud/azure/storage/inputs.tf b/cloud/azure/storage/inputs.tf index f8a1acc..f95aee2 100644 --- a/cloud/azure/storage/inputs.tf +++ b/cloud/azure/storage/inputs.tf @@ -489,4 +489,3 @@ variable "status_extra_tags" { type = list(string) default = [] } - diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index 4717e1d..fc0aeb1 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -74,8 +74,7 @@ resource "datadog_monitor" "fileservices_requests_error" { count = var.successful_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage File service too few successful requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.successful_requests_message, var.message) - -query = < ${var.latency_threshold_critical} @@ -263,7 +262,7 @@ resource "datadog_monitor" "queueservices_latency" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Queue service too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = coalesce(var.latency_message, var.message) -query = < ${var.latency_threshold_critical} @@ -293,7 +292,6 @@ EOQ } tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags) - } resource "datadog_monitor" "tableservices_latency" { @@ -331,7 +329,6 @@ EOQ } tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags) - } resource "datadog_monitor" "blob_timeout_error_requests" { @@ -340,12 +337,12 @@ resource "datadog_monitor" "blob_timeout_error_requests" { message = coalesce(var.timeout_error_requests_message, var.message) query = < ${var.timeout_error_requests_threshold_critical} + ${var.timeout_error_requests_time_aggregator}(${var.timeout_error_requests_timeframe}): + default((default(avg:azure.storage_storageaccounts_blobservices.transactions${module.filter-tags-timeout-error.query_alert} by {name}.as_rate(),0) / + default(avg:azure.storage_storageaccounts_blobservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.timeout_error_requests_threshold_critical} EOQ - thresholds = { critical = var.timeout_error_requests_threshold_critical warning = var.timeout_error_requests_threshold_warning @@ -376,13 +373,13 @@ resource "datadog_monitor" "file_timeout_error_requests" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.timeout_error_requests_message, var.message) -query = < ${var.timeout_error_requests_threshold_critical} + query = < ${var.timeout_error_requests_threshold_critical} EOQ - thresholds = { critical = var.timeout_error_requests_threshold_critical warning = var.timeout_error_requests_threshold_warning @@ -413,10 +410,11 @@ resource "datadog_monitor" "queue_timeout_error_requests" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.timeout_error_requests_message, var.message) -query = < ${var.timeout_error_requests_threshold_critical} + query = < ${var.timeout_error_requests_threshold_critical} EOQ @@ -451,9 +449,10 @@ resource "datadog_monitor" "table_timeout_error_requests" { message = coalesce(var.timeout_error_requests_message, var.message) query = < ${var.timeout_error_requests_threshold_critical} + ${var.timeout_error_requests_time_aggregator}(${var.timeout_error_requests_timeframe}): + default((default(avg:azure.storage_storageaccounts_tableservices.transactions${module.filter-tags-timeout-error.query_alert} by {name}.as_rate(),0) / + default(avg:azure.storage_storageaccounts_tableservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.timeout_error_requests_threshold_critical} EOQ @@ -488,9 +487,10 @@ resource "datadog_monitor" "blob_network_error_requests" { message = coalesce(var.network_error_requests_message, var.message) query = < ${var.network_error_requests_threshold_critical} + ${var.network_error_requests_time_aggregator}(${var.network_error_requests_timeframe}): + default((default(avg:azure.storage_storageaccounts_blobservices.transactions${module.filter-tags-network-error.query_alert} by {name}.as_rate(),0) / + default(avg:azure.storage_storageaccounts_blobservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.network_error_requests_threshold_critical} EOQ @@ -524,10 +524,11 @@ resource "datadog_monitor" "file_network_error_requests" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.network_error_requests_message, var.message) -query = < ${var.network_error_requests_threshold_critical} + query = < ${var.network_error_requests_threshold_critical} EOQ @@ -561,10 +562,11 @@ resource "datadog_monitor" "queue_network_error_requests" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.network_error_requests_message, var.message) -query = < ${var.network_error_requests_threshold_critical} + query = < ${var.network_error_requests_threshold_critical} EOQ @@ -591,7 +593,6 @@ EOQ } tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.network_error_requests_extra_tags) - } resource "datadog_monitor" "table_network_error_requests" { @@ -600,9 +601,10 @@ resource "datadog_monitor" "table_network_error_requests" { message = coalesce(var.network_error_requests_message, var.message) query = < ${var.network_error_requests_threshold_critical} + ${var.network_error_requests_time_aggregator}(${var.network_error_requests_timeframe}): + default((default(avg:azure.storage_storageaccounts_tableservices.transactions${module.filter-tags-network-error.query_alert} by {name}.as_rate(),0) / + default(avg:azure.storage_storageaccounts_tableservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.network_error_requests_threshold_critical} EOQ @@ -637,9 +639,10 @@ resource "datadog_monitor" "blob_throttling_error_requests" { message = coalesce(var.throttling_error_requests_message, var.message) query = < ${var.throttling_error_requests_threshold_critical} + ${var.throttling_error_requests_time_aggregator}(${var.throttling_error_requests_timeframe}): + default((default(avg:azure.storage_storageaccounts_blobservices.transactions${module.filter-tags-throttling-error.query_alert} by {name}.as_rate(),0) / + default(avg:azure.storage_storageaccounts_blobservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.throttling_error_requests_threshold_critical} EOQ @@ -673,10 +676,11 @@ resource "datadog_monitor" "file_throttling_error_requests" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.throttling_error_requests_message, var.message) -query = < ${var.throttling_error_requests_threshold_critical} + query = < ${var.throttling_error_requests_threshold_critical} EOQ @@ -699,7 +703,6 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.throttling_error_requests_extra_tags) - } resource "datadog_monitor" "queue_throttling_error_requests" { @@ -707,10 +710,11 @@ resource "datadog_monitor" "queue_throttling_error_requests" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.throttling_error_requests_message, var.message) -query = < ${var.throttling_error_requests_threshold_critical} + query = < ${var.throttling_error_requests_threshold_critical} EOQ @@ -745,9 +749,10 @@ resource "datadog_monitor" "table_throttling_error_requests" { message = coalesce(var.throttling_error_requests_message, var.message) query = < ${var.throttling_error_requests_threshold_critical} + ${var.throttling_error_requests_time_aggregator}(${var.throttling_error_requests_timeframe}): + default((default(avg:azure.storage_storageaccounts_tableservices.transactions${module.filter-tags-throttling-error.query_alert} by {name}.as_rate(),0) / + default(avg:azure.storage_storageaccounts_tableservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.throttling_error_requests_threshold_critical} EOQ @@ -776,15 +781,18 @@ EOQ } } + + resource "datadog_monitor" "blob_server_other_error_requests" { count = var.server_other_error_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.server_other_error_requests_message, var.message) query = < ${var.server_other_error_requests_threshold_critical} + ${var.server_other_error_requests_time_aggregator}(${var.server_other_error_requests_timeframe}): + default((default(avg:azure.storage_storageaccounts_blobservices.transactions${module.filter-tags-server-other-error.query_alert} by {name}.as_rate(),0) / + default(avg:azure.storage_storageaccounts_blobservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.server_other_error_requests_threshold_critical} EOQ @@ -818,10 +826,11 @@ resource "datadog_monitor" "file_server_other_error_requests" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.server_other_error_requests_message, var.message) -query = < ${var.server_other_error_requests_threshold_critical} + query = < ${var.server_other_error_requests_threshold_critical} EOQ @@ -855,10 +864,11 @@ resource "datadog_monitor" "queue_server_other_error_requests" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.server_other_error_requests_message, var.message) -query = < ${var.server_other_error_requests_threshold_critical} + query = < ${var.server_other_error_requests_threshold_critical} EOQ @@ -885,7 +895,6 @@ EOQ } tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.server_other_error_requests_extra_tags) - } resource "datadog_monitor" "table_server_other_error_requests" { @@ -894,9 +903,10 @@ resource "datadog_monitor" "table_server_other_error_requests" { message = coalesce(var.server_other_error_requests_message, var.message) query = < ${var.server_other_error_requests_threshold_critical} + ${var.server_other_error_requests_time_aggregator}(${var.server_other_error_requests_timeframe}): + default((default(avg:azure.storage_storageaccounts_tableservices.transactions${module.filter-tags-server-other-error.query_alert} by {name}.as_rate(),0) / + default(avg:azure.storage_storageaccounts_tableservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.server_other_error_requests_threshold_critical} EOQ @@ -929,11 +939,11 @@ resource "datadog_monitor" "blob_client_other_error_requests" { count = var.client_other_error_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.client_other_error_requests_message, var.message) - - query = < ${var.client_other_error_requests_threshold_critical} +query = < ${var.client_other_error_requests_threshold_critical} EOQ @@ -967,10 +977,11 @@ resource "datadog_monitor" "file_client_other_error_requests" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.client_other_error_requests_message, var.message) -query = < ${var.client_other_error_requests_threshold_critical} + query = < ${var.client_other_error_requests_threshold_critical} EOQ @@ -1004,10 +1015,11 @@ resource "datadog_monitor" "queue_client_other_error_requests" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.client_other_error_requests_message, var.message) -query = < ${var.client_other_error_requests_threshold_critical} + query = < ${var.client_other_error_requests_threshold_critical} EOQ @@ -1034,7 +1046,6 @@ EOQ } tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.client_other_error_requests_extra_tags) - } resource "datadog_monitor" "table_client_other_error_requests" { @@ -1043,9 +1054,10 @@ resource "datadog_monitor" "table_client_other_error_requests" { message = coalesce(var.client_other_error_requests_message, var.message) query = < ${var.client_other_error_requests_threshold_critical} + ${var.client_other_error_requests_time_aggregator}(${var.client_other_error_requests_timeframe}): + default((default(sum:azure.storage_storageaccounts_tableservices.transactions${module.filter-tags-client-other-error.query_alert} by {name}.as_rate(),0) / + default(sum:azure.storage_storageaccounts_tableservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.client_other_error_requests_threshold_critical} EOQ @@ -1080,9 +1092,10 @@ resource "datadog_monitor" "blob_authorization_error_requests" { message = coalesce(var.authorization_error_requests_message, var.message) query = < ${var.authorization_error_requests_threshold_critical} + ${var.authorization_error_requests_time_aggregator}(${var.authorization_error_requests_timeframe}): + default((default(avg:azure.storage_storageaccounts_blobservices.transactions${module.filter-tags-authorization-error.query_alert} by {name}.as_rate(),0) / + default(avg:azure.storage_storageaccounts_blobservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.authorization_error_requests_threshold_critical} EOQ @@ -1116,10 +1129,11 @@ resource "datadog_monitor" "file_authorization_error_requests" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure File Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.authorization_error_requests_message, var.message) -query = < ${var.authorization_error_requests_threshold_critical} + query = < ${var.authorization_error_requests_threshold_critical} EOQ @@ -1146,7 +1160,6 @@ EOQ } tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.authorization_error_requests_extra_tags) - } resource "datadog_monitor" "queue_authorization_error_requests" { @@ -1154,10 +1167,11 @@ resource "datadog_monitor" "queue_authorization_error_requests" { name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Queue Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.authorization_error_requests_message, var.message) -query = < ${var.authorization_error_requests_threshold_critical} + query = < ${var.authorization_error_requests_threshold_critical} EOQ @@ -1192,9 +1206,10 @@ resource "datadog_monitor" "table_authorization_error_requests" { message = coalesce(var.authorization_error_requests_message, var.message) query = < ${var.authorization_error_requests_threshold_critical} + ${var.authorization_error_requests_time_aggregator}(${var.authorization_error_requests_timeframe}): + default((default(avg:azure.storage_storageaccounts_tableservices.transactions${module.filter-tags-authorization-error.query_alert} by {name}.as_rate(),0) / + default(avg:azure.storage_storageaccounts_tableservices.transactions${module.filter-tags.query_alert} by {name}.as_rate(),0) + * 100),0) > ${var.authorization_error_requests_threshold_critical} EOQ From eaf328d30024058f2f6c366b01cf96f3d3382285 Mon Sep 17 00:00:00 2001 From: "gauthier.ampe@fr.clara.net" Date: Tue, 30 Jul 2019 18:02:02 +0200 Subject: [PATCH 17/17] AZ-97 change avg by sum on multiple monitor --- cloud/azure/storage/monitors-azure-storage.tf | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index fc0aeb1..2e84dc0 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -338,8 +338,8 @@ resource "datadog_monitor" "blob_timeout_error_requests" { query = < ${var.timeout_error_requests_threshold_critical} EOQ @@ -375,8 +375,8 @@ resource "datadog_monitor" "file_timeout_error_requests" { query = < ${var.timeout_error_requests_threshold_critical} EOQ @@ -412,8 +412,8 @@ resource "datadog_monitor" "queue_timeout_error_requests" { query = < ${var.timeout_error_requests_threshold_critical} EOQ @@ -450,8 +450,8 @@ resource "datadog_monitor" "table_timeout_error_requests" { query = < ${var.timeout_error_requests_threshold_critical} EOQ @@ -488,8 +488,8 @@ resource "datadog_monitor" "blob_network_error_requests" { query = < ${var.network_error_requests_threshold_critical} EOQ @@ -526,8 +526,8 @@ resource "datadog_monitor" "file_network_error_requests" { query = < ${var.network_error_requests_threshold_critical} EOQ @@ -564,8 +564,8 @@ resource "datadog_monitor" "queue_network_error_requests" { query = < ${var.network_error_requests_threshold_critical} EOQ @@ -602,8 +602,8 @@ resource "datadog_monitor" "table_network_error_requests" { query = < ${var.network_error_requests_threshold_critical} EOQ @@ -640,8 +640,8 @@ resource "datadog_monitor" "blob_throttling_error_requests" { query = < ${var.throttling_error_requests_threshold_critical} EOQ @@ -678,8 +678,8 @@ resource "datadog_monitor" "file_throttling_error_requests" { query = < ${var.throttling_error_requests_threshold_critical} EOQ @@ -712,8 +712,8 @@ resource "datadog_monitor" "queue_throttling_error_requests" { query = < ${var.throttling_error_requests_threshold_critical} EOQ @@ -750,8 +750,8 @@ resource "datadog_monitor" "table_throttling_error_requests" { query = < ${var.throttling_error_requests_threshold_critical} EOQ @@ -790,8 +790,8 @@ resource "datadog_monitor" "blob_server_other_error_requests" { query = < ${var.server_other_error_requests_threshold_critical} EOQ @@ -828,8 +828,8 @@ resource "datadog_monitor" "file_server_other_error_requests" { query = < ${var.server_other_error_requests_threshold_critical} EOQ @@ -866,8 +866,8 @@ resource "datadog_monitor" "queue_server_other_error_requests" { query = < ${var.server_other_error_requests_threshold_critical} EOQ @@ -904,8 +904,8 @@ resource "datadog_monitor" "table_server_other_error_requests" { query = < ${var.server_other_error_requests_threshold_critical} EOQ @@ -1093,8 +1093,8 @@ resource "datadog_monitor" "blob_authorization_error_requests" { query = < ${var.authorization_error_requests_threshold_critical} EOQ @@ -1131,8 +1131,8 @@ resource "datadog_monitor" "file_authorization_error_requests" { query = < ${var.authorization_error_requests_threshold_critical} EOQ @@ -1169,8 +1169,8 @@ resource "datadog_monitor" "queue_authorization_error_requests" { query = < ${var.authorization_error_requests_threshold_critical} EOQ @@ -1207,8 +1207,8 @@ resource "datadog_monitor" "table_authorization_error_requests" { query = < ${var.authorization_error_requests_threshold_critical} EOQ