MON-32 - Space aggregator hard coded

This commit is contained in:
Alexandre Gaillet 2018-05-23 11:25:15 +02:00 committed by Quentin Manfroi
parent 52c71698fe
commit dfd41cb779
9 changed files with 61 additions and 82 deletions

View File

@ -33,19 +33,19 @@ Inputs
|------|-------------|:----:|:-----:|:-----:| |------|-------------|:----:|:-----:|:-----:|
| delay | Delay in seconds for the metric evaluation | string | `900` | no | | delay | Delay in seconds for the metric evaluation | string | `900` | no |
| environment | Architecture Environment | string | - | yes | | environment | Architecture Environment | string | - | yes |
| eviction_aggregator | Monitor aggregator for Elasticache eviction [available values: min, max, sum or avg] | string | `min` | no |
| eviction_message | Custom message for Elasticache eviction monitor | string | `` | no | | eviction_message | Custom message for Elasticache eviction monitor | string | `` | no |
| eviction_silenced | Groups to mute for Elasticache eviction monitor | map | `<map>` | no | | eviction_silenced | Groups to mute for Elasticache eviction monitor | map | `<map>` | no |
| eviction_time_aggregator | Monitor aggregator for Elasticache eviction [available values: min, max or avg] | string | `min` | no |
| eviction_timeframe | Monitor timeframe for Elasticache eviction [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | eviction_timeframe | Monitor timeframe for Elasticache eviction [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no |
| filter_tags | Tags used for filtering | string | - | yes | | filter_tags | Tags used for filtering | string | - | yes |
| max_connection_aggregator | Monitor aggregator for Elasticache max connection [available values: min, max, sum or avg] | string | `min` | no |
| max_connection_message | Custom message for Elasticache max connection monitor | string | `` | no | | max_connection_message | Custom message for Elasticache max connection monitor | string | `` | no |
| max_connection_silenced | Groups to mute for Elasticache max connection monitor | map | `<map>` | no | | max_connection_silenced | Groups to mute for Elasticache max connection monitor | map | `<map>` | no |
| max_connection_time_aggregator | Monitor aggregator for Elasticache max connection [available values: min, max or avg] | string | `min` | no |
| max_connection_timeframe | 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`] | string | `last_5m` | no | | max_connection_timeframe | 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`] | string | `last_5m` | no |
| message | Message sent when an alert is triggered | string | - | yes | | message | Message sent when an alert is triggered | string | - | yes |
| no_connection_aggregator | Monitor aggregator for Elasticache no connection [available values: min, max, sum or avg] | string | `min` | no |
| no_connection_message | Custom message for Elasticache no connection monitor | string | `` | no | | no_connection_message | Custom message for Elasticache no connection monitor | string | `` | no |
| no_connection_silenced | Groups to mute for Elasticache no connection monitor | map | `<map>` | no | | no_connection_silenced | Groups to mute for Elasticache no connection monitor | map | `<map>` | no |
| no_connection_time_aggregator | Monitor aggregator for Elasticache no connection [available values: min, max or avg] | string | `min` | no |
| no_connection_timeframe | 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`] | string | `last_5m` | no | | no_connection_timeframe | 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`] | string | `last_5m` | no |
| resource | Type of Elasticache used | string | - | yes | | resource | Type of Elasticache used | string | - | yes |

View File

@ -35,8 +35,8 @@ variable "eviction_message" {
default = "" default = ""
} }
variable "eviction_aggregator" { variable "eviction_time_aggregator" {
description = "Monitor aggregator for Elasticache eviction [available values: min, max, sum or avg]" description = "Monitor aggregator for Elasticache eviction [available values: min, max or avg]"
type = "string" type = "string"
default = "min" default = "min"
} }
@ -58,8 +58,8 @@ variable "max_connection_message" {
default = "" default = ""
} }
variable "max_connection_aggregator" { variable "max_connection_time_aggregator" {
description = "Monitor aggregator for Elasticache max connection [available values: min, max, sum or avg]" description = "Monitor aggregator for Elasticache max connection [available values: min, max or avg]"
type = "string" type = "string"
default = "min" default = "min"
} }
@ -81,8 +81,8 @@ variable "no_connection_message" {
default = "" default = ""
} }
variable "no_connection_aggregator" { variable "no_connection_time_aggregator" {
description = "Monitor aggregator for Elasticache no connection [available values: min, max, sum or avg]" description = "Monitor aggregator for Elasticache no connection [available values: min, max or avg]"
type = "string" type = "string"
default = "min" default = "min"
} }

