MON-237 Remove Cosmos RU monitor
This commit is contained in:
parent
f7339cc34c
commit
14f798d650
@ -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 | `<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 | `<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 | `<map>` | no |
|
||||
| datalakestore_status_time_aggregator | Monitor aggregator for Datalake Store status [available values: min, max or avg] | string | `max` | no |
|
||||
|
||||
@ -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 | `<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 | `<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 | `<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
|
||||
|
||||
@ -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"
|
||||
}
|
||||
|
||||
@ -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"]
|
||||
}
|
||||
|
||||
@ -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 = <<EOF
|
||||
${var.cosmos_db_4xx_request_time_aggregator}(${var.cosmos_db_4xx_request_timeframe}): (default(
|
||||
(
|
||||
@ -133,41 +134,3 @@ resource "datadog_monitor" "cosmos_db_5xx_requests" {
|
||||
|
||||
tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:cosmos_db", "team:claranet", "created-by:terraform", "${var.cosmos_db_5xx_request_rate_extra_tags}"]
|
||||
}
|
||||
|
||||
resource "datadog_monitor" "cosmos_db_ru_utilization" {
|
||||
count = "${var.cosmos_db_ru_utilization_enabled ? length(var.cosmos_db_ru_utilization_collections) : 0}"
|
||||
|
||||
name = "[${var.environment}] Cosmos DB collection ${element(keys(var.cosmos_db_ru_utilization_collections),count.index)} RU utilization is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
|
||||
message = "${coalesce(var.cosmos_db_ru_utilization_message, var.message)}"
|
||||
|
||||
query = <<EOF
|
||||
${var.cosmos_db_ru_utilization_time_aggregator}(${var.cosmos_db_ru_utilization_timeframe}): (
|
||||
(
|
||||
sum:azure.cosmosdb.total_request_units${format(module.filter-tags-collection.query_alert,lower(element(keys(var.cosmos_db_ru_utilization_collections),count.index)))} by {resource_group,region,name,collectionname} +
|
||||
sum:azure.documentdb_databaseaccounts.total_request_units${format(module.filter-tags-collection.query_alert,lower(element(keys(var.cosmos_db_ru_utilization_collections),count.index)))} by {resource_group,region,name,collectionname}
|
||||
) /
|
||||
${element(values(var.cosmos_db_ru_utilization_collections),count.index)}
|
||||
) * 100 > ${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}"]
|
||||
}
|
||||
|
||||
@ -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}"
|
||||
}
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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" {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user