MON-32 remove common module use in redis and memcached

This commit is contained in:
Quentin Manfroi 2018-09-19 19:32:57 +02:00
parent 25fc6076ee
commit 644b292add
4 changed files with 0 additions and 488 deletions

View File

@ -111,200 +111,3 @@ variable "cpu_high_threshold_critical" {
description = "Elasticache memcached cpu high critical threshold in percentage"
default = 90
}
# Elasticache specific
variable "eviction_silenced" {
description = "Groups to mute for Elasticache eviction monitor"
type = "map"
default = {}
}
variable "eviction_enabled" {
description = "Flag to enable Elasticache eviction monitor"
type = "string"
default = "true"
}
variable "eviction_message" {
description = "Custom message for Elasticache eviction monitor"
type = "string"
default = ""
}
variable "eviction_time_aggregator" {
description = "Monitor aggregator for Elasticache eviction [available values: min, max or avg]"
type = "string"
default = "min"
}
variable "eviction_timeframe" {
description = "Monitor timeframe for Elasticache eviction [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_5m"
}
variable "max_connection_silenced" {
description = "Groups to mute for Elasticache max connection monitor"
type = "map"
default = {}
}
variable "max_connection_enabled" {
description = "Flag to enable Elasticache max connection monitor"
type = "string"
default = "true"
}
variable "max_connection_message" {
description = "Custom message for Elasticache max connection monitor"
type = "string"
default = ""
}
variable "max_connection_time_aggregator" {
description = "Monitor aggregator for Elasticache max connection [available values: min, max or avg]"
type = "string"
default = "max"
}
variable "max_connection_timeframe" {
description = "Monitor timeframe for Elasticache max connection [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_5m"
}
variable "no_connection_silenced" {
description = "Groups to mute for Elasticache no connection monitor"
type = "map"
default = {}
}
variable "no_connection_enabled" {
description = "Flag to enable Elasticache no connection monitor"
type = "string"
default = "true"
}
variable "no_connection_message" {
description = "Custom message for Elasticache no connection monitor"
type = "string"
default = ""
}
variable "no_connection_time_aggregator" {
description = "Monitor aggregator for Elasticache no connection [available values: min, max or avg]"
type = "string"
default = "min"
}
variable "no_connection_timeframe" {
description = "Monitor timeframe for Elasticache no connection [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_5m"
}
variable "swap_silenced" {
description = "Groups to mute for Elasticache swap monitor"
type = "map"
default = {}
}
variable "swap_enabled" {
description = "Flag to enable Elasticache swap monitor"
type = "string"
default = "true"
}
variable "swap_message" {
description = "Custom message for Elasticache swap monitor"
type = "string"
default = ""
}
variable "swap_time_aggregator" {
description = "Monitor aggregator for Elasticache memcached swap [available values: min, max or avg]"
type = "string"
default = "min"
}
variable "swap_timeframe" {
description = "Monitor timeframe for Elasticache swap [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_5m"
}
variable "swap_threshold_warning" {
description = "Elasticache swap warning threshold in Bytes"
default = 40000000
}
variable "swap_threshold_critical" {
description = "Elasticache swap critical threshold in Bytes"
default = 50000000
}
variable "free_memory_silenced" {
description = "Groups to mute for Elasticache free memory monitor"
type = "map"
default = {}
}
variable "free_memory_enabled" {
description = "Flag to enable Elasticache free memory monitor"
type = "string"
default = "true"
}
variable "free_memory_message" {
description = "Custom message for Elasticache free memory monitor"
type = "string"
default = ""
}
variable "free_memory_condition_timeframe" {
description = "Monitor condition timeframe for Elasticache free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_15m"
}
variable "free_memory_timeframe" {
description = "Monitor timeframe for Elasticache free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_15m"
}
variable "free_memory_threshold_warning" {
description = "Elasticache free memory warning threshold in percentage"
default = -50
}
variable "free_memory_threshold_critical" {
description = "Elasticache free memory critical threshold in percentage"
default = -70
}
variable "eviction_growing_silenced" {
description = "Groups to mute for Elasticache eviction growing monitor"
type = "map"
default = {}
}
variable "eviction_growing_enabled" {
description = "Flag to enable Elasticache eviction growing monitor"
type = "string"
default = "true"
}
variable "eviction_growing_message" {
description = "Custom message for Elasticache eviction growing monitor"
type = "string"
default = ""
}
variable "eviction_growing_condition_timeframe" {
description = "Monitor condition timeframe for Elasticache eviction growing [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_5m"
}
variable "eviction_growing_timeframe" {
description = "Monitor timeframe for Elasticache eviction growing [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_5m"
}
variable "eviction_growing_threshold_warning" {
description = "Elasticache eviction growing warning threshold in percentage"
default = 10
}
variable "eviction_growing_threshold_critical" {
description = "Elasticache eviction growing critical threshold in percentage"
default = 30
}