View File

@ -5,8 +5,8 @@ resource "datadog_monitor" "elasticache_eviction" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
${var.eviction_aggregator}(${var.eviction_timeframe}): ( ${var.eviction_time_aggregator}(${var.eviction_timeframe}): (
${var.eviction_aggregator}:aws.elasticache.evictions{${var.filter_tags}} by {region,cluster} avg:aws.elasticache.evictions{${var.filter_tags}} by {region,cluster}
) > 0 ) > 0
EOF EOF
@ -32,8 +32,8 @@ resource "datadog_monitor" "elasticache_max_connection" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
${var.max_connection_aggregator}(${var.max_connection_timeframe}): ( ${var.max_connection_time_aggregator}(${var.max_connection_timeframe}): (
${var.max_connection_aggregator}:aws.elasticache.curr_connections{${var.filter_tags}} by {region,cluster} avg:aws.elasticache.curr_connections{${var.filter_tags}} by {region,cluster}
) >= 65000 ) >= 65000
EOF EOF
@ -59,8 +59,8 @@ resource "datadog_monitor" "elasticache_no_connection" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
${var.no_connection_aggregator}(${var.no_connection_timeframe}): ( ${var.no_connection_time_aggregator}(${var.no_connection_timeframe}): (
${var.no_connection_aggregator}:aws.elasticache.curr_connections{${var.filter_tags}} by {region,cluster} avg:aws.elasticache.curr_connections{${var.filter_tags}} by {region,cluster}
) <= 0 ) <= 0
EOF EOF

View File

