From e2797f7d712a4733af279cc73e41f0362c3c5b1c Mon Sep 17 00:00:00 2001 From: Alexandre Gaillet Date: Mon, 30 Apr 2018 15:30:19 +0200 Subject: [PATCH] MON-191 - Mongodb monitors updated with customizable aggregator --- databases/mongodb/README.md | 1 + databases/mongodb/inputs.tf | 6 ++++++ databases/mongodb/monitors-mongo.tf | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/databases/mongodb/README.md b/databases/mongodb/README.md index fc521cd..c5d78e2 100644 --- a/databases/mongodb/README.md +++ b/databases/mongodb/README.md @@ -79,6 +79,7 @@ Inputs | 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 | | 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_silenced | Groups to mute for Mongodb replicaset monitor | 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 | diff --git a/databases/mongodb/inputs.tf b/databases/mongodb/inputs.tf index 46cf5ee..b67f68c 100644 --- a/databases/mongodb/inputs.tf +++ b/databases/mongodb/inputs.tf @@ -36,6 +36,12 @@ variable "mongodb_replicaset_message" { 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" { 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" diff --git a/databases/mongodb/monitors-mongo.tf b/databases/mongodb/monitors-mongo.tf index 5357aeb..edac73d 100644 --- a/databases/mongodb/monitors-mongo.tf +++ b/databases/mongodb/monitors-mongo.tf @@ -11,8 +11,8 @@ resource "datadog_monitor" "mongodb_replicaset_state" { message = "${coalesce(var.mongodb_replicaset_message, var.message)}" query = <