MON-191 - Mongodb monitors updated with customizable aggregator
This commit is contained in:
parent
2ba79aefea
commit
e2797f7d71
@ -79,6 +79,7 @@ Inputs
|
|||||||
| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no |
|
| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no |
|
||||||
| filter_tags_use_defaults | Use default filter tags convention | string | `true` | no |
|
| filter_tags_use_defaults | Use default filter tags convention | string | `true` | no |
|
||||||
| message | Message sent when an alert is triggered | string | - | yes |
|
| message | Message sent when an alert is triggered | string | - | yes |
|
||||||
|
| mongodb_replicaset_aggregator | Monitor aggregator for Mongodb replicaset [available values: min, max, sum or avg] | string | `avg` | no |
|
||||||
| mongodb_replicaset_message | Custom message for Mongodb replicaset monitor | string | `` | no |
|
| mongodb_replicaset_message | Custom message for Mongodb replicaset monitor | string | `` | no |
|
||||||
| mongodb_replicaset_silenced | Groups to mute for Mongodb replicaset monitor | map | `<map>` | no |
|
| mongodb_replicaset_silenced | Groups to mute for Mongodb replicaset monitor | map | `<map>` | no |
|
||||||
| mongodb_replicaset_timeframe | Monitor timeframe for Mongodb replicaset [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no |
|
| mongodb_replicaset_timeframe | Monitor timeframe for Mongodb replicaset [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no |
|
||||||
|
|||||||
@ -36,6 +36,12 @@ variable "mongodb_replicaset_message" {
|
|||||||
default = ""
|
default = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "mongodb_replicaset_aggregator" {
|
||||||
|
description = "Monitor aggregator for Mongodb replicaset [available values: min, max, sum or avg]"
|
||||||
|
type = "string"
|
||||||
|
default = "avg"
|
||||||
|
}
|
||||||
|
|
||||||
variable "mongodb_replicaset_timeframe" {
|
variable "mongodb_replicaset_timeframe" {
|
||||||
description = "Monitor timeframe for Mongodb replicaset [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
|
description = "Monitor timeframe for Mongodb replicaset [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
|
||||||
type = "string"
|
type = "string"
|
||||||
|
|||||||
@ -11,8 +11,8 @@ resource "datadog_monitor" "mongodb_replicaset_state" {
|
|||||||
message = "${coalesce(var.mongodb_replicaset_message, var.message)}"
|
message = "${coalesce(var.mongodb_replicaset_message, var.message)}"
|
||||||
|
|
||||||
query = <<EOF
|
query = <<EOF
|
||||||
avg(${var.mongodb_replicaset_timeframe}): (
|
${var.mongodb_replicaset_aggregator}(${var.mongodb_replicaset_timeframe}): (
|
||||||
avg:mongodb.replset.health{${data.template_file.filter.rendered}} by {region,replset_name}
|
${var.mongodb_replicaset_aggregator}:mongodb.replset.health{${data.template_file.filter.rendered}} by {region,replset_name}
|
||||||
) < 1
|
) < 1
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user