From 14f798d65094768d0736db1d04e54d8931678f26 Mon Sep 17 00:00:00 2001 From: Laurent Piroelle Date: Thu, 30 Aug 2018 10:44:45 +0200 Subject: [PATCH] MON-237 Remove Cosmos RU monitor --- cloud/azure/README.md | 5 --- cloud/azure/cosmosdb/README.md | 17 -------- cloud/azure/cosmosdb/inputs.tf | 51 ----------------------- cloud/azure/cosmosdb/modules.tf | 11 ----- cloud/azure/cosmosdb/monitors-cosmosdb.tf | 39 +---------------- cloud/azure/cosmosdb/outputs.tf | 5 --- cloud/azure/inputs.tf | 51 ----------------------- cloud/azure/monitors.tf | 10 ----- 8 files changed, 1 insertion(+), 188 deletions(-) diff --git a/cloud/azure/README.md b/cloud/azure/README.md index daa36be..c51727d 100644 --- a/cloud/azure/README.md +++ b/cloud/azure/README.md @@ -91,11 +91,6 @@ Inputs | cosmos_db_5xx_request_rate_threshold_warning | Warning threshold for Cosmos DB 5xx requests monitor | string | `50` | no | | cosmos_db_5xx_requests_message | Custom message for Cosmos DB 5xx requests monitor | string | `` | no | | cosmos_db_5xx_requests_silenced | Groups to mute for Cosmos DB 5xx requests monitor | map | `` | no | -| cosmos_db_ru_utilization_collection | Group to associate Cosmos DB collection to RU max | map | - | yes | -| cosmos_db_ru_utilization_message | Custom message for Cosmos DB collection RU utilization monitor | string | `` | no | -| cosmos_db_ru_utilization_rate_threshold_critical | Critical threshold for Cosmos DB collection RU utilization monitor | string | `90` | no | -| cosmos_db_ru_utilization_rate_threshold_warning | Warning threshold for Cosmos DB collection RU utilization monitor | string | `80` | no | -| cosmos_db_ru_utilization_silenced | Groups to mute for Cosmos DB collection RU utilization monitor | map | `` | no | | datalakestore_status_message | Custom message for Datalake Store status monitor | string | `` | no | | datalakestore_status_silenced | Groups to mute for Datalake Store status monitor | map | `` | no | | datalakestore_status_time_aggregator | Monitor aggregator for Datalake Store status [available values: min, max or avg] | string | `max` | no | diff --git a/cloud/azure/cosmosdb/README.md b/cloud/azure/cosmosdb/README.md index a8ea549..6de3209 100644 --- a/cloud/azure/cosmosdb/README.md +++ b/cloud/azure/cosmosdb/README.md @@ -8,12 +8,6 @@ module "datadog-monitors-cloud-azure-cosmosdb" { environment = "${var.environment}" message = "${module.datadog-message-alerting.alerting-message}" - - # MyDocumentCollection is provisioned with 1000 RU/s in Azure so, - # we set the RU value for 5 minutes as input because 5m is the default evalutation timeframe - cosmos_db_ru_utilization_collections = { - "MyDocumentCollection" = 300000 # 1000 * 60 * 5 - } } ``` @@ -24,7 +18,6 @@ Creates DataDog monitors with the following checks: - Cosmos DB 4xx requests rate is high - Cosmos DB 5xx requests rate is high -- Cosmos DB collection ${element(keys(var.cosmos_db_ru_utilization_collections),count.index)} RU utilization is high - Cosmos DB is down ## Inputs @@ -47,15 +40,6 @@ Creates DataDog monitors with the following checks: | cosmos_db_5xx_requests_enabled | Flag to enable Cosmos DB 5xx requests monitor | string | `true` | no | | cosmos_db_5xx_requests_message | Custom message for Cosmos DB 5xx requests monitor | string | `` | no | | cosmos_db_5xx_requests_silenced | Groups to mute for Cosmos DB 5xx requests monitor | map | `` | no | -| cosmos_db_ru_utilization_collections | Group to associate Cosmos DB collection to RU max. RU value has to be correlated with the monitor timeframe | map | - | yes | -| cosmos_db_ru_utilization_enabled | Flag to enable Cosmos DB collection RU utilization monitor | string | `true` | no | -| cosmos_db_ru_utilization_extra_tags | Extra tags for Cosmos DB collection RU utilization monitor | list | `` | no | -| cosmos_db_ru_utilization_message | Custom message for Cosmos DB collection RU utilization monitor | string | `` | no | -| cosmos_db_ru_utilization_rate_threshold_critical | Critical threshold for Cosmos DB collection RU utilization monitor | string | `90` | no | -| cosmos_db_ru_utilization_rate_threshold_warning | Warning threshold for Cosmos DB collection RU utilization monitor | string | `80` | no | -| cosmos_db_ru_utilization_silenced | Groups to mute for Cosmos DB collection RU utilization monitor | map | `` | no | -| cosmos_db_ru_utilization_time_aggregator | Monitor aggregator for Cosmos DB RU utilization [available values: min, max or avg] | string | `sum` | no | -| cosmos_db_ru_utilization_timeframe | Monitor timeframe for Cosmos DB RU utilization [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | environment | Architecture environment | string | - | yes | | evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | @@ -75,7 +59,6 @@ Creates DataDog monitors with the following checks: |------|-------------| | cosmos_db_4xx_requests_id | id for monitor cosmos_db_4xx_requests | | cosmos_db_5xx_requests_id | id for monitor cosmos_db_5xx_requests | -| cosmos_db_ru_utilization_id | id for monitor cosmos_db_ru_utilization | | cosmos_db_status_id | id for monitor cosmos_db_status | Related documentation diff --git a/cloud/azure/cosmosdb/inputs.tf b/cloud/azure/cosmosdb/inputs.tf index a689131..4d6cd55 100644 --- a/cloud/azure/cosmosdb/inputs.tf +++ b/cloud/azure/cosmosdb/inputs.tf @@ -155,54 +155,3 @@ variable "cosmos_db_5xx_request_timeframe" { type = "string" default = "last_5m" } - -variable "cosmos_db_ru_utilization_message" { - description = "Custom message for Cosmos DB collection RU utilization monitor" - type = "string" - default = "" -} - -variable "cosmos_db_ru_utilization_enabled" { - description = "Flag to enable Cosmos DB collection RU utilization monitor" - type = "string" - default = "true" -} - -variable "cosmos_db_ru_utilization_silenced" { - description = "Groups to mute for Cosmos DB collection RU utilization monitor" - type = "map" - default = {} -} - -variable "cosmos_db_ru_utilization_rate_threshold_critical" { - description = "Critical threshold for Cosmos DB collection RU utilization monitor" - default = 90 -} - -variable "cosmos_db_ru_utilization_rate_threshold_warning" { - description = "Warning threshold for Cosmos DB collection RU utilization monitor" - default = 80 -} - -variable "cosmos_db_ru_utilization_extra_tags" { - description = "Extra tags for Cosmos DB collection RU utilization monitor" - type = "list" - default = [] -} - -variable "cosmos_db_ru_utilization_time_aggregator" { - description = "Monitor aggregator for Cosmos DB RU utilization [available values: min, max or avg]" - type = "string" - default = "sum" -} - -variable "cosmos_db_ru_utilization_timeframe" { - description = "Monitor timeframe for Cosmos DB RU utilization [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 "cosmos_db_ru_utilization_collections" { - description = "Group to associate Cosmos DB collection to RU max. RU value has to be correlated with the monitor timeframe" - type = "map" -} diff --git a/cloud/azure/cosmosdb/modules.tf b/cloud/azure/cosmosdb/modules.tf index aa2ac12..889e29a 100644 --- a/cloud/azure/cosmosdb/modules.tf +++ b/cloud/azure/cosmosdb/modules.tf @@ -17,14 +17,3 @@ module "filter-tags-statuscode" { extra_tags = ["statuscode:%s"] } - -module "filter-tags-collection" { - source = "../../../common/filter-tags" - - environment = "${var.environment}" - resource = "cosmosdb" - filter_tags_use_defaults = "${var.filter_tags_use_defaults}" - filter_tags_custom = "${var.filter_tags_custom},collectionname:%s" - - extra_tags = ["collectionname:%s"] -} diff --git a/cloud/azure/cosmosdb/monitors-cosmosdb.tf b/cloud/azure/cosmosdb/monitors-cosmosdb.tf index 7f64696..9df1dc4 100644 --- a/cloud/azure/cosmosdb/monitors-cosmosdb.tf +++ b/cloud/azure/cosmosdb/monitors-cosmosdb.tf @@ -38,6 +38,7 @@ resource "datadog_monitor" "cosmos_db_4xx_requests" { name = "[${var.environment}] Cosmos DB 4xx requests rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cosmos_db_4xx_requests_message, var.message)}" + # List of available status codes : https://docs.microsoft.com/en-us/rest/api/cosmos-db/http-status-codes-for-cosmosdb query = < ${var.cosmos_db_ru_utilization_rate_threshold_critical} - EOF - - type = "metric alert" - - thresholds { - critical = "${var.cosmos_db_ru_utilization_rate_threshold_critical}" - warning = "${var.cosmos_db_ru_utilization_rate_threshold_warning}" - } - - silenced = "${var.cosmos_db_ru_utilization_silenced}" - - notify_no_data = false - evaluation_delay = "${var.evaluation_delay}" - renotify_interval = 0 - notify_audit = false - timeout_h = 0 - include_tags = true - locked = false - require_full_window = true - new_host_delay = "${var.new_host_delay}" - - tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:cosmos_db", "team:claranet", "created-by:terraform", "${var.cosmos_db_ru_utilization_extra_tags}"] -} diff --git a/cloud/azure/cosmosdb/outputs.tf b/cloud/azure/cosmosdb/outputs.tf index ea44e24..6901b39 100644 --- a/cloud/azure/cosmosdb/outputs.tf +++ b/cloud/azure/cosmosdb/outputs.tf @@ -12,8 +12,3 @@ output "cosmos_db_5xx_requests_id" { description = "id for monitor cosmos_db_5xx_requests" value = "${datadog_monitor.cosmos_db_5xx_requests.*.id}" } - -output "cosmos_db_ru_utilization_id" { - description = "id for monitor cosmos_db_ru_utilization" - value = "${datadog_monitor.cosmos_db_ru_utilization.*.id}" -} diff --git a/cloud/azure/inputs.tf b/cloud/azure/inputs.tf index bb4ff3d..ed87c29 100644 --- a/cloud/azure/inputs.tf +++ b/cloud/azure/inputs.tf @@ -1751,57 +1751,6 @@ variable "cosmos_db_5xx_request_timeframe" { default = "last_5m" } -variable "cosmos_db_ru_utilization_message" { - description = "Custom message for Cosmos DB collection RU utilization monitor" - type = "string" - default = "" -} - -variable "cosmos_db_ru_utilization_enabled" { - description = "Flag to enable Cosmos DB collection RU utilization monitor" - type = "string" - default = "true" -} - -variable "cosmos_db_ru_utilization_silenced" { - description = "Groups to mute for Cosmos DB collection RU utilization monitor" - type = "map" - default = {} -} - -variable "cosmos_db_ru_utilization_rate_threshold_critical" { - description = "Critical threshold for Cosmos DB collection RU utilization monitor" - default = 90 -} - -variable "cosmos_db_ru_utilization_rate_threshold_warning" { - description = "Warning threshold for Cosmos DB collection RU utilization monitor" - default = 80 -} - -variable "cosmos_db_ru_utilization_extra_tags" { - description = "Extra tags for Cosmos DB collection RU utilization monitor" - type = "list" - default = [] -} - -variable "cosmos_db_ru_utilization_time_aggregator" { - description = "Monitor aggregator for Cosmos DB RU utilization [available values: min, max or avg]" - type = "string" - default = "sum" -} - -variable "cosmos_db_ru_utilization_timeframe" { - description = "Monitor timeframe for Cosmos DB RU utilization [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 "cosmos_db_ru_utilization_collections" { - description = "Group to associate Cosmos DB collection to RU max. RU value has to be correlated with the monitor timeframe" - type = "map" -} - # Azure Datalake Store specific variables variable "datalakestore_status_enabled" { description = "Flag to enable Datalake Store status monitor" diff --git a/cloud/azure/monitors.tf b/cloud/azure/monitors.tf index 8fc659b..d044a79 100644 --- a/cloud/azure/monitors.tf +++ b/cloud/azure/monitors.tf @@ -422,16 +422,6 @@ module "cosmosdb" { cosmos_db_5xx_request_rate_extra_tags = "${var.cosmos_db_5xx_request_rate_extra_tags}" cosmos_db_5xx_request_time_aggregator = "${var.cosmos_db_5xx_request_time_aggregator}" cosmos_db_5xx_request_timeframe = "${var.cosmos_db_5xx_request_timeframe}" - - cosmos_db_ru_utilization_enabled = "${var.cosmos_db_ru_utilization_enabled}" - cosmos_db_ru_utilization_rate_threshold_critical = "${var.cosmos_db_ru_utilization_rate_threshold_critical}" - cosmos_db_ru_utilization_rate_threshold_warning = "${var.cosmos_db_ru_utilization_rate_threshold_warning}" - cosmos_db_ru_utilization_message = "${var.cosmos_db_ru_utilization_message}" - cosmos_db_ru_utilization_silenced = "${var.cosmos_db_ru_utilization_silenced}" - cosmos_db_ru_utilization_extra_tags = "${var.cosmos_db_ru_utilization_extra_tags}" - cosmos_db_ru_utilization_time_aggregator = "${var.cosmos_db_ru_utilization_time_aggregator}" - cosmos_db_ru_utilization_timeframe = "${var.cosmos_db_ru_utilization_timeframe}" - cosmos_db_ru_utilization_collections = "${var.cosmos_db_ru_utilization_collections}" } module "datalakestore" {