MON-32 - Space aggregator hard coded
This commit is contained in:
parent
52c71698fe
commit
dfd41cb779
@ -33,19 +33,19 @@ Inputs
|
||||
|------|-------------|:----:|:-----:|:-----:|
|
||||
| delay | Delay in seconds for the metric evaluation | string | `900` | no |
|
||||
| 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_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 |
|
||||
| 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_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 |
|
||||
| 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_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 |
|
||||
| resource | Type of Elasticache used | string | - | yes |
|
||||
|
||||
|
||||
@ -35,8 +35,8 @@ variable "eviction_message" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "eviction_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache eviction [available values: min, max, sum or avg]"
|
||||
variable "eviction_time_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache eviction [available values: min, max or avg]"
|
||||
type = "string"
|
||||
default = "min"
|
||||
}
|
||||
@ -58,8 +58,8 @@ variable "max_connection_message" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "max_connection_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache max connection [available values: min, max, sum or avg]"
|
||||
variable "max_connection_time_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache max connection [available values: min, max or avg]"
|
||||
type = "string"
|
||||
default = "min"
|
||||
}
|
||||
@ -81,8 +81,8 @@ variable "no_connection_message" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "no_connection_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache no connection [available values: min, max, sum or avg]"
|
||||
variable "no_connection_time_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache no connection [available values: min, max or avg]"
|
||||
type = "string"
|
||||
default = "min"
|
||||
}
|
||||
|
||||
@ -5,8 +5,8 @@ resource "datadog_monitor" "elasticache_eviction" {
|
||||
type = "metric alert"
|
||||
|
||||
query = <<EOF
|
||||
${var.eviction_aggregator}(${var.eviction_timeframe}): (
|
||||
${var.eviction_aggregator}:aws.elasticache.evictions{${var.filter_tags}} by {region,cluster}
|
||||
${var.eviction_time_aggregator}(${var.eviction_timeframe}): (
|
||||
avg:aws.elasticache.evictions{${var.filter_tags}} by {region,cluster}
|
||||
) > 0
|
||||
EOF
|
||||
|
||||
@ -32,8 +32,8 @@ resource "datadog_monitor" "elasticache_max_connection" {
|
||||
type = "metric alert"
|
||||
|
||||
query = <<EOF
|
||||
${var.max_connection_aggregator}(${var.max_connection_timeframe}): (
|
||||
${var.max_connection_aggregator}:aws.elasticache.curr_connections{${var.filter_tags}} by {region,cluster}
|
||||
${var.max_connection_time_aggregator}(${var.max_connection_timeframe}): (
|
||||
avg:aws.elasticache.curr_connections{${var.filter_tags}} by {region,cluster}
|
||||
) >= 65000
|
||||
EOF
|
||||
|
||||
@ -59,8 +59,8 @@ resource "datadog_monitor" "elasticache_no_connection" {
|
||||
type = "metric alert"
|
||||
|
||||
query = <<EOF
|
||||
${var.no_connection_aggregator}(${var.no_connection_timeframe}): (
|
||||
${var.no_connection_aggregator}:aws.elasticache.curr_connections{${var.filter_tags}} by {region,cluster}
|
||||
${var.no_connection_time_aggregator}(${var.no_connection_timeframe}): (
|
||||
avg:aws.elasticache.curr_connections{${var.filter_tags}} by {region,cluster}
|
||||
) <= 0
|
||||
EOF
|
||||
|
||||
|
||||
@ -29,35 +29,34 @@ Inputs
|
||||
|
||||
| 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_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_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 |
|
||||
| delay | Delay in seconds for the metric evaluation | string | `900` | no |
|
||||
| elasticache_size | Size of the Elasticache instance | 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_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_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_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 |
|
||||
| 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_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_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 |
|
||||
| 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_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_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 |
|
||||
|
||||
Related documentation
|
||||
|
||||
@ -43,12 +43,6 @@ variable "get_hits_message" {
|
||||
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" {
|
||||
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"
|
||||
@ -76,8 +70,8 @@ variable "cpu_high_message" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "cpu_high_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache memcached cpu high [available values: min, max, sum or avg]"
|
||||
variable "cpu_high_time_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache memcached cpu high [available values: min, max or avg]"
|
||||
type = "string"
|
||||
default = "min"
|
||||
}
|
||||
@ -109,8 +103,8 @@ variable "swap_message" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "swap_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache memcached swap [available values: min, max, sum or avg]"
|
||||
variable "swap_time_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache memcached swap [available values: min, max or avg]"
|
||||
type = "string"
|
||||
default = "min"
|
||||
}
|
||||
@ -142,8 +136,8 @@ variable "free_memory_message" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "free_memory_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache memcached free memory [available values: min, max, sum or avg]"
|
||||
variable "free_memory_time_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache memcached free memory [available values: min, max or avg]"
|
||||
type = "string"
|
||||
default = "min"
|
||||
}
|
||||
|
||||
@ -22,10 +22,10 @@ resource "datadog_monitor" "memcached_get_hits" {
|
||||
type = "metric alert"
|
||||
|
||||
query = <<EOF
|
||||
${var.get_hits_aggregator}(${var.get_hits_timeframe}): (
|
||||
${var.get_hits_aggregator}:aws.elasticache.get_hits{${data.template_file.filter.rendered}} by {region,cluster} /
|
||||
(${var.get_hits_aggregator}:aws.elasticache.get_hits{${data.template_file.filter.rendered}} by {region,cluster} +
|
||||
${var.get_hits_aggregator}:aws.elasticache.get_misses{${data.template_file.filter.rendered}} by {region,cluster})
|
||||
sum(${var.get_hits_timeframe}): (
|
||||
avg:aws.elasticache.get_hits{${data.template_file.filter.rendered}} by {region,cluster}.as_count() /
|
||||
(avg:aws.elasticache.get_hits{${data.template_file.filter.rendered}} by {region,cluster}.as_count() +
|
||||
avg:aws.elasticache.get_misses{${data.template_file.filter.rendered}} by {region,cluster}.as_count())
|
||||
) < ${var.get_hits_threshold_critical}
|
||||
EOF
|
||||
|
||||
@ -56,8 +56,8 @@ resource "datadog_monitor" "memcached_cpu_high" {
|
||||
type = "metric alert"
|
||||
|
||||
query = <<EOF
|
||||
${var.cpu_high_aggregator}(${var.cpu_high_timeframe}): (
|
||||
${var.cpu_high_aggregator}:aws.elasticache.cpuutilization{${data.template_file.filter.rendered}} by {region,cluster,node}
|
||||
${var.cpu_high_time_aggregator}(${var.cpu_high_timeframe}): (
|
||||
avg:aws.elasticache.cpuutilization{${data.template_file.filter.rendered}} by {region,cluster,node}
|
||||
) > ${var.cpu_high_threshold_critical}
|
||||
EOF
|
||||
|
||||
@ -88,8 +88,8 @@ resource "datadog_monitor" "memcached_swap" {
|
||||
type = "metric alert"
|
||||
|
||||
query = <<EOF
|
||||
${var.swap_aggregator}(${var.swap_timeframe}): (
|
||||
${var.swap_aggregator}:aws.elasticache.swap_usage{${data.template_file.filter.rendered}} by {region,cluster}
|
||||
${var.swap_time_aggregator}(${var.swap_timeframe}): (
|
||||
avg:aws.elasticache.swap_usage{${data.template_file.filter.rendered}} by {region,cluster}
|
||||
) > ${var.swap_threshold_critical}
|
||||
EOF
|
||||
|
||||
@ -120,8 +120,8 @@ resource "datadog_monitor" "memcached_free_memory" {
|
||||
type = "metric alert"
|
||||
|
||||
query = <<EOF
|
||||
${var.free_memory_aggregator}(${var.free_memory_timeframe}): (
|
||||
${var.free_memory_aggregator}:aws.elasticache.freeable_memory{${data.template_file.filter.rendered}} by {region,cluster,node} /
|
||||
${var.free_memory_time_aggregator}(${var.free_memory_timeframe}): (
|
||||
avg:aws.elasticache.freeable_memory{${data.template_file.filter.rendered}} by {region,cluster,node} /
|
||||
${local.memory[var.elasticache_size]} * 100
|
||||
) < ${var.free_memory_threshold_critical}
|
||||
EOF
|
||||
|
||||
@ -41,44 +41,42 @@ Inputs
|
||||
|
||||
| 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_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_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 |
|
||||
| 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_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 |
|
||||
| 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_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_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 |
|
||||
| delay | Delay in seconds for the metric evaluation | string | `900` | no |
|
||||
| elasticache_size | Size of the Elasticache instance | 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_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_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_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 |
|
||||
| message | Message sent when an alert is triggered | 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_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_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 |
|
||||
| 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_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 |
|
||||
|
||||
Related documentation
|
||||
|
||||
@ -48,12 +48,6 @@ variable "cache_hits_message" {
|
||||
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" {
|
||||
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"
|
||||
@ -81,8 +75,8 @@ variable "cpu_high_message" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "cpu_high_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache redis cpu high [available values: min, max, sum or avg]"
|
||||
variable "cpu_high_time_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache redis cpu high [available values: min, max or avg]"
|
||||
type = "string"
|
||||
default = "min"
|
||||
}
|
||||
@ -114,8 +108,8 @@ variable "swap_message" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "swap_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache redis swap [available values: min, max, sum or avg]"
|
||||
variable "swap_time_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache redis swap [available values: min, max or avg]"
|
||||
type = "string"
|
||||
default = "min"
|
||||
}
|
||||
@ -137,8 +131,8 @@ variable "replication_lag_message" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "replication_lag_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache redis replication lag [available values: min, max, sum or avg]"
|
||||
variable "replication_lag_time_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache redis replication lag [available values: min, max or avg]"
|
||||
type = "string"
|
||||
default = "min"
|
||||
}
|
||||
@ -170,12 +164,6 @@ variable "commands_message" {
|
||||
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" {
|
||||
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"
|
||||
@ -193,8 +181,8 @@ variable "free_memory_message" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "free_memory_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache redis free memory [available values: min, max, sum or avg]"
|
||||
variable "free_memory_time_aggregator" {
|
||||
description = "Monitor aggregator for Elasticache redis free memory [available values: min, max or avg]"
|
||||
type = "string"
|
||||
default = "min"
|
||||
}
|
||||
|
||||
@ -22,10 +22,10 @@ resource "datadog_monitor" "redis_cache_hits" {
|
||||
type = "metric alert"
|
||||
|
||||
query = <<EOF
|
||||
${var.cache_hits_aggregator}(${var.cache_hits_timeframe}): (
|
||||
${var.cache_hits_aggregator}:aws.elasticache.cache_hits{${data.template_file.filter.rendered}} by {region,cluster} /
|
||||
(${var.cache_hits_aggregator}:aws.elasticache.cache_hits{${data.template_file.filter.rendered}} by {region,cluster} +
|
||||
${var.cache_hits_aggregator}:aws.elasticache.cache_misses{${data.template_file.filter.rendered}} by {region,cluster})
|
||||
sum(${var.cache_hits_timeframe}): (
|
||||
avg:aws.elasticache.cache_hits{${data.template_file.filter.rendered}} by {region,cluster}.as_count() /
|
||||
(avg:aws.elasticache.cache_hits{${data.template_file.filter.rendered}} by {region,cluster}.as_count() +
|
||||
avg:aws.elasticache.cache_misses{${data.template_file.filter.rendered}} by {region,cluster}.as_count())
|
||||
) < ${var.cache_hits_threshold_critical}
|
||||
EOF
|
||||
|
||||
@ -56,8 +56,8 @@ resource "datadog_monitor" "redis_cpu_high" {
|
||||
type = "metric alert"
|
||||
|
||||
query = <<EOF
|
||||
${var.cpu_high_aggregator}(${var.cpu_high_timeframe}): (
|
||||
${var.cpu_high_aggregator}:aws.elasticache.cpuutilization{${data.template_file.filter.rendered}} by {region,cluster,node}
|
||||
${var.cpu_high_time_aggregator}(${var.cpu_high_timeframe}): (
|
||||
avg:aws.elasticache.cpuutilization{${data.template_file.filter.rendered}} by {region,cluster,node}
|
||||
) > ( ${var.cpu_high_threshold_critical} / ${local.core[var.elasticache_size]} )
|
||||
EOF
|
||||
|
||||
@ -88,8 +88,8 @@ resource "datadog_monitor" "redis_swap" {
|
||||
type = "metric alert"
|
||||
|
||||
query = <<EOF
|
||||
${var.swap_aggregator}(${var.swap_timeframe}): (
|
||||
${var.swap_aggregator}:aws.elasticache.swap_usage{${data.template_file.filter.rendered}} by {region,cluster}
|
||||
${var.swap_time_aggregator}(${var.swap_timeframe}): (
|
||||
avg:aws.elasticache.swap_usage{${data.template_file.filter.rendered}} by {region,cluster}
|
||||
) > 0
|
||||
EOF
|
||||
|
||||
@ -115,8 +115,8 @@ resource "datadog_monitor" "redis_replication_lag" {
|
||||
type = "metric alert"
|
||||
|
||||
query = <<EOF
|
||||
${var.replication_lag_aggregator}(${var.replication_lag_timeframe}): (
|
||||
${var.replication_lag_aggregator}:aws.elasticache.swap_usage{${data.template_file.filter.rendered}} by {region,cluster,node}
|
||||
${var.replication_lag_time_aggregator}(${var.replication_lag_timeframe}): (
|
||||
avg:aws.elasticache.swap_usage{${data.template_file.filter.rendered}} by {region,cluster,node}
|
||||
) > ${var.replication_lag_threshold_critical}
|
||||
EOF
|
||||
|
||||
@ -147,9 +147,9 @@ resource "datadog_monitor" "redis_commands" {
|
||||
type = "metric alert"
|
||||
|
||||
query = <<EOF
|
||||
${var.commands_aggregator}(${var.commands_timeframe}): (
|
||||
${var.commands_aggregator}:aws.elasticache.get_type_cmds{${data.template_file.filter.rendered}} by {region,cluster,node} +
|
||||
${var.commands_aggregator}:aws.elasticache.set_type_cmds{${data.template_file.filter.rendered}} by {region,cluster,node}
|
||||
sum(${var.commands_timeframe}): (
|
||||
avg:aws.elasticache.get_type_cmds{${data.template_file.filter.rendered}} by {region,cluster,node}.as_count() +
|
||||
avg:aws.elasticache.set_type_cmds{${data.template_file.filter.rendered}} by {region,cluster,node}.as_count()
|
||||
) <= 0
|
||||
EOF
|
||||
|
||||
@ -175,8 +175,8 @@ resource "datadog_monitor" "redis_free_memory" {
|
||||
type = "metric alert"
|
||||
|
||||
query = <<EOF
|
||||
${var.free_memory_aggregator}(${var.free_memory_timeframe}): (
|
||||
${var.free_memory_aggregator}:aws.elasticache.freeable_memory{${data.template_file.filter.rendered}} by {region,cluster,node} /
|
||||
${var.free_memory_time_aggregator}(${var.free_memory_timeframe}): (
|
||||
avg:aws.elasticache.freeable_memory{${data.template_file.filter.rendered}} by {region,cluster,node} /
|
||||
( ${local.memory[var.elasticache_size]} / ${var.nodes} )
|
||||
) * 100 < ${var.free_memory_threshold_critical}
|
||||
EOF
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user