MON-76: Azure Redis - DataDog Monitors

This commit is contained in:
Jérôme Respaut 2017-10-30 11:34:42 +01:00 committed by Laurent Piroelle
parent 22e7021681
commit 6e6147088c
2 changed files with 73 additions and 0 deletions

View File

@ -0,0 +1,31 @@
# Global Terraform
variable "client_name" {
type = "string"
}
variable "environment" {
type = "string"
}
variable "stack" {
type = "string"
}
# Global DataDog
variable "critical_escalation_group" {
}
variable "warning_escalation_group" {
}
variable "delay" {
default = 600
}
# Azure Redis specific
variable "evictedkeys_threshold_warning" {
default = 0
}
variable "evictedkeys_threshold_critical" {
default = 100
}

View File

@ -0,0 +1,42 @@
resource "datadog_monitor" "status" {
name = "[${var.environment}] Redis {{name}} is down"
message = "{{#is_alert}}\n${var.critical_escalation_group} \n{{/is_alert}} \n{{#is_recovery}}\n${var.critical_escalation_group}\n{{/is_recovery}}"
query = "avg(last_5m):avg:azure.cache_redis.status{*} by {name,resource_group} != 1"
type = "query alert"
notify_no_data = false
evaluation_delay = "${var.delay}"
renotify_interval = 60
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
new_host_delay = "${var.delay}"
no_data_timeframe = 20
}
resource "datadog_monitor" "evictedkeys" {
name = "[${var.environment}] Redis {{value}} evictedkeys on {{name}}"
message = "{{#is_alert}}\n${var.critical_escalation_group} \n{{/is_alert}} \n{{#is_recovery}}\n${var.critical_escalation_group}\n{{/is_recovery}}"
query = "avg(last_5m):avg:azure.cache_redis.evictedkeys{*} by {name,resource_group} > ${var.evictedkeys_threshold_critical}"
type = "query alert"
thresholds {
warning = "${var.evictedkeys_threshold_warning}"
critical = "${var.evictedkeys_threshold_critical}"
}
notify_no_data = false
evaluation_delay = "${var.delay}"
renotify_interval = 60
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
new_host_delay = "${var.delay}"
no_data_timeframe = 20
}