MON-496 Allow customizing group by monitors on Solr template

This commit is contained in:
Jérémy MARMOL 2020-02-24 16:54:07 +01:00
parent cecf378d05
commit de79f9b3e8
3 changed files with 26 additions and 5 deletions

View File

@ -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)` | <pre>[<br> "instance"<br>]<br></pre> | 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)` | <pre>[<br> "instance"<br>]<br></pre> | 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)` | <pre>[<br> "instance"<br>]<br></pre> | 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 |

View File

@ -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 = ""

View File

@ -9,7 +9,7 @@ resource "datadog_monitor" "not_responding" {
type = "service check"
query = <<EOQ
"solr.can_connect"${module.filter-tags.service_check}.by("instance").last(6).count_by_status()
"solr.can_connect"${module.filter-tags.service_check}.by(${join(",", formatlist("\"%s\"", var.not_responding_group_by))}).last(6).count_by_status()
EOQ
@ -48,7 +48,7 @@ resource "datadog_monitor" "search_handler_errors" {
query = <<EOQ
${var.search_handler_errors_time_aggregator}(${var.search_handler_errors_timeframe}):
default(sum:solr.search_handler.errors${module.filter-tags.query_alert} by {instance}.as_rate(), 0) / default(sum:solr.search_handler.requests${module.filter-tags.query_alert} by {instance}.as_rate(), 1) * 100
default(sum:solr.search_handler.errors${module.filter-tags.query_alert} by {${join(",", var.search_handler_errors_group_by)}}.as_rate(), 0) / default(sum:solr.search_handler.requests${module.filter-tags.query_alert} by {${join(",", var.search_handler_errors_group_by)}}.as_rate(), 1) * 100
> ${var.search_handler_errors_rate_threshold_critical}
EOQ
@ -81,7 +81,7 @@ resource "datadog_monitor" "searcher_warmup_time" {
type = "metric alert"
query = <<EOQ
${var.searcher_warmup_time_aggregator}(${var.searcher_warmup_time_timeframe}):
min:solr.searcher.warmup${module.filter-tags.query_alert} by {instance}
min:solr.searcher.warmup${module.filter-tags.query_alert} by {${join(",", var.searcher_warmup_time_group_by)}}
>= ${var.searcher_warmup_time_threshold_critical}
EOQ