From de79f9b3e8449cefa8f63add0f0f4af1cfdc7cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20MARMOL?= Date: Mon, 24 Feb 2020 16:54:07 +0100 Subject: [PATCH] MON-496 Allow customizing group by monitors on Solr template --- database/solr/README.md | 3 +++ database/solr/inputs.tf | 20 +++++++++++++++++++- database/solr/monitors-solr.tf | 8 ++++---- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/database/solr/README.md b/database/solr/README.md index 0c8c1a5..caf5ffc 100644 --- a/database/solr/README.md +++ b/database/solr/README.md @@ -34,6 +34,7 @@ Creates DataDog monitors with the following checks: | new\_host\_delay | Delay in seconds before begin to monitor new host | `number` | `300` | no | | not\_responding\_enabled | Flag to enable Solr does not repsond monitor | `bool` | `true` | no | | not\_responding\_extra\_tags | Extra tags for solr does not respond monitor | `list(string)` | `[]` | no | +| not\_responding\_group\_by | Not responding tags to group data | `list(string)` |
[
"instance"
]
| no | | not\_responding\_message | Custom message for Solr does not respond monitor | `string` | `""` | no | | not\_responding\_no\_data\_timeframe | Solr not responding monitor no data timeframe | `number` | `10` | no | | not\_responding\_threshold\_warning | Solr not responding limit (warning threshold) | `number` | `3` | no | @@ -41,6 +42,7 @@ Creates DataDog monitors with the following checks: | prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | | search\_handler\_errors\_enabled | Flag to enable Solr search handler errors monitor | `bool` | `true` | no | | search\_handler\_errors\_extra\_tags | Extra tags for Search handler errors monitor | `list(string)` | `[]` | no | +| search\_handler\_errors\_group\_by | Search handler errors tags to group datas | `list(string)` |
[
"instance"
]
| no | | search\_handler\_errors\_message | Custom message for Solr search handler errors monitor | `string` | `""` | no | | search\_handler\_errors\_rate\_threshold\_critical | Handler errors rate critical threshold | `number` | `50` | no | | search\_handler\_errors\_rate\_threshold\_warning | Handler errors rate warning threshold | `number` | `10` | no | @@ -49,6 +51,7 @@ Creates DataDog monitors with the following checks: | searcher\_warmup\_time\_aggregator | Time aggregator for the searcher warmup time monitor | `string` | `"max"` | no | | searcher\_warmup\_time\_enabled | Flag to enable Solr searcher warmup time monitor | `bool` | `true` | no | | searcher\_warmup\_time\_extra\_tags | Extra tags for searcher warmum time monitor | `list(string)` | `[]` | no | +| searcher\_warmup\_time\_group\_by | Search warmup time tags to group datas | `list(string)` |
[
"instance"
]
| no | | searcher\_warmup\_time\_message | Custom message for Solr searcher warmup time monitor | `string` | `""` | no | | searcher\_warmup\_time\_threshold\_critical | Searcher warmup time critical threshold in ms | `number` | `5000` | no | | searcher\_warmup\_time\_threshold\_warning | Searcher warmup time warning threshold in ms | `number` | `2000` | no | diff --git a/database/solr/inputs.tf b/database/solr/inputs.tf index ef91cab..9e6ac08 100644 --- a/database/solr/inputs.tf +++ b/database/solr/inputs.tf @@ -55,6 +55,12 @@ variable "not_responding_enabled" { default = true } +variable "not_responding_group_by" { + type = list(string) + description = "Not responding tags to group data" + default = ["instance"] +} + variable "not_responding_message" { description = "Custom message for Solr does not respond monitor" type = string @@ -88,6 +94,12 @@ variable "search_handler_errors_enabled" { default = true } +variable "search_handler_errors_group_by" { + description = "Search handler errors tags to group datas" + type = list(string) + default = ["instance"] +} + variable "search_handler_errors_message" { description = "Custom message for Solr search handler errors monitor" type = string @@ -132,6 +144,12 @@ variable "searcher_warmup_time_enabled" { type = bool } +variable "searcher_warmup_time_group_by" { + default = ["instance"] + description = "Search warmup time tags to group datas" + type = list(string) +} + variable "searcher_warmup_time_message" { description = "Custom message for Solr searcher warmup time monitor" default = "" @@ -168,4 +186,4 @@ variable "searcher_warmup_time_timeframe" { description = "Timeframe for the searcher warmup time monitor" default = "last_5m" type = string -} \ No newline at end of file +} diff --git a/database/solr/monitors-solr.tf b/database/solr/monitors-solr.tf index 15a9417..26107cc 100644 --- a/database/solr/monitors-solr.tf +++ b/database/solr/monitors-solr.tf @@ -9,7 +9,7 @@ resource "datadog_monitor" "not_responding" { type = "service check" query = < ${var.search_handler_errors_rate_threshold_critical} EOQ @@ -81,7 +81,7 @@ resource "datadog_monitor" "searcher_warmup_time" { type = "metric alert" query = <= ${var.searcher_warmup_time_threshold_critical} EOQ @@ -100,4 +100,4 @@ EOQ tags = concat(["env:${var.environment}", "type:database", "provider:solr", "resource:solr", "team:claranet", "created-by:terraform"], var.searcher_warmup_time_extra_tags) -} \ No newline at end of file +}