View File

@ -1,50 +1,3 @@
module "datadog-monitors-aws-elasticache-common" {
source = "../common"
message = "${var.message}"
environment = "${var.environment}"
filter_tags = "${data.template_file.filter.rendered}"
resource = "memcached"
delay = "${var.evaluation_delay}"
eviction_message = "${var.eviction_message}"
eviction_silenced = "${var.eviction_silenced}"
eviction_time_aggregator = "${var.eviction_time_aggregator}"
eviction_timeframe = "${var.eviction_timeframe}"
eviction_growing_condition_timeframe = "${var.eviction_growing_condition_timeframe}"
eviction_growing_timeframe = "${var.eviction_growing_timeframe}"
eviction_growing_message = "${var.eviction_growing_message}"
eviction_growing_silenced = "${var.eviction_growing_silenced}"
eviction_growing_threshold_warning = "${var.eviction_growing_threshold_warning}"
eviction_growing_threshold_critical = "${var.eviction_growing_threshold_critical}"
free_memory_condition_timeframe = "${var.free_memory_condition_timeframe}"
free_memory_timeframe = "${var.free_memory_timeframe}"
free_memory_message = "${var.free_memory_message}"
free_memory_silenced = "${var.free_memory_silenced}"
free_memory_threshold_critical = "${var.free_memory_threshold_critical}"
free_memory_threshold_warning = "${var.free_memory_threshold_warning}"
max_connection_message = "${var.max_connection_message}"
max_connection_silenced = "${var.max_connection_silenced}"
max_connection_time_aggregator = "${var.max_connection_time_aggregator}"
max_connection_timeframe = "${var.max_connection_timeframe}"
no_connection_message = "${var.no_connection_message}"
no_connection_silenced = "${var.no_connection_silenced}"
no_connection_time_aggregator = "${var.no_connection_time_aggregator}"
no_connection_timeframe = "${var.no_connection_timeframe}"
swap_message = "${var.swap_message}"
swap_silenced = "${var.swap_silenced}"
swap_threshold_critical = "${var.swap_threshold_critical}"
swap_threshold_warning = "${var.swap_threshold_warning}"
swap_time_aggregator = "${var.swap_time_aggregator}"
swap_timeframe = "${var.swap_timeframe}"
}
resource "datadog_monitor" "memcached_get_hits" {
count = "${var.get_hits_enabled ? 1 : 0}"
name = "[${var.environment}] Elasticache memcached get hits {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"

View File

@ -183,200 +183,3 @@ variable "commands_timeframe" {
description = "Monitor timeframe for Elasticache redis commands [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_5m"
}
# Elasticache specific
variable "eviction_silenced" {
description = "Groups to mute for Elasticache eviction monitor"
type = "map"
default = {}
}
variable "eviction_enabled" {
description = "Flag to enable Elasticache eviction monitor"
type = "string"
default = "true"
}
variable "eviction_message" {
description = "Custom message for Elasticache eviction monitor"
type = "string"
default = ""
}
variable "eviction_time_aggregator" {
description = "Monitor aggregator for Elasticache eviction [available values: min, max or avg]"
type = "string"
default = "min"
}
variable "eviction_timeframe" {
description = "Monitor timeframe for Elasticache eviction [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_5m"
}
variable "max_connection_silenced" {
description = "Groups to mute for Elasticache max connection monitor"
type = "map"
default = {}
}
variable "max_connection_enabled" {
description = "Flag to enable Elasticache max connection monitor"
type = "string"
default = "true"
}
variable "max_connection_message" {
description = "Custom message for Elasticache max connection monitor"
type = "string"
default = ""
}
variable "max_connection_time_aggregator" {
description = "Monitor aggregator for Elasticache max connection [available values: min, max or avg]"
type = "string"
default = "max"
}
variable "max_connection_timeframe" {
description = "Monitor timeframe for Elasticache max connection [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_5m"
}
variable "no_connection_silenced" {
description = "Groups to mute for Elasticache no connection monitor"
type = "map"
default = {}
}
variable "no_connection_enabled" {
description = "Flag to enable Elasticache no connection monitor"
type = "string"
default = "true"
}
variable "no_connection_message" {
description = "Custom message for Elasticache no connection monitor"
type = "string"
default = ""
}
variable "no_connection_time_aggregator" {
description = "Monitor aggregator for Elasticache no connection [available values: min, max or avg]"
type = "string"
default = "min"
}
variable "no_connection_timeframe" {
description = "Monitor timeframe for Elasticache no connection [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_5m"
}
variable "swap_silenced" {
description = "Groups to mute for Elasticache swap monitor"
type = "map"
default = {}
}
variable "swap_enabled" {
description = "Flag to enable Elasticache swap monitor"
type = "string"
default = "true"
}
variable "swap_message" {
description = "Custom message for Elasticache swap monitor"
type = "string"
default = ""
}
variable "swap_time_aggregator" {
description = "Monitor aggregator for Elasticache memcached swap [available values: min, max or avg]"
type = "string"
default = "min"
}
variable "swap_timeframe" {
description = "Monitor timeframe for Elasticache swap [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_5m"
}
variable "swap_threshold_warning" {
description = "Elasticache swap warning threshold in Bytes"
default = 40000000
}
variable "swap_threshold_critical" {
description = "Elasticache swap critical threshold in Bytes"
default = 50000000
}
variable "free_memory_silenced" {
description = "Groups to mute for Elasticache free memory monitor"
type = "map"
default = {}
}
variable "free_memory_enabled" {
description = "Flag to enable Elasticache free memory monitor"
type = "string"
default = "true"
}
variable "free_memory_message" {
description = "Custom message for Elasticache free memory monitor"
type = "string"
default = ""
}
variable "free_memory_condition_timeframe" {
description = "Monitor condition timeframe for Elasticache free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_15m"
}
variable "free_memory_timeframe" {
description = "Monitor timeframe for Elasticache free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_15m"
}
variable "free_memory_threshold_warning" {
description = "Elasticache free memory warning threshold in percentage"
default = -50
}
variable "free_memory_threshold_critical" {
description = "Elasticache free memory critical threshold in percentage"
default = -70
}
variable "eviction_growing_silenced" {
description = "Groups to mute for Elasticache eviction growing monitor"
type = "map"
default = {}
}
variable "eviction_growing_enabled" {
description = "Flag to enable Elasticache eviction growing monitor"
type = "string"
default = "true"
}
variable "eviction_growing_message" {
description = "Custom message for Elasticache eviction growing monitor"
type = "string"
default = ""
}
variable "eviction_growing_condition_timeframe" {
description = "Monitor condition timeframe for Elasticache eviction growing [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_5m"
}
variable "eviction_growing_timeframe" {
description = "Monitor timeframe for Elasticache eviction growing [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_5m"
}
variable "eviction_growing_threshold_warning" {
description = "Elasticache eviction growing warning threshold in percentage"
default = 10
}
variable "eviction_growing_threshold_critical" {
description = "Elasticache eviction growing critical threshold in percentage"
default = 30
}

View File

@ -1,50 +1,3 @@
module "datadog-monitors-aws-elasticache-common" {
source = "../common"
message = "${var.message}"
environment = "${var.environment}"
filter_tags = "${data.template_file.filter.rendered}"
resource = "redis"
delay = "${var.evaluation_delay}"
eviction_message = "${var.eviction_message}"
eviction_silenced = "${var.eviction_silenced}"
eviction_time_aggregator = "${var.eviction_time_aggregator}"
eviction_timeframe = "${var.eviction_timeframe}"
eviction_growing_condition_timeframe = "${var.eviction_growing_condition_timeframe}"
eviction_growing_timeframe = "${var.eviction_growing_timeframe}"
eviction_growing_message = "${var.eviction_growing_message}"
eviction_growing_silenced = "${var.eviction_growing_silenced}"
eviction_growing_threshold_warning = "${var.eviction_growing_threshold_warning}"
eviction_growing_threshold_critical = "${var.eviction_growing_threshold_critical}"
free_memory_condition_timeframe = "${var.free_memory_condition_timeframe}"
free_memory_timeframe = "${var.free_memory_timeframe}"
free_memory_message = "${var.free_memory_message}"
free_memory_silenced = "${var.free_memory_silenced}"
free_memory_threshold_critical = "${var.free_memory_threshold_critical}"
free_memory_threshold_warning = "${var.free_memory_threshold_warning}"
max_connection_message = "${var.max_connection_message}"
max_connection_silenced = "${var.max_connection_silenced}"
max_connection_time_aggregator = "${var.max_connection_time_aggregator}"
max_connection_timeframe = "${var.max_connection_timeframe}"
no_connection_message = "${var.no_connection_message}"
no_connection_silenced = "${var.no_connection_silenced}"
no_connection_time_aggregator = "${var.no_connection_time_aggregator}"
no_connection_timeframe = "${var.no_connection_timeframe}"
swap_message = "${var.swap_message}"
swap_silenced = "${var.swap_silenced}"
swap_threshold_critical = "${var.swap_threshold_critical}"
swap_threshold_warning = "${var.swap_threshold_warning}"
swap_time_aggregator = "${var.swap_time_aggregator}"
swap_timeframe = "${var.swap_timeframe}"
}
resource "datadog_monitor" "redis_cache_hits" {
count = "${var.cache_hits_enabled ? 1 : 0}"
name = "[${var.environment}] Elasticache redis cache hits {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"