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] 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}" +}