MON-76: Filter tags option
This commit is contained in:
parent
9f1051097e
commit
386ad343a5
@ -9,28 +9,40 @@ variable "environment" {
|
|||||||
|
|
||||||
# Global DataDog
|
# Global DataDog
|
||||||
variable "message" {
|
variable "message" {
|
||||||
|
description = "Message sent when a Redis monitor is triggered"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "delay" {
|
variable "delay" {
|
||||||
|
description = "Delay in seconds for the metric evaluation"
|
||||||
default = 600
|
default = 600
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "use_filter_tags" {
|
||||||
|
description = "Filter the data with service tags if true"
|
||||||
|
default = "true"
|
||||||
|
}
|
||||||
|
|
||||||
# Azure Redis specific
|
# Azure Redis specific
|
||||||
variable "evictedkeys_limit_threshold_warning" {
|
variable "evictedkeys_limit_threshold_warning" {
|
||||||
default = 0
|
default = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "evictedkeys_limit_threshold_critical" {
|
variable "evictedkeys_limit_threshold_critical" {
|
||||||
default = 100
|
default = 100
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "percent_processor_time_threshold_critical" {
|
variable "percent_processor_time_threshold_critical" {
|
||||||
default = 80
|
default = 80
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "percent_processor_time_threshold_warning" {
|
variable "percent_processor_time_threshold_warning" {
|
||||||
default = 60
|
default = 60
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "server_load_rate_threshold_critical" {
|
variable "server_load_rate_threshold_critical" {
|
||||||
default = 90
|
default = 90
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "server_load_rate_threshold_warning" {
|
variable "server_load_rate_threshold_warning" {
|
||||||
default = 70
|
default = 70
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,16 @@
|
|||||||
|
data "template_file" "filter" {
|
||||||
|
template = "$${filter}"
|
||||||
|
|
||||||
|
vars {
|
||||||
|
filter = "${var.use_filter_tags == "true" ? format("dd_monitoring:enabled,dd_azure_eventhub:enabled,env:%s", var.environment) : "*"}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
resource "datadog_monitor" "status" {
|
resource "datadog_monitor" "status" {
|
||||||
name = "[${var.environment}] Redis {{name}} is down"
|
name = "[${var.environment}] Redis {{name}} is down"
|
||||||
message = "${var.message}"
|
message = "${var.message}"
|
||||||
|
|
||||||
query = "avg(last_5m):avg:azure.cache_redis.status{*} by {name,resource_group} != 1"
|
query = "avg(last_5m):avg:azure.cache_redis.status{${data.template_file.filter.rendered}} by {name,resource_group} != 1"
|
||||||
type = "query alert"
|
type = "query alert"
|
||||||
|
|
||||||
notify_no_data = false
|
notify_no_data = false
|
||||||
@ -21,7 +29,7 @@ resource "datadog_monitor" "evictedkeys" {
|
|||||||
name = "[${var.environment}] Redis {{value}} evictedkeys on {{name}}"
|
name = "[${var.environment}] Redis {{value}} evictedkeys on {{name}}"
|
||||||
message = "${var.message}"
|
message = "${var.message}"
|
||||||
|
|
||||||
query = "avg(last_5m):avg:azure.cache_redis.evictedkeys{*} by {name,resource_group} > ${var.evictedkeys_limit_threshold_critical}"
|
query = "avg(last_5m):avg:azure.cache_redis.evictedkeys{${data.template_file.filter.rendered}} by {name,resource_group} > ${var.evictedkeys_limit_threshold_critical}"
|
||||||
type = "query alert"
|
type = "query alert"
|
||||||
|
|
||||||
thresholds {
|
thresholds {
|
||||||
@ -45,7 +53,7 @@ resource "datadog_monitor" "percent_processor_time" {
|
|||||||
name = "[${var.environment}] Redis processor time {{value}}% on {{name}}"
|
name = "[${var.environment}] Redis processor time {{value}}% on {{name}}"
|
||||||
message = "${var.message}"
|
message = "${var.message}"
|
||||||
|
|
||||||
query = "avg(last_5m):avg:azure.cache_redis.percent_processor_time{*} by {name,resource_group} > ${var.percent_processor_time_threshold_critical}"
|
query = "avg(last_5m):avg:azure.cache_redis.percent_processor_time{${data.template_file.filter.rendered}} by {name,resource_group} > ${var.percent_processor_time_threshold_critical}"
|
||||||
type = "query alert"
|
type = "query alert"
|
||||||
|
|
||||||
thresholds {
|
thresholds {
|
||||||
@ -69,7 +77,7 @@ resource "datadog_monitor" "server_load" {
|
|||||||
name = "[${var.environment}] Redis processor server load {{value}}% on {{name}}"
|
name = "[${var.environment}] Redis processor server load {{value}}% on {{name}}"
|
||||||
message = "${var.message}"
|
message = "${var.message}"
|
||||||
|
|
||||||
query = "avg(last_5m):avg:azure.cache_redis.server_load{*} by {name,resource_group} > ${var.server_load_rate_threshold_critical}"
|
query = "avg(last_5m):avg:azure.cache_redis.server_load{${data.template_file.filter.rendered}} by {name,resource_group} > ${var.server_load_rate_threshold_critical}"
|
||||||
type = "query alert"
|
type = "query alert"
|
||||||
|
|
||||||
thresholds {
|
thresholds {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user