@ -29,35 +29,34 @@ Inputs
| Name | Description | Type | Default | Required | | Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:| |------|-------------|:----:|:-----:|:-----:|
| cpu_high_aggregator | Monitor aggregator for Elasticache memcached cpu high [available values: min, max, sum or avg] | string | `min` | no |
| cpu_high_message | Custom message for Elasticache memcached cpu high monitor | string | `` | no | | cpu_high_message | Custom message for Elasticache memcached cpu high monitor | string | `` | no |
| cpu_high_silenced | Groups to mute for Elasticache memcached cpu high monitor | map | `<map>` | no | | cpu_high_silenced | Groups to mute for Elasticache memcached cpu high monitor | map | `<map>` | no |
| cpu_high_threshold_critical | Elasticache memcached cpu high critical threshold in percentage | string | `90` | no | | cpu_high_threshold_critical | Elasticache memcached cpu high critical threshold in percentage | string | `90` | no |
| cpu_high_threshold_warning | Elasticache memcached cpu high warning threshold in percentage | string | `75` | no | | cpu_high_threshold_warning | Elasticache memcached cpu high warning threshold in percentage | string | `75` | no |
| cpu_high_time_aggregator | Monitor aggregator for Elasticache memcached cpu high [available values: min, max or avg] | string | `min` | no |
| cpu_high_timeframe | Monitor timeframe for Elasticache memcached cpu high [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | | cpu_high_timeframe | Monitor timeframe for Elasticache memcached cpu high [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no |
| delay | Delay in seconds for the metric evaluation | string | `900` | no | | delay | Delay in seconds for the metric evaluation | string | `900` | no |
| elasticache_size | Size of the Elasticache instance | string | - | yes | | elasticache_size | Size of the Elasticache instance | string | - | yes |
| environment | Architecture Environment | string | - | yes | | environment | Architecture Environment | string | - | yes |
| 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 |
| free_memory_aggregator | Monitor aggregator for Elasticache memcached free memory [available values: min, max, sum or avg] | string | `min` | no |
| free_memory_message | Custom message for Elasticache memcached free memory monitor | string | `` | no | | free_memory_message | Custom message for Elasticache memcached free memory monitor | string | `` | no |
| free_memory_silenced | Groups to mute for Elasticache memcached free memory monitor | map | `<map>` | no | | free_memory_silenced | Groups to mute for Elasticache memcached free memory monitor | map | `<map>` | no |
| free_memory_threshold_critical | Elasticache memcached free memory critical threshold in percentage | string | `5` | no | | free_memory_threshold_critical | Elasticache memcached free memory critical threshold in percentage | string | `5` | no |
| free_memory_threshold_warning | Elasticache memcached free memory warning threshold in percentage | string | `10` | no | | free_memory_threshold_warning | Elasticache memcached free memory warning threshold in percentage | string | `10` | no |
| free_memory_time_aggregator | Monitor aggregator for Elasticache memcached free memory [available values: min, max or avg] | string | `min` | no |
| free_memory_timeframe | Monitor timeframe for Elasticache memcached free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | | free_memory_timeframe | Monitor timeframe for Elasticache memcached free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no |
| get_hits_aggregator | Monitor aggregator for Elasticache memcached get hits [available values: min, max, sum or avg] | string | `min` | no |
| get_hits_message | Custom message for Elasticache memcached get hits monitor | string | `` | no | | get_hits_message | Custom message for Elasticache memcached get hits monitor | string | `` | no |
| get_hits_silenced | Groups to mute for Elasticache memcached get hits monitor | map | `<map>` | no | | get_hits_silenced | Groups to mute for Elasticache memcached get hits monitor | map | `<map>` | no |
| get_hits_threshold_critical | Elasticache memcached get hits critical threshold in percentage | string | `10` | no | | get_hits_threshold_critical | Elasticache memcached get hits critical threshold in percentage | string | `10` | no |
| get_hits_threshold_warning | Elasticache memcached get hits warning threshold in percentage | string | `20` | no | | get_hits_threshold_warning | Elasticache memcached get hits warning threshold in percentage | string | `20` | no |
| get_hits_timeframe | Monitor timeframe for Elasticache memcached get hits [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | | get_hits_timeframe | Monitor timeframe for Elasticache memcached get hits [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no |
| message | Message sent when an alert is triggered | string | - | yes | | message | Message sent when an alert is triggered | string | - | yes |
| swap_aggregator | Monitor aggregator for Elasticache memcached swap [available values: min, max, sum or avg] | string | `min` | no |
| swap_message | Custom message for Elasticache memcached swap monitor | string | `` | no | | swap_message | Custom message for Elasticache memcached swap monitor | string | `` | no |
| swap_silenced | Groups to mute for Elasticache memcached swap monitor | map | `<map>` | no | | swap_silenced | Groups to mute for Elasticache memcached swap monitor | map | `<map>` | no |
| swap_threshold_critical | Elasticache memcached swap critical threshold in percentage | string | `50` | no | | swap_threshold_critical | Elasticache memcached swap critical threshold in percentage | string | `50` | no |
| swap_threshold_warning | Elasticache memcached swap warning threshold in percentage | string | `0` | no | | swap_threshold_warning | Elasticache memcached swap warning threshold in percentage | string | `0` | no |
| swap_time_aggregator | Monitor aggregator for Elasticache memcached swap [available values: min, max or avg] | string | `min` | no |
| swap_timeframe | Monitor timeframe for Elasticache memcached swap [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | swap_timeframe | Monitor timeframe for Elasticache memcached swap [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no |
Related documentation Related documentation

View File

@ -43,12 +43,6 @@ variable "get_hits_message" {
default = "" default = ""
} }
variable "get_hits_aggregator" {
description = "Monitor aggregator for Elasticache memcached get hits [available values: min, max, sum or avg]"
type = "string"
default = "min"
}
variable "get_hits_timeframe" { variable "get_hits_timeframe" {
description = "Monitor timeframe for Elasticache memcached get hits [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for Elasticache memcached get hits [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_15m" default = "last_15m"
@ -76,8 +70,8 @@ variable "cpu_high_message" {
default = "" default = ""
} }
variable "cpu_high_aggregator" { variable "cpu_high_time_aggregator" {
description = "Monitor aggregator for Elasticache memcached cpu high [available values: min, max, sum or avg]" description = "Monitor aggregator for Elasticache memcached cpu high [available values: min, max or avg]"
type = "string" type = "string"
default = "min" default = "min"
} }
@ -109,8 +103,8 @@ variable "swap_message" {
default = "" default = ""
} }
variable "swap_aggregator" { variable "swap_time_aggregator" {
description = "Monitor aggregator for Elasticache memcached swap [available values: min, max, sum or avg]" description = "Monitor aggregator for Elasticache memcached swap [available values: min, max or avg]"
type = "string" type = "string"
default = "min" default = "min"
} }
@ -142,8 +136,8 @@ variable "free_memory_message" {
default = "" default = ""
} }
variable "free_memory_aggregator" { variable "free_memory_time_aggregator" {
description = "Monitor aggregator for Elasticache memcached free memory [available values: min, max, sum or avg]" description = "Monitor aggregator for Elasticache memcached free memory [available values: min, max or avg]"
type = "string" type = "string"
default = "min" default = "min"
} }

View File

@ -22,10 +22,10 @@ resource "datadog_monitor" "memcached_get_hits" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
${var.get_hits_aggregator}(${var.get_hits_timeframe}): ( sum(${var.get_hits_timeframe}): (
${var.get_hits_aggregator}:aws.elasticache.get_hits{${data.template_file.filter.rendered}} by {region,cluster} / avg:aws.elasticache.get_hits{${data.template_file.filter.rendered}} by {region,cluster}.as_count() /
(${var.get_hits_aggregator}:aws.elasticache.get_hits{${data.template_file.filter.rendered}} by {region,cluster} + (avg:aws.elasticache.get_hits{${data.template_file.filter.rendered}} by {region,cluster}.as_count() +
${var.get_hits_aggregator}:aws.elasticache.get_misses{${data.template_file.filter.rendered}} by {region,cluster}) avg:aws.elasticache.get_misses{${data.template_file.filter.rendered}} by {region,cluster}.as_count())
) < ${var.get_hits_threshold_critical} ) < ${var.get_hits_threshold_critical}
EOF EOF
@ -56,8 +56,8 @@ resource "datadog_monitor" "memcached_cpu_high" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
${var.cpu_high_aggregator}(${var.cpu_high_timeframe}): ( ${var.cpu_high_time_aggregator}(${var.cpu_high_timeframe}): (
${var.cpu_high_aggregator}:aws.elasticache.cpuutilization{${data.template_file.filter.rendered}} by {region,cluster,node} avg:aws.elasticache.cpuutilization{${data.template_file.filter.rendered}} by {region,cluster,node}
) > ${var.cpu_high_threshold_critical} ) > ${var.cpu_high_threshold_critical}
EOF EOF
@ -88,8 +88,8 @@ resource "datadog_monitor" "memcached_swap" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
${var.swap_aggregator}(${var.swap_timeframe}): ( ${var.swap_time_aggregator}(${var.swap_timeframe}): (
${var.swap_aggregator}:aws.elasticache.swap_usage{${data.template_file.filter.rendered}} by {region,cluster} avg:aws.elasticache.swap_usage{${data.template_file.filter.rendered}} by {region,cluster}
) > ${var.swap_threshold_critical} ) > ${var.swap_threshold_critical}
EOF EOF
@ -120,8 +120,8 @@ resource "datadog_monitor" "memcached_free_memory" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
${var.free_memory_aggregator}(${var.free_memory_timeframe}): ( ${var.free_memory_time_aggregator}(${var.free_memory_timeframe}): (
${var.free_memory_aggregator}:aws.elasticache.freeable_memory{${data.template_file.filter.rendered}} by {region,cluster,node} / avg:aws.elasticache.freeable_memory{${data.template_file.filter.rendered}} by {region,cluster,node} /
${local.memory[var.elasticache_size]} * 100 ${local.memory[var.elasticache_size]} * 100
) < ${var.free_memory_threshold_critical} ) < ${var.free_memory_threshold_critical}
EOF EOF

View File

@ -41,44 +41,42 @@ Inputs
| Name | Description | Type | Default | Required | | Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:| |------|-------------|:----:|:-----:|:-----:|
| cache_hits_aggregator | Monitor aggregator for Elasticache redis cache hits [available values: min, max, sum or avg] | string | `min` | no |
| cache_hits_message | Custom message for Elasticache redis cache hits monitor | string | `` | no | | cache_hits_message | Custom message for Elasticache redis cache hits monitor | string | `` | no |
| cache_hits_silenced | Groups to mute for Elasticache redis cache hits monitor | map | `<map>` | no | | cache_hits_silenced | Groups to mute for Elasticache redis cache hits monitor | map | `<map>` | no |
| cache_hits_threshold_critical | Elasticache redis cache hits critical threshold in percentage | string | `10` | no | | cache_hits_threshold_critical | Elasticache redis cache hits critical threshold in percentage | string | `10` | no |
| cache_hits_threshold_warning | Elasticache redis cache hits warning threshold in percentage | string | `20` | no | | cache_hits_threshold_warning | Elasticache redis cache hits warning threshold in percentage | string | `20` | no |
| cache_hits_timeframe | Monitor timeframe for Elasticache redis cache hits [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | | cache_hits_timeframe | Monitor timeframe for Elasticache redis cache hits [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no |
| commands_aggregator | Monitor aggregator for Elasticache redis commands [available values: min, max, sum or avg] | string | `min` | no |
| commands_message | Custom message for Elasticache redis commands monitor | string | `` | no | | commands_message | Custom message for Elasticache redis commands monitor | string | `` | no |
| commands_silenced | Groups to mute for Elasticache redis commands monitor | map | `<map>` | no | | commands_silenced | Groups to mute for Elasticache redis commands monitor | map | `<map>` | no |
| commands_timeframe | 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`] | string | `last_5m` | no | | commands_timeframe | 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`] | string | `last_5m` | no |
| cpu_high_aggregator | Monitor aggregator for Elasticache redis cpu high [available values: min, max, sum or avg] | string | `min` | no |
| cpu_high_message | Custom message for Elasticache redis cpu high monitor | string | `` | no | | cpu_high_message | Custom message for Elasticache redis cpu high monitor | string | `` | no |
| cpu_high_silenced | Groups to mute for Elasticache redis cpu high monitor | map | `<map>` | no | | cpu_high_silenced | Groups to mute for Elasticache redis cpu high monitor | map | `<map>` | no |
| cpu_high_threshold_critical | Elasticache redis cpu high critical threshold in percentage | string | `90` | no | | cpu_high_threshold_critical | Elasticache redis cpu high critical threshold in percentage | string | `90` | no |
| cpu_high_threshold_warning | Elasticache redis cpu high warning threshold in percentage | string | `75` | no | | cpu_high_threshold_warning | Elasticache redis cpu high warning threshold in percentage | string | `75` | no |
| cpu_high_time_aggregator | Monitor aggregator for Elasticache redis cpu high [available values: min, max or avg] | string | `min` | no |
| cpu_high_timeframe | Monitor timeframe for Elasticache redis cpu high [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | | cpu_high_timeframe | Monitor timeframe for Elasticache redis cpu high [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no |
| delay | Delay in seconds for the metric evaluation | string | `900` | no | | delay | Delay in seconds for the metric evaluation | string | `900` | no |
| elasticache_size | Size of the Elasticache instance | string | - | yes | | elasticache_size | Size of the Elasticache instance | string | - | yes |
| environment | Architecture Environment | string | - | yes | | environment | Architecture Environment | string | - | yes |
| 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 |
| free_memory_aggregator | Monitor aggregator for Elasticache redis free memory [available values: min, max, sum or avg] | string | `min` | no |
| free_memory_message | Custom message for Elasticache redis free memory monitor | string | `` | no | | free_memory_message | Custom message for Elasticache redis free memory monitor | string | `` | no |
| free_memory_silenced | Groups to mute for Elasticache redis free memory monitor | map | `<map>` | no | | free_memory_silenced | Groups to mute for Elasticache redis free memory monitor | map | `<map>` | no |
| free_memory_threshold_critical | Elasticache redis free memory critical threshold in percentage | string | `5` | no | | free_memory_threshold_critical | Elasticache redis free memory critical threshold in percentage | string | `5` | no |
| free_memory_threshold_warning | Elasticache redis free memory warning threshold in percentage | string | `10` | no | | free_memory_threshold_warning | Elasticache redis free memory warning threshold in percentage | string | `10` | no |
| free_memory_time_aggregator | Monitor aggregator for Elasticache redis free memory [available values: min, max or avg] | string | `min` | no |
| free_memory_timeframe | Monitor timeframe for Elasticache redis free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | | free_memory_timeframe | Monitor timeframe for Elasticache redis free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no |
| message | Message sent when an alert is triggered | string | - | yes | | message | Message sent when an alert is triggered | string | - | yes |
| nodes | Number of Elasticache nodes | string | - | yes | | nodes | Number of Elasticache nodes | string | - | yes |
| replication_lag_aggregator | Monitor aggregator for Elasticache redis replication lag [available values: min, max, sum or avg] | string | `min` | no |
| replication_lag_message | Custom message for Elasticache redis replication lag monitor | string | `` | no | | replication_lag_message | Custom message for Elasticache redis replication lag monitor | string | `` | no |
| replication_lag_silenced | Groups to mute for Elasticache redis replication lag monitor | map | `<map>` | no | | replication_lag_silenced | Groups to mute for Elasticache redis replication lag monitor | map | `<map>` | no |
| replication_lag_threshold_critical | Elasticache redis replication lag critical threshold in seconds | string | `1` | no | | replication_lag_threshold_critical | Elasticache redis replication lag critical threshold in seconds | string | `1` | no |
| replication_lag_threshold_warning | Elasticache redis replication lag warning threshold in seconds | string | `0` | no | | replication_lag_threshold_warning | Elasticache redis replication lag warning threshold in seconds | string | `0` | no |
| replication_lag_time_aggregator | Monitor aggregator for Elasticache redis replication lag [available values: min, max or avg] | string | `min` | no |
| replication_lag_timeframe | Monitor timeframe for Elasticache redis replication lag [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | replication_lag_timeframe | Monitor timeframe for Elasticache redis replication lag [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no |
| swap_aggregator | Monitor aggregator for Elasticache redis swap [available values: min, max, sum or avg] | string | `min` | no |
| swap_message | Custom message for Elasticache redis swap monitor | string | `` | no | | swap_message | Custom message for Elasticache redis swap monitor | string | `` | no |
| swap_silenced | Groups to mute for Elasticache redis swap monitor | map | `<map>` | no | | swap_silenced | Groups to mute for Elasticache redis swap monitor | map | `<map>` | no |
| swap_time_aggregator | Monitor aggregator for Elasticache redis swap [available values: min, max or avg] | string | `min` | no |
| swap_timeframe | Monitor timeframe for Elasticache redis swap [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | swap_timeframe | Monitor timeframe for Elasticache redis swap [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no |
Related documentation Related documentation

View File

@ -48,12 +48,6 @@ variable "cache_hits_message" {
default = "" default = ""
} }
variable "cache_hits_aggregator" {
description = "Monitor aggregator for Elasticache redis cache hits [available values: min, max, sum or avg]"
type = "string"
default = "min"
}
variable "cache_hits_timeframe" { variable "cache_hits_timeframe" {
description = "Monitor timeframe for Elasticache redis cache hits [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" description = "Monitor timeframe for Elasticache redis cache hits [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]"
default = "last_15m" default = "last_15m"
@ -81,8 +75,8 @@ variable "cpu_high_message" {
default = "" default = ""
} }
variable "cpu_high_aggregator" { variable "cpu_high_time_aggregator" {
description = "Monitor aggregator for Elasticache redis cpu high [available values: min, max, sum or avg]" description = "Monitor aggregator for Elasticache redis cpu high [available values: min, max or avg]"
type = "string" type = "string"
default = "min" default = "min"
} }
@ -114,8 +108,8 @@ variable "swap_message" {
default = "" default = ""
} }
variable "swap_aggregator" { variable "swap_time_aggregator" {
description = "Monitor aggregator for Elasticache redis swap [available values: min, max, sum or avg]" description = "Monitor aggregator for Elasticache redis swap [available values: min, max or avg]"
type = "string" type = "string"
default = "min" default = "min"
} }
@ -137,8 +131,8 @@ variable "replication_lag_message" {
default = "" default = ""
} }
variable "replication_lag_aggregator" { variable "replication_lag_time_aggregator" {
description = "Monitor aggregator for Elasticache redis replication lag [available values: min, max, sum or avg]" description = "Monitor aggregator for Elasticache redis replication lag [available values: min, max or avg]"
type = "string" type = "string"
default = "min" default = "min"
} }
@ -170,12 +164,6 @@ variable "commands_message" {
default = "" default = ""
} }
variable "commands_aggregator" {
description = "Monitor aggregator for Elasticache redis commands [available values: min, max, sum or avg]"
type = "string"
default = "min"
}
variable "commands_timeframe" { 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`]" 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" default = "last_5m"
@ -193,8 +181,8 @@ variable "free_memory_message" {
default = "" default = ""
} }
variable "free_memory_aggregator" { variable "free_memory_time_aggregator" {
description = "Monitor aggregator for Elasticache redis free memory [available values: min, max, sum or avg]" description = "Monitor aggregator for Elasticache redis free memory [available values: min, max or avg]"
type = "string" type = "string"
default = "min" default = "min"
} }

View File

@ -22,10 +22,10 @@ resource "datadog_monitor" "redis_cache_hits" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
${var.cache_hits_aggregator}(${var.cache_hits_timeframe}): ( sum(${var.cache_hits_timeframe}): (
${var.cache_hits_aggregator}:aws.elasticache.cache_hits{${data.template_file.filter.rendered}} by {region,cluster} / avg:aws.elasticache.cache_hits{${data.template_file.filter.rendered}} by {region,cluster}.as_count() /
(${var.cache_hits_aggregator}:aws.elasticache.cache_hits{${data.template_file.filter.rendered}} by {region,cluster} + (avg:aws.elasticache.cache_hits{${data.template_file.filter.rendered}} by {region,cluster}.as_count() +
${var.cache_hits_aggregator}:aws.elasticache.cache_misses{${data.template_file.filter.rendered}} by {region,cluster}) avg:aws.elasticache.cache_misses{${data.template_file.filter.rendered}} by {region,cluster}.as_count())
) < ${var.cache_hits_threshold_critical} ) < ${var.cache_hits_threshold_critical}
EOF EOF
@ -56,8 +56,8 @@ resource "datadog_monitor" "redis_cpu_high" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
${var.cpu_high_aggregator}(${var.cpu_high_timeframe}): ( ${var.cpu_high_time_aggregator}(${var.cpu_high_timeframe}): (
${var.cpu_high_aggregator}:aws.elasticache.cpuutilization{${data.template_file.filter.rendered}} by {region,cluster,node} avg:aws.elasticache.cpuutilization{${data.template_file.filter.rendered}} by {region,cluster,node}
) > ( ${var.cpu_high_threshold_critical} / ${local.core[var.elasticache_size]} ) ) > ( ${var.cpu_high_threshold_critical} / ${local.core[var.elasticache_size]} )
EOF EOF
@ -88,8 +88,8 @@ resource "datadog_monitor" "redis_swap" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
${var.swap_aggregator}(${var.swap_timeframe}): ( ${var.swap_time_aggregator}(${var.swap_timeframe}): (
${var.swap_aggregator}:aws.elasticache.swap_usage{${data.template_file.filter.rendered}} by {region,cluster} avg:aws.elasticache.swap_usage{${data.template_file.filter.rendered}} by {region,cluster}
) > 0 ) > 0
EOF EOF
@ -115,8 +115,8 @@ resource "datadog_monitor" "redis_replication_lag" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
${var.replication_lag_aggregator}(${var.replication_lag_timeframe}): ( ${var.replication_lag_time_aggregator}(${var.replication_lag_timeframe}): (
${var.replication_lag_aggregator}:aws.elasticache.swap_usage{${data.template_file.filter.rendered}} by {region,cluster,node} avg:aws.elasticache.swap_usage{${data.template_file.filter.rendered}} by {region,cluster,node}
) > ${var.replication_lag_threshold_critical} ) > ${var.replication_lag_threshold_critical}
EOF EOF
@ -147,9 +147,9 @@ resource "datadog_monitor" "redis_commands" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
${var.commands_aggregator}(${var.commands_timeframe}): ( sum(${var.commands_timeframe}): (
${var.commands_aggregator}:aws.elasticache.get_type_cmds{${data.template_file.filter.rendered}} by {region,cluster,node} + avg:aws.elasticache.get_type_cmds{${data.template_file.filter.rendered}} by {region,cluster,node}.as_count() +
${var.commands_aggregator}:aws.elasticache.set_type_cmds{${data.template_file.filter.rendered}} by {region,cluster,node} avg:aws.elasticache.set_type_cmds{${data.template_file.filter.rendered}} by {region,cluster,node}.as_count()
) <= 0 ) <= 0
EOF EOF
@ -175,8 +175,8 @@ resource "datadog_monitor" "redis_free_memory" {
type = "metric alert" type = "metric alert"
query = <<EOF query = <<EOF
${var.free_memory_aggregator}(${var.free_memory_timeframe}): ( ${var.free_memory_time_aggregator}(${var.free_memory_timeframe}): (
${var.free_memory_aggregator}:aws.elasticache.freeable_memory{${data.template_file.filter.rendered}} by {region,cluster,node} / avg:aws.elasticache.freeable_memory{${data.template_file.filter.rendered}} by {region,cluster,node} /
( ${local.memory[var.elasticache_size]} / ${var.nodes} ) ( ${local.memory[var.elasticache_size]} / ${var.nodes} )
) * 100 < ${var.free_memory_threshold_critical} ) * 100 < ${var.free_memory_threshold_critical}
EOF EOF