From 5c6e78c1f29f1123c761ff6a82bfbeb9982393bd Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Tue, 21 Aug 2018 14:09:09 +0200 Subject: [PATCH] MON-281 update tags and add extra tags --- system/generic/README.md | 13 +++++++------ system/generic/inputs.tf | 18 ++++++++++++------ system/generic/monitors-system.tf | 4 ++-- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/system/generic/README.md b/system/generic/README.md index 7635a50..e899b69 100644 --- a/system/generic/README.md +++ b/system/generic/README.md @@ -55,16 +55,17 @@ Creates DataDog monitors with the following checks: | free_disk_space_extra_tags | Extra tags for Free diskspace monitor | list | `` | no | | free_disk_space_forecast_algorithm | Algorithm for the Free diskspace Forecast monitor | string | `linear` | no | | free_disk_space_forecast_deviations | Deviations for the Free diskspace Forecast monitor | string | `1` | no | +| free_disk_space_forecast_extra_tags | Extra tags for Free diskspace forecast monitor | list | `` | no | | free_disk_space_forecast_interval | Interval for the Free diskspace Forecast monitor | string | `60m` | no | | free_disk_space_forecast_linear_history | History for the Free diskspace Forecast monitor | string | `1w` | no | | free_disk_space_forecast_linear_model | Model for the Free diskspace Forecast monitor | string | `default` | no | -| free_disk_space_forecast_message | Custom message for Free diskspace monitor | string | `` | no | +| free_disk_space_forecast_message | Custom message for Free diskspace forecast monitor | string | `` | no | | free_disk_space_forecast_seasonal_seasonality | Seasonality for the Free diskspace Forecast monitor | string | `weekly` | no | -| free_disk_space_forecast_silenced | Groups to mute for Free diskspace monitor | map | `` | no | -| free_disk_space_forecast_threshold_critical | Free disk space critical threshold | string | `80` | no | -| free_disk_space_forecast_threshold_critical_recovery | Free disk space warning threshold | string | `72` | no | -| free_disk_space_forecast_time_aggregator | Monitor aggregator for Free diskspace [available values: min, max or avg] | string | `max` | no | -| free_disk_space_forecast_timeframe | Monitor timeframe for Free diskspace [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `next_1w` | no | +| free_disk_space_forecast_silenced | Groups to mute for Free diskspace forecast monitor | map | `` | no | +| free_disk_space_forecast_threshold_critical | Free disk space forecast critical threshold | string | `80` | no | +| free_disk_space_forecast_threshold_critical_recovery | Free disk space forecast recovery threshold | string | `72` | no | +| free_disk_space_forecast_time_aggregator | Monitor aggregator for Free diskspace forecast [available values: min, max or avg] | string | `max` | no | +| free_disk_space_forecast_timeframe | Monitor timeframe for Free diskspace forecast [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `next_1w` | no | | free_disk_space_message | Custom message for Free diskspace monitor | string | `` | no | | free_disk_space_silenced | Groups to mute for Free diskspace monitor | map | `` | no | | free_disk_space_threshold_critical | Free disk space critical threshold | string | `10` | no | diff --git a/system/generic/inputs.tf b/system/generic/inputs.tf index c2aac7e..991d15f 100644 --- a/system/generic/inputs.tf +++ b/system/generic/inputs.tf @@ -152,25 +152,31 @@ variable "free_disk_space_threshold_critical" { } variable "free_disk_space_forecast_silenced" { - description = "Groups to mute for Free diskspace monitor" + description = "Groups to mute for Free diskspace forecast monitor" type = "map" default = {} } +variable "free_disk_space_forecast_extra_tags" { + description = "Extra tags for Free diskspace forecast monitor" + type = "list" + default = [] +} + variable "free_disk_space_forecast_message" { - description = "Custom message for Free diskspace monitor" + description = "Custom message for Free diskspace forecast monitor" type = "string" default = "" } variable "free_disk_space_forecast_time_aggregator" { - description = "Monitor aggregator for Free diskspace [available values: min, max or avg]" + description = "Monitor aggregator for Free diskspace forecast [available values: min, max or avg]" type = "string" default = "max" } variable "free_disk_space_forecast_timeframe" { - description = "Monitor timeframe for Free diskspace [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" + description = "Monitor timeframe for Free diskspace forecast [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" type = "string" default = "next_1w" } @@ -212,12 +218,12 @@ variable "free_disk_space_forecast_seasonal_seasonality" { } variable "free_disk_space_forecast_threshold_critical_recovery" { - description = "Free disk space warning threshold" + description = "Free disk space forecast recovery threshold" default = 72 } variable "free_disk_space_forecast_threshold_critical" { - description = "Free disk space critical threshold" + description = "Free disk space forecast critical threshold" default = 80 } diff --git a/system/generic/monitors-system.tf b/system/generic/monitors-system.tf index 3edf4de..89db0c4 100644 --- a/system/generic/monitors-system.tf +++ b/system/generic/monitors-system.tf @@ -116,8 +116,6 @@ resource "datadog_monitor" "datadog_free_disk_space_forecast" { critical = "${var.free_disk_space_forecast_threshold_critical}" } - tags = ["env:${var.environment}", "type:system", "resource:disk"] - notify_audit = false locked = false timeout_h = 0 @@ -130,6 +128,8 @@ resource "datadog_monitor" "datadog_free_disk_space_forecast" { new_host_delay = "${var.new_host_delay}" silenced = "${var.free_disk_space_forecast_silenced}" + + tags = ["env:${var.environment}", "type:system", "provider:disk", "resource:generic", "team:claranet", "created-by:terraform", "${var.free_disk_space_forecast_extra_tags}"] } resource "datadog_monitor" "datadog_free_disk_space_inodes_too_low" {