MON-459 apply hack for fmt

This commit is contained in:
Quentin Manfroi 2019-07-03 18:22:24 +02:00
parent 1d8d96ce29
commit 67b3580d7f
56 changed files with 2782 additions and 2782 deletions

View File

@ -10,19 +10,19 @@ EOQ
thresholds = {
critical = 1
warning = 0
warning = 0
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
no_data_timeframe = var.ark_schedules_monitor_no_data_timeframe
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:caas", "provider:prometheus", "resource:ark", "team:claranet", "created-by:terraform"], var.ark_schedules_extra_tags)

View File

@ -10,17 +10,17 @@ resource "datadog_monitor" "apiserver" {
EOQ
thresholds = {
warning = var.apiserver_threshold_warning
warning = var.apiserver_threshold_warning
critical = 5
}
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.apiserver_extra_tags)

View File

@ -12,28 +12,28 @@ resource "datadog_monitor" "nginx_ingress_too_many_5xx" {
EOQ
thresholds = {
warning = var.ingress_5xx_threshold_warning
warning = var.ingress_5xx_threshold_warning
critical = var.ingress_5xx_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:prometheus", "resource:nginx-ingress-controller", "team:claranet", "created-by:terraform"], var.ingress_5xx_extra_tags)
}
resource "datadog_monitor" "nginx_ingress_too_many_4xx" {
count = var.ingress_4xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Nginx Ingress 4xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.ingress_4xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Nginx Ingress 4xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.ingress_4xx_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.ingress_4xx_time_aggregator}(${var.ingress_4xx_timeframe}): default(
@ -42,21 +42,21 @@ resource "datadog_monitor" "nginx_ingress_too_many_4xx" {
* 100, 0) > ${var.ingress_4xx_threshold_critical}
EOQ
thresholds = {
warning = var.ingress_4xx_threshold_warning
critical = var.ingress_4xx_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:prometheus", "resource:nginx-ingress-controller", "team:claranet", "created-by:terraform"], var.ingress_4xx_extra_tags)
thresholds = {
warning = var.ingress_4xx_threshold_warning
critical = var.ingress_4xx_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:prometheus", "resource:nginx-ingress-controller", "team:claranet", "created-by:terraform"], var.ingress_4xx_extra_tags)
}

View File

@ -9,81 +9,81 @@ resource "datadog_monitor" "disk_pressure" {
EOQ
thresholds = {
warning = var.disk_pressure_threshold_warning
warning = var.disk_pressure_threshold_warning
critical = 5
}
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.disk_pressure_extra_tags)
}
resource "datadog_monitor" "disk_out" {
count = var.disk_out_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node Out of disk"
count = var.disk_out_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node Out of disk"
message = coalesce(var.disk_out_message, var.message)
type = "service check"
type = "service check"
query = <<EOQ
"kubernetes_state.node.out_of_disk"${module.filter-tags.service_check}.by("kubernetescluster","node").last(6).count_by_status()
EOQ
thresholds = {
warning = var.disk_out_threshold_warning
critical = 5
}
thresholds = {
warning = var.disk_out_threshold_warning
critical = 5
}
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.disk_out_extra_tags)
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.disk_out_extra_tags)
}
resource "datadog_monitor" "memory_pressure" {
count = var.memory_pressure_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node Memory pressure"
message = coalesce(var.memory_pressure_message, var.message)
type = "service check"
count = var.memory_pressure_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node Memory pressure"
message = coalesce(var.memory_pressure_message, var.message)
type = "service check"
query = <<EOQ
"kubernetes_state.node.memory_pressure"${module.filter-tags.service_check}.by("kubernetescluster","node").last(6).count_by_status()
EOQ
thresholds = {
warning = var.memory_pressure_threshold_warning
critical = 5
}
thresholds = {
warning = var.memory_pressure_threshold_warning
critical = 5
}
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.memory_pressure_extra_tags)
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.memory_pressure_extra_tags)
}
resource "datadog_monitor" "ready" {
count = var.ready_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node not ready"
message = coalesce(var.ready_message, var.message)
type = "service check"
count = var.ready_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node not ready"
message = coalesce(var.ready_message, var.message)
type = "service check"
query = <<EOQ
"kubernetes_state.node.ready"${module.filter-tags.service_check}.by("kubernetescluster","node").last(6).count_by_status()
@ -117,75 +117,75 @@ resource "datadog_monitor" "kubelet_ping" {
EOQ
thresholds = {
warning = var.kubelet_ping_threshold_warning
warning = var.kubelet_ping_threshold_warning
critical = 5
}
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.kubelet_ping_extra_tags)
}
resource "datadog_monitor" "kubelet_syncloop" {
count = var.kubelet_syncloop_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node Kubelet sync loop that updates containers does not work"
count = var.kubelet_syncloop_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node Kubelet sync loop that updates containers does not work"
message = coalesce(var.kubelet_syncloop_message, var.message)
type = "service check"
type = "service check"
query = <<EOQ
"kubernetes.kubelet.check.syncloop"${module.filter-tags.service_check}.by("kubernetescluster","name").last(6).count_by_status()
EOQ
thresholds = {
warning = var.kubelet_syncloop_threshold_warning
critical = 5
}
thresholds = {
warning = var.kubelet_syncloop_threshold_warning
critical = 5
}
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.kubelet_syncloop_extra_tags)
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.kubelet_syncloop_extra_tags)
}
resource "datadog_monitor" "unregister_net_device" {
count = var.unregister_net_device_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node Frequent unregister net device"
message = coalesce(var.unregister_net_device_message, var.message)
type = "event alert"
count = var.unregister_net_device_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node Frequent unregister net device"
message = coalesce(var.unregister_net_device_message, var.message)
type = "event alert"
query = <<EOQ
events('sources:kubernetes priority:all ${module.filter-tags.event_alert} \"UnregisterNetDevice\"').rollup('count').last('${var.unregister_net_device_timeframe}') > ${var.unregister_net_device_threshold_critical}
EOQ
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.unregister_net_device_extra_tags)
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.unregister_net_device_extra_tags)
}
resource "datadog_monitor" "node_unschedulable" {
count = var.node_unschedulable_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node unschedulable"
message = coalesce(var.node_unschedulable_message, var.message)
type = "metric alert"
count = var.node_unschedulable_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node unschedulable"
message = coalesce(var.node_unschedulable_message, var.message)
type = "metric alert"
query = <<EOQ
${var.node_unschedulable_time_aggregator}(${var.node_unschedulable_timeframe}):
@ -225,27 +225,27 @@ EOQ
thresholds = {
critical = var.volume_space_threshold_critical
warning = var.volume_space_threshold_warning
warning = var.volume_space_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.volume_space_extra_tags)
}
resource "datadog_monitor" "volume_inodes" {
count = var.volume_inodes_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node volume inodes usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.volume_inodes_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node volume inodes usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.volume_inodes_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.volume_inodes_time_aggregator}(${var.volume_inodes_timeframe}):
@ -254,21 +254,21 @@ resource "datadog_monitor" "volume_inodes" {
* 100 > ${var.volume_inodes_threshold_critical}
EOQ
thresholds = {
critical = var.volume_inodes_threshold_critical
warning = var.volume_inodes_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.volume_inodes_extra_tags)
thresholds = {
critical = var.volume_inodes_threshold_critical
warning = var.volume_inodes_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.volume_inodes_extra_tags)
}

View File

@ -14,24 +14,24 @@ EOQ
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-pod", "team:claranet", "created-by:terraform"], var.pod_phase_status_extra_tags)
}
resource "datadog_monitor" "error" {
count = var.error_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Pod waiting errors"
count = var.error_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Pod waiting errors"
message = coalesce(var.error_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.error_time_aggregator}(${var.error_timeframe}):
@ -39,21 +39,21 @@ resource "datadog_monitor" "error" {
> ${var.error_threshold_critical}
EOQ
thresholds = {
critical = var.error_threshold_critical
warning = var.error_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-pod", "team:claranet", "created-by:terraform"], var.error_extra_tags)
thresholds = {
critical = var.error_threshold_critical
warning = var.error_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-pod", "team:claranet", "created-by:terraform"], var.error_extra_tags)
}

View File

@ -9,54 +9,54 @@ resource "datadog_monitor" "job" {
EOQ
thresholds = {
warning = var.job_threshold_warning
warning = var.job_threshold_warning
critical = 5
}
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-workload", "team:claranet", "created-by:terraform"], var.job_extra_tags)
}
resource "datadog_monitor" "cronjob" {
count = var.cronjob_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes cronjob scheduling failed"
count = var.cronjob_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes cronjob scheduling failed"
message = coalesce(var.cronjob_message, var.message)
type = "service check"
type = "service check"
query = <<EOQ
"kubernetes_state.cronjob.on_schedule_check"${module.filter-tags.service_check}.by("cronjob").last(6).count_by_status()
EOQ
thresholds = {
warning = var.cronjob_threshold_warning
critical = 5
}
thresholds = {
warning = var.cronjob_threshold_warning
critical = 5
}
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-workload", "team:claranet", "created-by:terraform"], var.cronjob_extra_tags)
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-workload", "team:claranet", "created-by:terraform"], var.cronjob_extra_tags)
}
resource "datadog_monitor" "replica_available" {
count = var.replica_available_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Available replicas {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.replica_available_message, var.message)
type = "query alert"
count = var.replica_available_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Available replicas {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.replica_available_message, var.message)
type = "query alert"
query = <<EOQ
${var.replica_available_time_aggregator}(${var.replica_available_timeframe}):
@ -65,28 +65,28 @@ query = <<EOQ
+ 1 < ${var.replica_available_threshold_critical}
EOQ
thresholds = {
critical = var.replica_available_threshold_critical
}
thresholds = {
critical = var.replica_available_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-workload", "team:claranet", "created-by:terraform"], var.replica_available_extra_tags)
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-workload", "team:claranet", "created-by:terraform"], var.replica_available_extra_tags)
}
resource "datadog_monitor" "replica_ready" {
count = var.replica_ready_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Ready replicas {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.replica_ready_message, var.message)
type = "query alert"
count = var.replica_ready_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Ready replicas {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.replica_ready_message, var.message)
type = "query alert"
query = <<EOQ
${var.replica_available_time_aggregator}(${var.replica_available_timeframe}):
@ -129,14 +129,14 @@ EOQ
critical = var.replica_current_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-workload", "team:claranet", "created-by:terraform"], var.replica_current_extra_tags)

View File

@ -14,25 +14,25 @@ EOQ
thresholds = {
critical = 1
warning = 100
warning = 100
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.alb_no_healthy_instances_extra_tags)
}
resource "datadog_monitor" "ALB_latency" {
count = var.latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ALB latency {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}"
count = var.latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ALB latency {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}"
message = coalesce(var.latency_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.latency_time_aggregator}(${var.latency_timeframe}):
@ -40,27 +40,27 @@ resource "datadog_monitor" "ALB_latency" {
> ${var.latency_threshold_critical}
EOQ
thresholds = {
critical = var.latency_threshold_critical
warning = var.latency_threshold_warning
}
thresholds = {
critical = var.latency_threshold_critical
warning = var.latency_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.latency_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.latency_extra_tags)
}
resource "datadog_monitor" "ALB_httpcode_5xx" {
count = var.httpcode_alb_5xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ALB HTTP code 5xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.httpcode_alb_5xx_message, var.message)
type = "query alert"
count = var.httpcode_alb_5xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ALB HTTP code 5xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.httpcode_alb_5xx_message, var.message)
type = "query alert"
query = <<EOQ
${var.httpcode_alb_5xx_time_aggregator}(${var.httpcode_alb_5xx_timeframe}):
@ -69,27 +69,27 @@ query = <<EOQ
* 100 > ${var.httpcode_alb_5xx_threshold_critical}
EOQ
thresholds = {
critical = var.httpcode_alb_5xx_threshold_critical
warning = var.httpcode_alb_5xx_threshold_warning
}
thresholds = {
critical = var.httpcode_alb_5xx_threshold_critical
warning = var.httpcode_alb_5xx_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.httpcode_alb_5xx_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.httpcode_alb_5xx_extra_tags)
}
resource "datadog_monitor" "ALB_httpcode_4xx" {
count = var.httpcode_alb_4xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ALB HTTP code 4xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.httpcode_alb_4xx_message, var.message)
type = "query alert"
count = var.httpcode_alb_4xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ALB HTTP code 4xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.httpcode_alb_4xx_message, var.message)
type = "query alert"
query = <<EOQ
${var.httpcode_alb_4xx_time_aggregator}(${var.httpcode_alb_4xx_timeframe}):
@ -129,25 +129,25 @@ EOQ
thresholds = {
critical = var.httpcode_target_5xx_threshold_critical
warning = var.httpcode_target_5xx_threshold_warning
warning = var.httpcode_target_5xx_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.httpcode_target_5xx_extra_tags)
}
resource "datadog_monitor" "ALB_httpcode_target_4xx" {
count = var.httpcode_target_4xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ALB target HTTP code 4xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.httpcode_target_4xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ALB target HTTP code 4xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.httpcode_target_4xx_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.httpcode_target_4xx_time_aggregator}(${var.httpcode_target_4xx_timeframe}):
@ -156,19 +156,19 @@ resource "datadog_monitor" "ALB_httpcode_target_4xx" {
* 100 > ${var.httpcode_target_4xx_threshold_critical}
EOQ
thresholds = {
critical = var.httpcode_target_4xx_threshold_critical
warning = var.httpcode_target_4xx_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.httpcode_target_4xx_extra_tags)
thresholds = {
critical = var.httpcode_target_4xx_threshold_critical
warning = var.httpcode_target_4xx_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.httpcode_target_4xx_extra_tags)
}

View File

@ -12,27 +12,27 @@ resource "datadog_monitor" "API_Gateway_latency" {
EOQ
thresholds = {
warning = var.latency_threshold_warning
warning = var.latency_threshold_warning
critical = var.latency_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:apigateway", "team:claranet", "created-by:terraform"], var.latency_extra_tags)
}
# Monitoring API Gateway 5xx errors percent
resource "datadog_monitor" "API_http_5xx_errors_count" {
count = var.http_5xx_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] API Gateway HTTP 5xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.http_5xx_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] API Gateway HTTP 5xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.http_5xx_requests_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.http_5xx_requests_time_aggregator}(${var.http_5xx_requests_timeframe}):
@ -41,28 +41,28 @@ resource "datadog_monitor" "API_http_5xx_errors_count" {
* 100 > ${var.http_5xx_requests_threshold_critical}
EOQ
thresholds = {
warning = var.http_5xx_requests_threshold_warning
critical = var.http_5xx_requests_threshold_critical
}
thresholds = {
warning = var.http_5xx_requests_threshold_warning
critical = var.http_5xx_requests_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 1
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 1
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:apigateway", "team:claranet", "created-by:terraform"], var.http_5xx_requests_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:apigateway", "team:claranet", "created-by:terraform"], var.http_5xx_requests_extra_tags)
}
# Monitoring API Gateway 4xx errors percent
resource "datadog_monitor" "API_http_4xx_errors_count" {
count = var.http_4xx_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] API Gateway HTTP 4xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.http_4xx_requests_message, var.message)
type = "query alert"
count = var.http_4xx_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] API Gateway HTTP 4xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.http_4xx_requests_message, var.message)
type = "query alert"
query = <<EOQ
${var.http_4xx_requests_time_aggregator}(${var.http_4xx_requests_timeframe}):
@ -71,19 +71,19 @@ query = <<EOQ
* 100 > ${var.http_4xx_requests_threshold_critical}
EOQ
thresholds = {
warning = var.http_4xx_requests_threshold_warning
critical = var.http_4xx_requests_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 1
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:apigateway", "team:claranet", "created-by:terraform"], var.http_4xx_requests_extra_tags)
thresholds = {
warning = var.http_4xx_requests_threshold_warning
critical = var.http_4xx_requests_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 1
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:apigateway", "team:claranet", "created-by:terraform"], var.http_4xx_requests_extra_tags)
}

View File

@ -11,28 +11,28 @@ resource "datadog_monitor" "elasticache_eviction" {
EOQ
thresholds = {
warning = var.eviction_threshold_warning
warning = var.eviction_threshold_warning
critical = var.eviction_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform"], var.eviction_extra_tags)
}
resource "datadog_monitor" "elasticache_max_connection" {
count = var.max_connection_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache max connections reached {{#is_alert}}{{{comparator}}} {{threshold}} {{/is_alert}}"
count = var.max_connection_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache max connections reached {{#is_alert}}{{{comparator}}} {{threshold}} {{/is_alert}}"
message = coalesce(var.max_connection_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.max_connection_time_aggregator}(${var.max_connection_timeframe}): (
@ -40,24 +40,24 @@ resource "datadog_monitor" "elasticache_max_connection" {
) >= 65000
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform"], var.max_connection_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform"], var.max_connection_extra_tags)
}
resource "datadog_monitor" "elasticache_no_connection" {
count = var.no_connection_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache connections {{#is_alert}}{{{comparator}}} {{threshold}} {{/is_alert}}"
message = coalesce(var.no_connection_message, var.message)
type = "query alert"
count = var.no_connection_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache connections {{#is_alert}}{{{comparator}}} {{threshold}} {{/is_alert}}"
message = coalesce(var.no_connection_message, var.message)
type = "query alert"
query = <<EOQ
${var.no_connection_time_aggregator}(${var.no_connection_timeframe}): (
@ -65,24 +65,24 @@ query = <<EOQ
) <= 0
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform"], var.no_connection_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform"], var.no_connection_extra_tags)
}
resource "datadog_monitor" "elasticache_swap" {
count = var.swap_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache swap {{#is_alert}}{{{comparator}}} {{threshold}}MB ({{value}}MB){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}MB ({{value}}MB){{/is_warning}}"
message = coalesce(var.swap_message, var.message)
type = "query alert"
count = var.swap_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache swap {{#is_alert}}{{{comparator}}} {{threshold}}MB ({{value}}MB){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}MB ({{value}}MB){{/is_warning}}"
message = coalesce(var.swap_message, var.message)
type = "query alert"
query = <<EOQ
${var.swap_time_aggregator}(${var.swap_timeframe}): (
@ -121,28 +121,28 @@ resource "datadog_monitor" "elasticache_free_memory" {
EOQ
thresholds = {
warning = var.free_memory_threshold_warning
warning = var.free_memory_threshold_warning
critical = var.free_memory_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform"], var.free_memory_extra_tags)
}
resource "datadog_monitor" "elasticache_eviction_growing" {
count = var.eviction_growing_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache evictions is growing {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
count = var.eviction_growing_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache evictions is growing {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.eviction_growing_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
pct_change(avg(${var.eviction_growing_timeframe}),${var.eviction_growing_condition_timeframe}):
@ -150,21 +150,21 @@ resource "datadog_monitor" "elasticache_eviction_growing" {
> ${var.eviction_growing_threshold_critical}
EOQ
thresholds = {
warning = var.eviction_growing_threshold_warning
critical = var.eviction_growing_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform"], var.eviction_growing_extra_tags)
thresholds = {
warning = var.eviction_growing_threshold_warning
critical = var.eviction_growing_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform"], var.eviction_growing_extra_tags)
}

View File

@ -13,28 +13,28 @@ resource "datadog_monitor" "memcached_get_hits" {
EOQ
thresholds = {
warning = var.get_hits_threshold_warning
warning = var.get_hits_threshold_warning
critical = var.get_hits_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-memcached", "team:claranet", "created-by:terraform", "engine:memcached"], var.get_hits_extra_tags)
}
resource "datadog_monitor" "memcached_cpu_high" {
count = var.cpu_high_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache memcached CPU {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.cpu_high_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache memcached CPU {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.cpu_high_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.cpu_high_time_aggregator}(${var.cpu_high_timeframe}): (
@ -42,21 +42,21 @@ resource "datadog_monitor" "memcached_cpu_high" {
) > ${var.cpu_high_threshold_critical}
EOQ
thresholds = {
warning = var.cpu_high_threshold_warning
critical = var.cpu_high_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-memcached", "team:claranet", "created-by:terraform", "engine:memcached"], var.cpu_high_extra_tags)
thresholds = {
warning = var.cpu_high_threshold_warning
critical = var.cpu_high_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-memcached", "team:claranet", "created-by:terraform", "engine:memcached"], var.cpu_high_extra_tags)
}

View File

@ -13,28 +13,28 @@ resource "datadog_monitor" "redis_cache_hits" {
EOQ
thresholds = {
warning = var.cache_hits_threshold_warning
warning = var.cache_hits_threshold_warning
critical = var.cache_hits_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-redis", "team:claranet", "created-by:terraform", "engine:redis"], var.cache_hits_extra_tags)
}
resource "datadog_monitor" "redis_cpu_high" {
count = var.cpu_high_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache redis CPU {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.cpu_high_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache redis CPU {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.cpu_high_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.cpu_high_time_aggregator}(${var.cpu_high_timeframe}): (
@ -42,24 +42,24 @@ resource "datadog_monitor" "redis_cpu_high" {
) > ${var.cpu_high_threshold_critical}
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-redis", "team:claranet", "created-by:terraform", "engine:redis"], var.cpu_high_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-redis", "team:claranet", "created-by:terraform", "engine:redis"], var.cpu_high_extra_tags)
}
resource "datadog_monitor" "redis_replication_lag" {
count = var.replication_lag_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache redis replication lag {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}"
message = coalesce(var.replication_lag_message, var.message)
type = "query alert"
count = var.replication_lag_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache redis replication lag {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}"
message = coalesce(var.replication_lag_message, var.message)
type = "query alert"
query = <<EOQ
${var.replication_lag_time_aggregator}(${var.replication_lag_timeframe}): (
@ -67,29 +67,29 @@ query = <<EOQ
) > ${var.replication_lag_threshold_critical}
EOQ
thresholds = {
warning = var.replication_lag_threshold_warning
critical = var.replication_lag_threshold_critical
}
thresholds = {
warning = var.replication_lag_threshold_warning
critical = var.replication_lag_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-redis", "team:claranet", "created-by:terraform", "engine:redis"], var.replication_lag_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-redis", "team:claranet", "created-by:terraform", "engine:redis"], var.replication_lag_extra_tags)
}
resource "datadog_monitor" "redis_commands" {
count = var.commands_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache redis is receiving no commands"
message = coalesce(var.commands_message, var.message)
type = "query alert"
count = var.commands_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache redis is receiving no commands"
message = coalesce(var.commands_message, var.message)
type = "query alert"
query = <<EOQ
sum(${var.commands_timeframe}): (

View File

@ -17,18 +17,18 @@ resource "datadog_monitor" "es_cluster_status" {
EOQ
thresholds = {
warning = 1
warning = 1
critical = 2
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.es_cluster_status_extra_tags)
@ -36,10 +36,10 @@ EOQ
### Elasticsearch cluster free storage space monitor ###
resource "datadog_monitor" "es_free_space_low" {
count = var.diskspace_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch cluster free storage space {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.diskspace_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch cluster free storage space {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.diskspace_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.diskspace_time_aggregator}(${var.diskspace_timeframe}): (
@ -48,30 +48,30 @@ resource "datadog_monitor" "es_free_space_low" {
) < ${var.diskspace_threshold_critical}
EOQ
thresholds = {
warning = var.diskspace_threshold_warning
critical = var.diskspace_threshold_critical
}
thresholds = {
warning = var.diskspace_threshold_warning
critical = var.diskspace_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.diskspace_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.diskspace_extra_tags)
}
### Elasticsearch cluster CPU monitor ###
resource "datadog_monitor" "es_cpu_90_15min" {
count = var.cpu_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch cluster CPU high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.cpu_message, var.message)
type = "query alert"
count = var.cpu_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch cluster CPU high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.cpu_message, var.message)
type = "query alert"
query = <<EOQ
${var.cpu_time_aggregator}(${var.cpu_timeframe}): (
@ -79,21 +79,21 @@ query = <<EOQ
) > ${var.cpu_threshold_critical}
EOQ
thresholds = {
warning = var.cpu_threshold_warning
critical = var.cpu_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.cpu_extra_tags)
thresholds = {
warning = var.cpu_threshold_warning
critical = var.cpu_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.cpu_extra_tags)
}

View File

@ -14,27 +14,27 @@ EOQ
thresholds = {
critical = 1
warning = 100
warning = 100
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_no_healthy_instance_extra_tags)
}
resource "datadog_monitor" "ELB_too_much_4xx" {
count = var.elb_4xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ELB 4xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.elb_4xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ELB 4xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.elb_4xx_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
sum(${var.elb_4xx_timeframe}):
@ -43,29 +43,29 @@ resource "datadog_monitor" "ELB_too_much_4xx" {
* 100 > ${var.elb_4xx_threshold_critical}
EOQ
thresholds = {
warning = var.elb_4xx_threshold_warning
critical = var.elb_4xx_threshold_critical
}
thresholds = {
warning = var.elb_4xx_threshold_warning
critical = var.elb_4xx_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_4xx_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_4xx_extra_tags)
}
resource "datadog_monitor" "ELB_too_much_5xx" {
count = var.elb_5xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ELB 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.elb_5xx_message, var.message)
type = "query alert"
count = var.elb_5xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ELB 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.elb_5xx_message, var.message)
type = "query alert"
query = <<EOQ
sum(${var.elb_5xx_timeframe}):
@ -74,29 +74,29 @@ query = <<EOQ
* 100 > ${var.elb_5xx_threshold_critical}
EOQ
thresholds = {
warning = var.elb_5xx_threshold_warning
critical = var.elb_5xx_threshold_critical
}
thresholds = {
warning = var.elb_5xx_threshold_warning
critical = var.elb_5xx_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_5xx_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_5xx_extra_tags)
}
resource "datadog_monitor" "ELB_too_much_4xx_backend" {
count = var.elb_backend_4xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ELB backend 4xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.elb_backend_4xx_message, var.message)
type = "query alert"
count = var.elb_backend_4xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ELB backend 4xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.elb_backend_4xx_message, var.message)
type = "query alert"
query = <<EOQ
sum(${var.elb_backend_4xx_timeframe}):
@ -137,28 +137,28 @@ resource "datadog_monitor" "ELB_too_much_5xx_backend" {
EOQ
thresholds = {
warning = var.elb_backend_5xx_threshold_warning
warning = var.elb_backend_5xx_threshold_warning
critical = var.elb_backend_5xx_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_backend_5xx_extra_tags)
}
resource "datadog_monitor" "ELB_backend_latency" {
count = var.elb_backend_latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ELB latency too high {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}"
count = var.elb_backend_latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ELB latency too high {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}"
message = coalesce(var.elb_backend_latency_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.elb_backend_latency_time_aggregator}(${var.elb_backend_latency_timeframe}):
@ -166,21 +166,21 @@ resource "datadog_monitor" "ELB_backend_latency" {
> ${var.elb_backend_latency_critical}
EOQ
thresholds = {
warning = var.elb_backend_latency_warning
critical = var.elb_backend_latency_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_backend_latency_extra_tags)
thresholds = {
warning = var.elb_backend_latency_warning
critical = var.elb_backend_latency_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_backend_latency_extra_tags)
}

View File

@ -15,14 +15,14 @@ EOQ
critical = 0
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:kinesis-firehose", "team:claranet", "created-by:terraform"], var.incoming_records_extra_tags)

View File

@ -12,17 +12,17 @@ resource "datadog_monitor" "rds_aurora_mysql_replica_lag" {
EOQ
thresholds = {
warning = var.aurora_replicalag_threshold_warning
warning = var.aurora_replicalag_threshold_warning
critical = var.aurora_replicalag_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:rds-aurora-mysql", "team:claranet", "created-by:terraform"], var.aurora_replicalag_extra_tags)

View File

@ -12,17 +12,17 @@ resource "datadog_monitor" "rds_aurora_postgresql_replica_lag" {
EOQ
thresholds = {
warning = var.aurora_replicalag_threshold_warning
warning = var.aurora_replicalag_threshold_warning
critical = var.aurora_replicalag_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:rds-aurora-postgresql", "team:claranet", "created-by:terraform"], var.aurora_replicalag_extra_tags)

View File

@ -12,17 +12,17 @@ resource "datadog_monitor" "rds_cpu_90_15min" {
EOQ
thresholds = {
warning = var.cpu_threshold_warning
warning = var.cpu_threshold_warning
critical = var.cpu_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:rds", "team:claranet", "created-by:terraform"], var.cpu_extra_tags)
@ -30,10 +30,10 @@ EOQ
### RDS instance free space monitor ###
resource "datadog_monitor" "rds_free_space_low" {
count = var.diskspace_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] RDS instance free space {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.diskspace_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] RDS instance free space {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.diskspace_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.diskspace_time_aggregator}(${var.diskspace_timeframe}): (
@ -42,29 +42,29 @@ resource "datadog_monitor" "rds_free_space_low" {
) < ${var.diskspace_threshold_critical}
EOQ
thresholds = {
warning = var.diskspace_threshold_warning
critical = var.diskspace_threshold_critical
}
thresholds = {
warning = var.diskspace_threshold_warning
critical = var.diskspace_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:rds", "team:claranet", "created-by:terraform"], var.diskspace_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:rds", "team:claranet", "created-by:terraform"], var.diskspace_extra_tags)
}
### RDS Replica Lag monitor ###
resource "datadog_monitor" "rds_replica_lag" {
count = var.replicalag_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] RDS replica lag {{#is_alert}}{{{comparator}}} {{threshold}} ms ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ms ({{value}}%){{/is_warning}}"
message = coalesce(var.replicalag_message, var.message)
type = "query alert"
count = var.replicalag_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] RDS replica lag {{#is_alert}}{{{comparator}}} {{threshold}} ms ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ms ({{value}}%){{/is_warning}}"
message = coalesce(var.replicalag_message, var.message)
type = "query alert"
query = <<EOQ
avg(${var.replicalag_timeframe}): (
@ -72,20 +72,20 @@ query = <<EOQ
) > ${var.replicalag_threshold_critical}
EOQ
thresholds = {
warning = var.replicalag_threshold_warning
critical = var.replicalag_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:rds", "team:claranet", "created-by:terraform"], var.replicalag_extra_tags)
thresholds = {
warning = var.replicalag_threshold_warning
critical = var.replicalag_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:rds", "team:claranet", "created-by:terraform"], var.replicalag_extra_tags)
}

View File

@ -10,13 +10,13 @@ resource "datadog_monitor" "VPN_status" {
) < 1
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:vpn", "team:claranet", "created-by:terraform"], var.vpn_status_extra_tags)

View File

@ -12,24 +12,24 @@ EOQ
critical = 1
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:apimanagement", "team:claranet", "created-by:terraform"], var.status_extra_tags)
}
resource "datadog_monitor" "apimgt_failed_requests" {
count = var.failed_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] API Management too many failed requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.failed_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] API Management too many failed requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.failed_requests_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.failed_requests_time_aggregator}(${var.failed_requests_timeframe}): (
@ -38,29 +38,29 @@ resource "datadog_monitor" "apimgt_failed_requests" {
) * 100 > ${var.failed_requests_threshold_critical}
EOQ
thresholds = {
critical = var.failed_requests_threshold_critical
warning = var.failed_requests_threshold_warning
}
thresholds = {
critical = var.failed_requests_threshold_critical
warning = var.failed_requests_threshold_warning
}
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:apimanagement", "team:claranet", "created-by:terraform"], var.failed_requests_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:apimanagement", "team:claranet", "created-by:terraform"], var.failed_requests_extra_tags)
}
resource "datadog_monitor" "apimgt_other_requests" {
count = var.other_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] API Management too many other requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.other_requests_message, var.message)
type = "query alert"
count = var.other_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] API Management too many other requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.other_requests_message, var.message)
type = "query alert"
query = <<EOQ
${var.other_requests_time_aggregator}(${var.other_requests_timeframe}): (
@ -69,29 +69,29 @@ query = <<EOQ
) * 100 > ${var.other_requests_threshold_critical}
EOQ
thresholds = {
critical = var.other_requests_threshold_critical
warning = var.other_requests_threshold_warning
}
thresholds = {
critical = var.other_requests_threshold_critical
warning = var.other_requests_threshold_warning
}
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:apimanagement", "team:claranet", "created-by:terraform"], var.other_requests_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:apimanagement", "team:claranet", "created-by:terraform"], var.other_requests_extra_tags)
}
resource "datadog_monitor" "apimgt_unauthorized_requests" {
count = var.unauthorized_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] API Management too many unauthorized requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.unauthorized_requests_message, var.message)
type = "query alert"
count = var.unauthorized_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] API Management too many unauthorized requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.unauthorized_requests_message, var.message)
type = "query alert"
query = <<EOQ
${var.unauthorized_requests_time_aggregator}(${var.unauthorized_requests_timeframe}): (
@ -135,18 +135,18 @@ EOQ
thresholds = {
critical = var.successful_requests_threshold_critical
warning = var.successful_requests_threshold_warning
warning = var.successful_requests_threshold_warning
}
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:apimanagement", "team:claranet", "created-by:terraform"], var.successful_requests_extra_tags)
}

View File

@ -12,27 +12,27 @@ resource "datadog_monitor" "appservices_response_time" {
EOQ
thresholds = {
warning = var.response_time_threshold_warning
warning = var.response_time_threshold_warning
critical = var.response_time_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.response_time_extra_tags)
}
# Monitoring App Services memory usage
resource "datadog_monitor" "appservices_memory_usage_count" {
count = var.memory_usage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Services memory usage {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
count = var.memory_usage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Services memory usage {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.memory_usage_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.memory_usage_time_aggregator}(${var.memory_usage_timeframe}): (
@ -40,28 +40,28 @@ resource "datadog_monitor" "appservices_memory_usage_count" {
) > ${var.memory_usage_threshold_critical}
EOQ
thresholds = {
warning = var.memory_usage_threshold_warning
critical = var.memory_usage_threshold_critical
}
thresholds = {
warning = var.memory_usage_threshold_warning
critical = var.memory_usage_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.memory_usage_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.memory_usage_extra_tags)
}
# Monitoring App Services 5xx errors percent
resource "datadog_monitor" "appservices_http_5xx_errors_count" {
count = var.http_5xx_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Services HTTP 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.http_5xx_requests_message, var.message)
type = "query alert"
count = var.http_5xx_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Services HTTP 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.http_5xx_requests_message, var.message)
type = "query alert"
query = <<EOQ
${var.http_5xx_requests_time_aggregator}(${var.http_5xx_requests_timeframe}): (
@ -70,28 +70,28 @@ query = <<EOQ
) * 100 > ${var.http_5xx_requests_threshold_critical}
EOQ
thresholds = {
warning = var.http_5xx_requests_threshold_warning
critical = var.http_5xx_requests_threshold_critical
}
thresholds = {
warning = var.http_5xx_requests_threshold_warning
critical = var.http_5xx_requests_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 1
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 1
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.http_5xx_requests_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.http_5xx_requests_extra_tags)
}
# Monitoring App Services 4xx errors percent
resource "datadog_monitor" "appservices_http_4xx_errors_count" {
count = var.http_4xx_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Services HTTP 4xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.http_4xx_requests_message, var.message)
type = "query alert"
count = var.http_4xx_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Services HTTP 4xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.http_4xx_requests_message, var.message)
type = "query alert"
query = <<EOQ
${var.http_4xx_requests_time_aggregator}(${var.http_4xx_requests_timeframe}): (
@ -133,43 +133,43 @@ resource "datadog_monitor" "appservices_http_success_status_rate" {
EOQ
thresholds = {
warning = var.http_successful_requests_threshold_warning
warning = var.http_successful_requests_threshold_warning
critical = var.http_successful_requests_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 1
include_tags = true
timeout_h = 1
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.http_successful_requests_extra_tags)
}
# Monitoring App Services status
resource "datadog_monitor" "appservices_status" {
count = var.status_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Services is down"
type = "metric alert"
count = var.status_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] App Services is down"
type = "metric alert"
message = coalesce(var.status_message, var.message)
query = <<EOQ
${var.status_time_aggregator}(${var.status_timeframe}):avg:azure.app_services.status${module.filter-tags.query_alert} by {resource_group,region,name} < 1
EOQ
thresholds = {
critical = 1
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.status_extra_tags)
thresholds = {
critical = 1
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.status_extra_tags)
}

View File

@ -12,27 +12,27 @@ resource "datadog_monitor" "azure_search_latency" {
EOQ
thresholds = {
warning = var.latency_threshold_warning
warning = var.latency_threshold_warning
critical = var.latency_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure-search", "team:claranet", "created-by:terraform"], var.latency_extra_tags)
}
# Monitoring Azure Search throttled queries
resource "datadog_monitor" "azure_search_throttled_queries_rate" {
count = var.throttled_queries_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Search throttled queries rate is too high {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}"
count = var.throttled_queries_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Search throttled queries rate is too high {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}"
message = coalesce(var.throttled_queries_rate_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.throttled_queries_rate_time_aggregator}(${var.throttled_queries_rate_timeframe}): (
@ -40,19 +40,19 @@ resource "datadog_monitor" "azure_search_throttled_queries_rate" {
) > ${var.throttled_queries_rate_threshold_critical}
EOQ
thresholds = {
warning = var.throttled_queries_rate_threshold_warning
critical = var.throttled_queries_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure-search", "team:claranet", "created-by:terraform"], var.throttled_queries_rate_extra_tags)
thresholds = {
warning = var.throttled_queries_rate_threshold_warning
critical = var.throttled_queries_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure-search", "team:claranet", "created-by:terraform"], var.throttled_queries_rate_extra_tags)
}

View File

@ -14,24 +14,24 @@ EOQ
critical = 1
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:cosmos_db", "team:claranet", "created-by:terraform"], var.status_extra_tags)
}
resource "datadog_monitor" "cosmos_db_4xx_requests" {
count = var.cosmos_db_4xx_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cosmos DB 4xx requests rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.cosmos_db_4xx_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cosmos DB 4xx requests rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.cosmos_db_4xx_requests_message, var.message)
type = "query alert"
type = "query alert"
# List of available status codes : https://docs.microsoft.com/en-us/rest/api/cosmos-db/http-status-codes-for-cosmosdb
query = <<EOQ
@ -50,29 +50,29 @@ resource "datadog_monitor" "cosmos_db_4xx_requests" {
, 0) * 100 > ${var.cosmos_db_4xx_request_rate_threshold_critical}
EOQ
thresholds = {
critical = var.cosmos_db_4xx_request_rate_threshold_critical
warning = var.cosmos_db_4xx_request_rate_threshold_warning
}
thresholds = {
critical = var.cosmos_db_4xx_request_rate_threshold_critical
warning = var.cosmos_db_4xx_request_rate_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:cosmos_db", "team:claranet", "created-by:terraform"], var.cosmos_db_4xx_request_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:cosmos_db", "team:claranet", "created-by:terraform"], var.cosmos_db_4xx_request_extra_tags)
}
resource "datadog_monitor" "cosmos_db_5xx_requests" {
count = var.cosmos_db_5xx_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cosmos DB 5xx requests rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.cosmos_db_5xx_requests_message, var.message)
type = "query alert"
count = var.cosmos_db_5xx_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cosmos DB 5xx requests rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.cosmos_db_5xx_requests_message, var.message)
type = "query alert"
query = <<EOQ
${var.cosmos_db_5xx_request_time_aggregator}(${var.cosmos_db_5xx_request_timeframe}): default( (
@ -82,31 +82,31 @@ query = <<EOQ
, 0) * 100 > ${var.cosmos_db_5xx_request_rate_threshold_critical}
EOQ
thresholds = {
critical = var.cosmos_db_5xx_request_rate_threshold_critical
warning = var.cosmos_db_5xx_request_rate_threshold_warning
}
thresholds = {
critical = var.cosmos_db_5xx_request_rate_threshold_critical
warning = var.cosmos_db_5xx_request_rate_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:cosmos_db", "team:claranet", "created-by:terraform"], var.cosmos_db_5xx_request_rate_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:cosmos_db", "team:claranet", "created-by:terraform"], var.cosmos_db_5xx_request_rate_extra_tags)
}
resource "datadog_monitor" "cosmos_db_scaling" {
count = var.cosmos_db_scaling_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cosmos DB max scaling reached for collection {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.cosmos_db_scaling_message, var.message)
type = "query alert"
count = var.cosmos_db_scaling_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cosmos DB max scaling reached for collection {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.cosmos_db_scaling_message, var.message)
type = "query alert"
# List of available status codes : https://docs.microsoft.com/en-us/rest/api/cosmos-db/http-status-codes-for-cosmosdb
# List of available status codes : https://docs.microsoft.com/en-us/rest/api/cosmos-db/http-status-codes-for-cosmosdb
query = <<EOQ
${var.cosmos_db_scaling_time_aggregator}(${var.cosmos_db_scaling_timeframe}): default(
default(sum:azure.cosmosdb.total_requests${format(module.filter-tags-statuscode.query_alert, "429")} by {resource_group,region,name,databasename,collectionname}.as_rate(), 0) /

View File

@ -10,14 +10,14 @@ resource "datadog_monitor" "datalakestore_status" {
) < 1
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:datalakestore", "team:claranet", "created-by:terraform"], var.status_extra_tags)

View File

@ -10,24 +10,24 @@ resource "datadog_monitor" "eventgrid_no_successful_message" {
avg:azure.eventgrid_topics.publish_success_count${module.filter-tags.query_alert} by {resource_group,region,name} < 0
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventgrid", "team:claranet", "created-by:terraform"], var.no_successful_message_rate_extra_tags)
}
resource "datadog_monitor" "eventgrid_failed_messages" {
count = var.failed_messages_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Event Grid too many failed messages {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.failed_messages_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Event Grid too many failed messages {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.failed_messages_rate_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.failed_messages_rate_time_aggregator}(${var.failed_messages_rate_timeframe}): (default(
@ -39,29 +39,29 @@ resource "datadog_monitor" "eventgrid_failed_messages" {
) > ${var.failed_messages_rate_thresold_critical}
EOQ
thresholds = {
critical = var.failed_messages_rate_thresold_critical
warning = var.failed_messages_rate_thresold_warning
}
thresholds = {
critical = var.failed_messages_rate_thresold_critical
warning = var.failed_messages_rate_thresold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventgrid", "team:claranet", "created-by:terraform"], var.failed_messages_rate_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventgrid", "team:claranet", "created-by:terraform"], var.failed_messages_rate_extra_tags)
}
resource "datadog_monitor" "eventgrid_unmatched_events" {
count = var.unmatched_events_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Event Grid too many unmatched events {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.unmatched_events_rate_message, var.message)
type = "query alert"
count = var.unmatched_events_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Event Grid too many unmatched events {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.unmatched_events_rate_message, var.message)
type = "query alert"
query = <<EOQ
${var.unmatched_events_rate_time_aggregator}(${var.unmatched_events_rate_timeframe}): (default(
@ -73,21 +73,21 @@ query = <<EOQ
) > ${var.unmatched_events_rate_thresold_critical}
EOQ
thresholds = {
critical = var.unmatched_events_rate_thresold_critical
warning = var.unmatched_events_rate_thresold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventgrid", "team:claranet", "created-by:terraform"], var.unmatched_events_rate_extra_tags)
thresholds = {
critical = var.unmatched_events_rate_thresold_critical
warning = var.unmatched_events_rate_thresold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventgrid", "team:claranet", "created-by:terraform"], var.unmatched_events_rate_extra_tags)
}

View File

@ -10,24 +10,24 @@ resource "datadog_monitor" "eventhub_status" {
) != 1
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventhub", "team:claranet", "created-by:terraform"], var.status_extra_tags)
}
resource "datadog_monitor" "eventhub_failed_requests" {
count = var.failed_requests_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Event Hub too many failed requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.failed_requests_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Event Hub too many failed requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.failed_requests_rate_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.failed_requests_rate_time_aggregator}(${var.failed_requests_rate_timeframe}): (
@ -36,29 +36,29 @@ resource "datadog_monitor" "eventhub_failed_requests" {
) * 100 > ${var.failed_requests_rate_thresold_critical}
EOQ
thresholds = {
critical = var.failed_requests_rate_thresold_critical
warning = var.failed_requests_rate_thresold_warning
}
thresholds = {
critical = var.failed_requests_rate_thresold_critical
warning = var.failed_requests_rate_thresold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventhub", "team:claranet", "created-by:terraform"], var.failed_requests_rate_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventhub", "team:claranet", "created-by:terraform"], var.failed_requests_rate_extra_tags)
}
resource "datadog_monitor" "eventhub_errors" {
count = var.errors_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Event Hub too many errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.errors_rate_message, var.message)
type = "query alert"
count = var.errors_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Event Hub too many errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.errors_rate_message, var.message)
type = "query alert"
query = <<EOQ
${var.errors_rate_time_aggregator}(${var.errors_rate_timeframe}): ( (
@ -69,21 +69,21 @@ query = <<EOQ
) * 100 > ${var.errors_rate_thresold_critical}
EOQ
thresholds = {
critical = var.errors_rate_thresold_critical
warning = var.errors_rate_thresold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventhub", "team:claranet", "created-by:terraform"], var.errors_rate_extra_tags)
thresholds = {
critical = var.errors_rate_thresold_critical
warning = var.errors_rate_thresold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventhub", "team:claranet", "created-by:terraform"], var.errors_rate_extra_tags)
}

View File

@ -12,26 +12,26 @@ resource "datadog_monitor" "function_http_5xx_errors_rate" {
EOQ
thresholds = {
warning = var.http_5xx_errors_rate_threshold_warning
warning = var.http_5xx_errors_rate_threshold_warning
critical = var.http_5xx_errors_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 1
include_tags = true
timeout_h = 1
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure_functions", "team:claranet", "created-by:terraform"], var.http_5xx_errors_rate_extra_tags)
}
resource "datadog_monitor" "function_high_connections_count" {
count = var.high_connections_count_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Function App connections count too high {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
count = var.high_connections_count_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Function App connections count too high {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.high_connections_count_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.high_connections_count_time_aggregator}(${var.high_connections_count_timeframe}):
@ -39,27 +39,27 @@ resource "datadog_monitor" "function_high_connections_count" {
> ${var.high_connections_count_threshold_critical}
EOQ
thresholds = {
warning = var.high_connections_count_threshold_warning
critical = var.high_connections_count_threshold_critical
}
thresholds = {
warning = var.high_connections_count_threshold_warning
critical = var.high_connections_count_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 1
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 1
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure_functions", "team:claranet", "created-by:terraform"], var.high_connections_count_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure_functions", "team:claranet", "created-by:terraform"], var.high_connections_count_extra_tags)
}
resource "datadog_monitor" "function_high_threads_count" {
count = var.high_threads_count_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Function App threads count too high {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.high_threads_count_message, var.message)
type = "query alert"
count = var.high_threads_count_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Function App threads count too high {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.high_threads_count_message, var.message)
type = "query alert"
query = <<EOQ
${var.high_threads_count_time_aggregator}(${var.high_threads_count_timeframe}):
@ -67,19 +67,19 @@ query = <<EOQ
> ${var.high_threads_count_threshold_critical}
EOQ
thresholds = {
warning = var.high_threads_count_threshold_warning
critical = var.high_threads_count_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 1
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure_functions", "team:claranet", "created-by:terraform"], var.high_threads_count_extra_tags)
thresholds = {
warning = var.high_threads_count_threshold_warning
critical = var.high_threads_count_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = false
timeout_h = 1
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure_functions", "team:claranet", "created-by:terraform"], var.high_threads_count_extra_tags)
}

View File

@ -14,28 +14,28 @@ resource "datadog_monitor" "too_many_jobs_failed" {
EOQ
thresholds = {
warning = var.failed_jobs_rate_threshold_warning
warning = var.failed_jobs_rate_threshold_warning
critical = var.failed_jobs_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_jobs_rate_extra_tags)
}
resource "datadog_monitor" "too_many_list_jobs_failed" {
count = var.failed_listjobs_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many list_jobs failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.failed_listjobs_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many list_jobs failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.failed_listjobs_rate_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.failed_listjobs_rate_time_aggregator}(${var.failed_listjobs_rate_timeframe}):
@ -46,29 +46,29 @@ resource "datadog_monitor" "too_many_list_jobs_failed" {
* 100, 0) > ${var.failed_listjobs_rate_threshold_critical}
EOQ
thresholds = {
warning = var.failed_listjobs_rate_threshold_warning
critical = var.failed_listjobs_rate_threshold_critical
}
thresholds = {
warning = var.failed_listjobs_rate_threshold_warning
critical = var.failed_listjobs_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_listjobs_rate_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_listjobs_rate_extra_tags)
}
resource "datadog_monitor" "too_many_query_jobs_failed" {
count = var.failed_queryjobs_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many query_jobs failed {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.failed_queryjobs_rate_message, var.message)
type = "query alert"
count = var.failed_queryjobs_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many query_jobs failed {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.failed_queryjobs_rate_message, var.message)
type = "query alert"
query = <<EOQ
${var.failed_queryjobs_rate_time_aggregator}(${var.failed_queryjobs_rate_timeframe}):
@ -79,29 +79,29 @@ query = <<EOQ
* 100, 0) > ${var.failed_queryjobs_rate_threshold_critical}
EOQ
thresholds = {
warning = var.failed_queryjobs_rate_threshold_warning
critical = var.failed_queryjobs_rate_threshold_critical
}
thresholds = {
warning = var.failed_queryjobs_rate_threshold_warning
critical = var.failed_queryjobs_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_queryjobs_rate_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_queryjobs_rate_extra_tags)
}
resource "datadog_monitor" "status" {
count = var.status_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub is down"
message = coalesce(var.status_message, var.message)
type = "query alert"
count = var.status_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub is down"
message = coalesce(var.status_message, var.message)
type = "query alert"
query = <<EOQ
${var.status_time_aggregator}(${var.status_timeframe}): (
@ -134,24 +134,24 @@ resource "datadog_monitor" "total_devices" {
) == 0
EOQ
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.total_devices_extra_tags)
}
resource "datadog_monitor" "too_many_c2d_methods_failed" {
count = var.failed_c2d_methods_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many c2d methods failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.failed_c2d_methods_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many c2d methods failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.failed_c2d_methods_rate_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.failed_c2d_methods_rate_time_aggregator}(${var.failed_c2d_methods_rate_timeframe}):
@ -162,29 +162,29 @@ resource "datadog_monitor" "too_many_c2d_methods_failed" {
* 100, 0) > ${var.failed_c2d_methods_rate_threshold_critical}
EOQ
thresholds = {
warning = var.failed_c2d_methods_rate_threshold_warning
critical = var.failed_c2d_methods_rate_threshold_critical
}
thresholds = {
warning = var.failed_c2d_methods_rate_threshold_warning
critical = var.failed_c2d_methods_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_c2d_methods_rate_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_c2d_methods_rate_extra_tags)
}
resource "datadog_monitor" "too_many_c2d_twin_read_failed" {
count = var.failed_c2d_twin_read_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many c2d twin read failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.failed_c2d_twin_read_rate_message, var.message)
type = "query alert"
count = var.failed_c2d_twin_read_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many c2d twin read failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.failed_c2d_twin_read_rate_message, var.message)
type = "query alert"
query = <<EOQ
${var.failed_c2d_twin_read_rate_time_aggregator}(${var.failed_c2d_twin_read_rate_timeframe}):
@ -195,29 +195,29 @@ query = <<EOQ
* 100, 0) > ${var.failed_c2d_twin_read_rate_threshold_critical}
EOQ
thresholds = {
warning = var.failed_c2d_twin_read_rate_threshold_warning
critical = var.failed_c2d_twin_read_rate_threshold_critical
}
thresholds = {
warning = var.failed_c2d_twin_read_rate_threshold_warning
critical = var.failed_c2d_twin_read_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_c2d_twin_read_rate_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_c2d_twin_read_rate_extra_tags)
}
resource "datadog_monitor" "too_many_c2d_twin_update_failed" {
count = var.failed_c2d_twin_update_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many c2d twin update failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.failed_c2d_twin_update_rate_message, var.message)
type = "query alert"
count = var.failed_c2d_twin_update_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many c2d twin update failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.failed_c2d_twin_update_rate_message, var.message)
type = "query alert"
query = <<EOQ
${var.failed_c2d_twin_update_rate_time_aggregator}(${var.failed_c2d_twin_update_rate_timeframe}):
@ -262,28 +262,28 @@ resource "datadog_monitor" "too_many_d2c_twin_read_failed" {
EOQ
thresholds = {
warning = var.failed_d2c_twin_read_rate_threshold_warning
warning = var.failed_d2c_twin_read_rate_threshold_warning
critical = var.failed_d2c_twin_read_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_d2c_twin_read_rate_extra_tags)
}
resource "datadog_monitor" "too_many_d2c_twin_update_failed" {
count = var.failed_d2c_twin_update_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many d2c twin update failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.failed_d2c_twin_update_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many d2c twin update failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.failed_d2c_twin_update_rate_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.failed_d2c_twin_update_rate_time_aggregator}(${var.failed_d2c_twin_update_rate_timeframe}):
@ -294,29 +294,29 @@ resource "datadog_monitor" "too_many_d2c_twin_update_failed" {
* 100, 0) > ${var.failed_d2c_twin_update_rate_threshold_critical}
EOQ
thresholds = {
warning = var.failed_d2c_twin_update_rate_threshold_warning
critical = var.failed_d2c_twin_update_rate_threshold_critical
}
thresholds = {
warning = var.failed_d2c_twin_update_rate_threshold_warning
critical = var.failed_d2c_twin_update_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_d2c_twin_update_rate_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_d2c_twin_update_rate_extra_tags)
}
resource "datadog_monitor" "too_many_d2c_telemetry_egress_dropped" {
count = var.dropped_d2c_telemetry_egress_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many d2c telemetry egress dropped {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.dropped_d2c_telemetry_egress_message, var.message)
type = "query alert"
count = var.dropped_d2c_telemetry_egress_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many d2c telemetry egress dropped {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.dropped_d2c_telemetry_egress_message, var.message)
type = "query alert"
query = <<EOQ
${var.dropped_d2c_telemetry_egress_time_aggregator}(${var.dropped_d2c_telemetry_egress_timeframe}):
@ -329,29 +329,29 @@ query = <<EOQ
* 100, 0) > ${var.dropped_d2c_telemetry_egress_rate_threshold_critical}
EOQ
thresholds = {
warning = var.dropped_d2c_telemetry_egress_rate_threshold_warning
critical = var.dropped_d2c_telemetry_egress_rate_threshold_critical
}
thresholds = {
warning = var.dropped_d2c_telemetry_egress_rate_threshold_warning
critical = var.dropped_d2c_telemetry_egress_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.dropped_d2c_telemetry_egress_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.dropped_d2c_telemetry_egress_extra_tags)
}
resource "datadog_monitor" "too_many_d2c_telemetry_egress_orphaned" {
count = var.orphaned_d2c_telemetry_egress_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many d2c telemetry egress orphaned {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.orphaned_d2c_telemetry_egress_message, var.message)
type = "query alert"
count = var.orphaned_d2c_telemetry_egress_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many d2c telemetry egress orphaned {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.orphaned_d2c_telemetry_egress_message, var.message)
type = "query alert"
query = <<EOQ
${var.orphaned_d2c_telemetry_egress_time_aggregator}(${var.orphaned_d2c_telemetry_egress_timeframe}):
@ -400,28 +400,28 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_invalid" {
EOQ
thresholds = {
warning = var.invalid_d2c_telemetry_egress_rate_threshold_warning
warning = var.invalid_d2c_telemetry_egress_rate_threshold_warning
critical = var.invalid_d2c_telemetry_egress_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.invalid_d2c_telemetry_egress_extra_tags)
}
resource "datadog_monitor" "too_many_d2c_telemetry_ingress_nosent" {
count = var.too_many_d2c_telemetry_ingress_nosent_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many d2c telemetry ingress not sent {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
count = var.too_many_d2c_telemetry_ingress_nosent_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub Too many d2c telemetry ingress not sent {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.too_many_d2c_telemetry_ingress_nosent_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
sum(${var.too_many_d2c_telemetry_ingress_nosent_timeframe}):
@ -431,16 +431,16 @@ resource "datadog_monitor" "too_many_d2c_telemetry_ingress_nosent" {
, 0) > 0
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.too_many_d2c_telemetry_ingress_nosent_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.too_many_d2c_telemetry_ingress_nosent_extra_tags)
}

View File

@ -10,24 +10,24 @@ resource "datadog_monitor" "keyvault_status" {
) < 1
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:keyvault", "team:claranet", "created-by:terraform"], var.status_extra_tags)
}
resource "datadog_monitor" "keyvault_api_result" {
count = var.api_result_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Key Vault API result rate is low {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.api_result_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Key Vault API result rate is low {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.status_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.api_result_time_aggregator}(${var.api_result_timeframe}):
@ -38,29 +38,29 @@ resource "datadog_monitor" "keyvault_api_result" {
, 100) < ${var.api_result_threshold_critical}
EOQ
thresholds = {
critical = var.api_result_threshold_critical
warning = var.api_result_threshold_warning
}
thresholds = {
critical = var.api_result_threshold_critical
warning = var.api_result_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:keyvault", "team:claranet", "created-by:terraform"], var.api_result_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:keyvault", "team:claranet", "created-by:terraform"], var.api_result_extra_tags)
}
resource "datadog_monitor" "keyvault_api_latency" {
count = var.api_latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Key Vault API latency is high {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.status_message, var.message)
type = "metric alert"
count = var.api_latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Key Vault API latency is high {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.status_message, var.message)
type = "metric alert"
query = <<EOQ
${var.api_latency_time_aggregator}(${var.api_latency_timeframe}):
@ -68,21 +68,21 @@ query = <<EOQ
> ${var.api_latency_threshold_critical}
EOQ
thresholds = {
critical = var.api_latency_threshold_critical
warning = var.api_latency_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:keyvault", "team:claranet", "created-by:terraform"], var.api_latency_extra_tags)
thresholds = {
critical = var.api_latency_threshold_critical
warning = var.api_latency_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:keyvault", "team:claranet", "created-by:terraform"], var.api_latency_extra_tags)
}

View File

@ -10,14 +10,14 @@ resource "datadog_monitor" "loadbalancer_status" {
) < 1
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:load-balancer", "team:claranet", "created-by:terraform"], var.status_extra_tags)

View File

@ -12,27 +12,27 @@ EOQ
thresholds = {
critical = var.cpu_usage_threshold_critical
warning = var.cpu_usage_threshold_warning
warning = var.cpu_usage_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform"], var.cpu_usage_extra_tags)
}
resource "datadog_monitor" "mysql_free_storage" {
count = var.free_storage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Server storage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.free_storage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Server storage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.free_storage_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.free_storage_time_aggregator}(${var.free_storage_timeframe}): (
@ -40,29 +40,29 @@ resource "datadog_monitor" "mysql_free_storage" {
) < ${var.free_storage_threshold_critical}
EOQ
thresholds = {
critical = var.free_storage_threshold_critical
warning = var.free_storage_threshold_warning
}
thresholds = {
critical = var.free_storage_threshold_critical
warning = var.free_storage_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform"], var.free_storage_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform"], var.free_storage_extra_tags)
}
resource "datadog_monitor" "mysql_io_consumption" {
count = var.io_consumption_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Server IO consumption {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.io_consumption_message, var.message)
type = "query alert"
count = var.io_consumption_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Server IO consumption {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.io_consumption_message, var.message)
type = "query alert"
query = <<EOQ
${var.io_consumption_time_aggregator}(${var.io_consumption_timeframe}): (
@ -70,29 +70,29 @@ query = <<EOQ
) > ${var.io_consumption_threshold_critical}
EOQ
thresholds = {
critical = var.io_consumption_threshold_critical
warning = var.io_consumption_threshold_warning
}
thresholds = {
critical = var.io_consumption_threshold_critical
warning = var.io_consumption_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform"], var.io_consumption_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform"], var.io_consumption_extra_tags)
}
resource "datadog_monitor" "mysql_memory_usage" {
count = var.memory_usage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Server memory usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.memory_usage_message, var.message)
type = "query alert"
count = var.memory_usage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Server memory usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.memory_usage_message, var.message)
type = "query alert"
query = <<EOQ
${var.memory_usage_time_aggregator}(${var.memory_usage_timeframe}): (

View File

@ -12,27 +12,27 @@ EOQ
thresholds = {
critical = var.cpu_usage_threshold_critical
warning = var.cpu_usage_threshold_warning
warning = var.cpu_usage_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:postgresql", "team:claranet", "created-by:terraform"], var.cpu_usage_extra_tags)
}
resource "datadog_monitor" "postgresql_no_connection" {
count = var.no_connection_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Postgresql Server has no connection"
count = var.no_connection_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Postgresql Server has no connection"
message = coalesce(var.no_connection_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.no_connection_time_aggregator}(${var.no_connection_timeframe}): (
@ -40,24 +40,24 @@ resource "datadog_monitor" "postgresql_no_connection" {
) < 1
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:postgresql", "team:claranet", "created-by:terraform"], var.no_connection_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:postgresql", "team:claranet", "created-by:terraform"], var.no_connection_extra_tags)
}
resource "datadog_monitor" "postgresql_free_storage" {
count = var.free_storage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Postgresql Server storage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.free_storage_message, var.message)
type = "query alert"
count = var.free_storage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Postgresql Server storage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.free_storage_message, var.message)
type = "query alert"
query = <<EOQ
${var.free_storage_time_aggregator}(${var.free_storage_timeframe}): (
@ -65,29 +65,29 @@ query = <<EOQ
) < ${var.free_storage_threshold_critical}
EOQ
thresholds = {
critical = var.free_storage_threshold_critical
warning = var.free_storage_threshold_warning
}
thresholds = {
critical = var.free_storage_threshold_critical
warning = var.free_storage_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:postgresql", "team:claranet", "created-by:terraform"], var.free_storage_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:postgresql", "team:claranet", "created-by:terraform"], var.free_storage_extra_tags)
}
resource "datadog_monitor" "postgresql_io_consumption" {
count = var.io_consumption_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Postgresql Server IO consumption {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.io_consumption_message, var.message)
type = "query alert"
count = var.io_consumption_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Postgresql Server IO consumption {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.io_consumption_message, var.message)
type = "query alert"
query = <<EOQ
${var.io_consumption_time_aggregator}(${var.io_consumption_timeframe}): (
@ -127,17 +127,17 @@ EOQ
thresholds = {
critical = var.memory_usage_threshold_critical
warning = var.memory_usage_threshold_warning
warning = var.memory_usage_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:postgresql", "team:claranet", "created-by:terraform"], var.memory_usage_extra_tags)

View File

@ -10,24 +10,24 @@ resource "datadog_monitor" "status" {
) != 1
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:redis", "team:claranet", "created-by:terraform"], var.status_extra_tags)
}
resource "datadog_monitor" "evictedkeys" {
count = var.evictedkeys_limit_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis too many evictedkeys {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
count = var.evictedkeys_limit_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis too many evictedkeys {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.evictedkeys_limit_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.evictedkeys_limit_time_aggregator}(${var.evictedkeys_limit_timeframe}): (
@ -35,29 +35,29 @@ resource "datadog_monitor" "evictedkeys" {
) > ${var.evictedkeys_limit_threshold_critical}
EOQ
thresholds = {
warning = var.evictedkeys_limit_threshold_warning
critical = var.evictedkeys_limit_threshold_critical
}
thresholds = {
warning = var.evictedkeys_limit_threshold_warning
critical = var.evictedkeys_limit_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:redis", "team:claranet", "created-by:terraform"], var.evictedkeys_limit_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:redis", "team:claranet", "created-by:terraform"], var.evictedkeys_limit_extra_tags)
}
resource "datadog_monitor" "percent_processor_time" {
count = var.percent_processor_time_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis processor time too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.percent_processor_time_message, var.message)
type = "query alert"
count = var.percent_processor_time_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis processor time too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.percent_processor_time_message, var.message)
type = "query alert"
query = <<EOQ
${var.percent_processor_time_time_aggregator}(${var.percent_processor_time_timeframe}): (
@ -65,29 +65,29 @@ query = <<EOQ
) > ${var.percent_processor_time_threshold_critical}
EOQ
thresholds = {
warning = var.percent_processor_time_threshold_warning
critical = var.percent_processor_time_threshold_critical
}
thresholds = {
warning = var.percent_processor_time_threshold_warning
critical = var.percent_processor_time_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:redis", "team:claranet", "created-by:terraform"], var.percent_processor_time_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:redis", "team:claranet", "created-by:terraform"], var.percent_processor_time_extra_tags)
}
resource "datadog_monitor" "server_load" {
count = var.server_load_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis server load too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.server_load_rate_message, var.message)
type = "query alert"
count = var.server_load_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis server load too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.server_load_rate_message, var.message)
type = "query alert"
query = <<EOQ
${var.server_load_rate_time_aggregator}(${var.server_load_rate_timeframe}): (

View File

@ -10,24 +10,24 @@ resource "datadog_monitor" "status" {
) != 1
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:serverfarms", "team:claranet", "created-by:terraform"], var.status_extra_tags)
}
resource "datadog_monitor" "cpu_percentage" {
count = var.cpu_percentage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Serverfarm CPU percentage is too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.cpu_percentage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Serverfarm CPU percentage is too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.cpu_percentage_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.cpu_percentage_time_aggregator}(${var.cpu_percentage_timeframe}): (
@ -35,29 +35,29 @@ resource "datadog_monitor" "cpu_percentage" {
) > ${var.cpu_percentage_threshold_critical}
EOQ
thresholds = {
warning = var.cpu_percentage_threshold_warning
critical = var.cpu_percentage_threshold_critical
}
thresholds = {
warning = var.cpu_percentage_threshold_warning
critical = var.cpu_percentage_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:serverfarms", "team:claranet", "created-by:terraform"], var.cpu_percentage_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:serverfarms", "team:claranet", "created-by:terraform"], var.cpu_percentage_extra_tags)
}
resource "datadog_monitor" "memory_percentage" {
count = var.memory_percentage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Serverfarm memory percentage is too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.memory_percentage_message, var.message)
type = "query alert"
count = var.memory_percentage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Serverfarm memory percentage is too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.memory_percentage_message, var.message)
type = "query alert"
query = <<EOQ
${var.memory_percentage_time_aggregator}(${var.memory_percentage_timeframe}): (
@ -65,21 +65,21 @@ query = <<EOQ
) > ${var.memory_percentage_threshold_critical}
EOQ
thresholds = {
warning = var.memory_percentage_threshold_warning
critical = var.memory_percentage_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:serverfarms", "team:claranet", "created-by:terraform"], var.memory_percentage_extra_tags)
thresholds = {
warning = var.memory_percentage_threshold_warning
critical = var.memory_percentage_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:serverfarms", "team:claranet", "created-by:terraform"], var.memory_percentage_extra_tags)
}

View File

@ -10,24 +10,24 @@ resource "datadog_monitor" "servicebus_status" {
) != 1
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:servicebus", "team:claranet", "created-by:terraform"], var.status_extra_tags)
}
resource "datadog_monitor" "service_bus_no_active_connections" {
count = var.no_active_connections_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Service Bus has no active connection"
count = var.no_active_connections_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Service Bus has no active connection"
message = coalesce(var.no_active_connections_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.no_active_connections_time_aggregator}(${var.no_active_connections_timeframe}): (
@ -35,24 +35,24 @@ resource "datadog_monitor" "service_bus_no_active_connections" {
) < 1
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:servicebus", "team:claranet", "created-by:terraform"], var.no_active_connections_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:servicebus", "team:claranet", "created-by:terraform"], var.no_active_connections_extra_tags)
}
resource "datadog_monitor" "service_bus_user_errors" {
count = var.user_errors_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Service Bus user errors rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.user_errors_message, var.message)
type = "query alert"
count = var.user_errors_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Service Bus user errors rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.user_errors_message, var.message)
type = "query alert"
query = <<EOQ
${var.user_errors_time_aggregator}(${var.user_errors_timeframe}): (
@ -61,29 +61,29 @@ query = <<EOQ
) * 100 > ${var.user_errors_threshold_critical}
EOQ
thresholds = {
critical = var.user_errors_threshold_critical
warning = var.user_errors_threshold_warning
}
thresholds = {
critical = var.user_errors_threshold_critical
warning = var.user_errors_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:servicebus", "team:claranet", "created-by:terraform"], var.user_errors_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:servicebus", "team:claranet", "created-by:terraform"], var.user_errors_extra_tags)
}
resource "datadog_monitor" "service_bus_server_errors" {
count = var.server_errors_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Service Bus server errors rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.server_errors_message, var.message)
type = "query alert"
count = var.server_errors_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Service Bus server errors rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.server_errors_message, var.message)
type = "query alert"
query = <<EOQ
${var.server_errors_time_aggregator}(${var.server_errors_timeframe}): (

View File

@ -10,24 +10,24 @@ resource "datadog_monitor" "status" {
) != 1
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-database", "team:claranet", "created-by:terraform"], var.status_extra_tags)
}
resource "datadog_monitor" "sql-database_cpu" {
count = var.cpu_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Database CPU too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.cpu_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Database CPU too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.cpu_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.cpu_time_aggregator}(${var.cpu_timeframe}): (
@ -35,29 +35,29 @@ resource "datadog_monitor" "sql-database_cpu" {
) > ${var.cpu_threshold_critical}
EOQ
thresholds = {
critical = var.cpu_threshold_critical
warning = var.cpu_threshold_warning
}
thresholds = {
critical = var.cpu_threshold_critical
warning = var.cpu_threshold_warning
}
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-database", "team:claranet", "created-by:terraform"], var.cpu_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-database", "team:claranet", "created-by:terraform"], var.cpu_extra_tags)
}
resource "datadog_monitor" "sql-database_free_space_low" {
count = var.diskspace_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Database high disk usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.diskspace_message, var.message)
type = "query alert"
count = var.diskspace_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Database high disk usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.diskspace_message, var.message)
type = "query alert"
query = <<EOQ
${var.diskspace_time_aggregator}(${var.diskspace_timeframe}): (
@ -65,29 +65,29 @@ query = <<EOQ
) > ${var.diskspace_threshold_critical}
EOQ
thresholds = {
warning = var.diskspace_threshold_warning
critical = var.diskspace_threshold_critical
}
thresholds = {
warning = var.diskspace_threshold_warning
critical = var.diskspace_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-database", "team:claranet", "created-by:terraform"], var.diskspace_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-database", "team:claranet", "created-by:terraform"], var.diskspace_extra_tags)
}
resource "datadog_monitor" "sql-database_dtu_consumption_high" {
count = var.dtu_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Database DTU Consumption too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.dtu_message, var.message)
type = "query alert"
count = var.dtu_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Database DTU Consumption too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.dtu_message, var.message)
type = "query alert"
query = <<EOQ
${var.dtu_time_aggregator}(${var.dtu_timeframe}): (
@ -129,14 +129,14 @@ EOQ
critical = var.deadlock_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-database", "team:claranet", "created-by:terraform"], var.deadlock_extra_tags)

View File

@ -12,27 +12,27 @@ EOQ
thresholds = {
critical = var.cpu_threshold_critical
warning = var.cpu_threshold_warning
warning = var.cpu_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-elasticpool", "team:claranet", "created-by:terraform"], var.cpu_extra_tags)
}
resource "datadog_monitor" "sql_elasticpool_free_space_low" {
count = var.diskspace_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Elastic Pool high disk usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.diskspace_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Elastic Pool high disk usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.diskspace_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.diskspace_time_aggregator}(${var.diskspace_timeframe}): (
@ -40,29 +40,29 @@ resource "datadog_monitor" "sql_elasticpool_free_space_low" {
) > ${var.diskspace_threshold_critical}
EOQ
thresholds = {
warning = var.diskspace_threshold_warning
critical = var.diskspace_threshold_critical
}
thresholds = {
warning = var.diskspace_threshold_warning
critical = var.diskspace_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-elasticpool", "team:claranet", "created-by:terraform"], var.diskspace_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-elasticpool", "team:claranet", "created-by:terraform"], var.diskspace_extra_tags)
}
resource "datadog_monitor" "sql_elasticpool_dtu_consumption_high" {
count = var.dtu_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Elastic Pool DTU Consumption too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.dtu_message, var.message)
type = "query alert"
count = var.dtu_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] SQL Elastic Pool DTU Consumption too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.dtu_message, var.message)
type = "query alert"
query = <<EOQ
${var.dtu_time_aggregator}(${var.dtu_timeframe}): (
@ -70,21 +70,21 @@ query = <<EOQ
) > ${var.dtu_threshold_critical}
EOQ
thresholds = {
warning = var.dtu_threshold_warning
critical = var.dtu_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-elasticpool", "team:claranet", "created-by:terraform"], var.dtu_extra_tags)
thresholds = {
warning = var.dtu_threshold_warning
critical = var.dtu_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-elasticpool", "team:claranet", "created-by:terraform"], var.dtu_extra_tags)
}

View File

@ -12,27 +12,27 @@ EOQ
thresholds = {
critical = var.availability_threshold_critical
warning = var.availability_threshold_warning
warning = var.availability_threshold_warning
}
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.availability_extra_tags)
}
resource "datadog_monitor" "successful_requests" {
count = var.successful_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too few successful requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.successful_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too few successful requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.successful_requests_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.successful_requests_time_aggregator}(${var.successful_requests_timeframe}): (default(
@ -40,29 +40,29 @@ resource "datadog_monitor" "successful_requests" {
100)) < ${var.successful_requests_threshold_critical}
EOQ
thresholds = {
critical = var.successful_requests_threshold_critical
warning = var.successful_requests_threshold_warning
}
thresholds = {
critical = var.successful_requests_threshold_critical
warning = var.successful_requests_threshold_warning
}
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.successful_requests_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.successful_requests_extra_tags)
}
resource "datadog_monitor" "latency" {
count = var.latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.latency_message, var.message)
type = "query alert"
count = var.latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.latency_message, var.message)
type = "query alert"
query = <<EOQ
${var.latency_time_aggregator}(${var.latency_timeframe}): (default(
@ -70,29 +70,29 @@ query = <<EOQ
0)) > ${var.latency_threshold_critical}
EOQ
thresholds = {
critical = var.latency_threshold_critical
warning = var.latency_threshold_warning
}
thresholds = {
critical = var.latency_threshold_critical
warning = var.latency_threshold_warning
}
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags)
}
resource "datadog_monitor" "timeout_error_requests" {
count = var.timeout_error_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.timeout_error_requests_message, var.message)
type = "query alert"
count = var.timeout_error_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.timeout_error_requests_message, var.message)
type = "query alert"
query = <<EOQ
${var.timeout_error_requests_time_aggregator}(${var.timeout_error_requests_timeframe}): (default(
@ -132,27 +132,27 @@ EOQ
thresholds = {
critical = var.network_error_requests_threshold_critical
warning = var.network_error_requests_threshold_warning
warning = var.network_error_requests_threshold_warning
}
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.network_error_requests_extra_tags)
}
resource "datadog_monitor" "throttling_error_requests" {
count = var.throttling_error_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.throttling_error_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.throttling_error_requests_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.throttling_error_requests_time_aggregator}(${var.throttling_error_requests_timeframe}): (default(
@ -160,29 +160,29 @@ resource "datadog_monitor" "throttling_error_requests" {
0)) > ${var.throttling_error_requests_threshold_critical}
EOQ
thresholds = {
critical = var.throttling_error_requests_threshold_critical
warning = var.throttling_error_requests_threshold_warning
}
thresholds = {
critical = var.throttling_error_requests_threshold_critical
warning = var.throttling_error_requests_threshold_warning
}
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.throttling_error_requests_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.throttling_error_requests_extra_tags)
}
resource "datadog_monitor" "server_other_error_requests" {
count = var.server_other_error_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.server_other_error_requests_message, var.message)
type = "query alert"
count = var.server_other_error_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.server_other_error_requests_message, var.message)
type = "query alert"
query = <<EOQ
${var.server_other_error_requests_time_aggregator}(${var.server_other_error_requests_timeframe}): (default(
@ -190,29 +190,29 @@ query = <<EOQ
0)) > ${var.server_other_error_requests_threshold_critical}
EOQ
thresholds = {
critical = var.server_other_error_requests_threshold_critical
warning = var.server_other_error_requests_threshold_warning
}
thresholds = {
critical = var.server_other_error_requests_threshold_critical
warning = var.server_other_error_requests_threshold_warning
}
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.server_other_error_requests_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.server_other_error_requests_extra_tags)
}
resource "datadog_monitor" "client_other_error_requests" {
count = var.client_other_error_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.client_other_error_requests_message, var.message)
type = "query alert"
count = var.client_other_error_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.client_other_error_requests_message, var.message)
type = "query alert"
query = <<EOQ
${var.client_other_error_requests_time_aggregator}(${var.client_other_error_requests_timeframe}): (default(
@ -252,18 +252,18 @@ EOQ
thresholds = {
critical = var.authorization_error_requests_threshold_critical
warning = var.authorization_error_requests_threshold_warning
warning = var.authorization_error_requests_threshold_warning
}
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
renotify_interval = 0
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.authorization_error_requests_extra_tags)
}

View File

@ -10,24 +10,24 @@ resource "datadog_monitor" "status" {
) < 1
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:stream-analytics", "team:claranet", "created-by:terraform"], var.status_extra_tags)
}
resource "datadog_monitor" "su_utilization" {
count = var.su_utilization_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Stream Analytics streaming units utilization too high {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
count = var.su_utilization_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Stream Analytics streaming units utilization too high {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.su_utilization_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.su_utilization_time_aggregator}(${var.su_utilization_timeframe}): (
@ -35,29 +35,29 @@ resource "datadog_monitor" "su_utilization" {
) > ${var.su_utilization_threshold_critical}
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
thresholds = {
warning = var.su_utilization_threshold_warning
critical = var.su_utilization_threshold_critical
}
thresholds = {
warning = var.su_utilization_threshold_warning
critical = var.su_utilization_threshold_critical
}
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:stream-analytics", "team:claranet", "created-by:terraform"], var.su_utilization_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:stream-analytics", "team:claranet", "created-by:terraform"], var.su_utilization_extra_tags)
}
resource "datadog_monitor" "failed_function_requests" {
count = var.failed_function_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Stream Analytics too many failed requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.failed_function_requests_message, var.message)
type = "query alert"
count = var.failed_function_requests_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Stream Analytics too many failed requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.failed_function_requests_message, var.message)
type = "query alert"
query = <<EOQ
${var.failed_function_requests_time_aggregator}(${var.failed_function_requests_timeframe}): (
@ -66,29 +66,29 @@ query = <<EOQ
) * 100 > ${var.failed_function_requests_threshold_critical}
EOQ
thresholds = {
warning = var.failed_function_requests_threshold_warning
critical = var.failed_function_requests_threshold_critical
}
thresholds = {
warning = var.failed_function_requests_threshold_warning
critical = var.failed_function_requests_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 60
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 60
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:stream-analytics", "team:claranet", "created-by:terraform"], var.failed_function_requests_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:stream-analytics", "team:claranet", "created-by:terraform"], var.failed_function_requests_extra_tags)
}
resource "datadog_monitor" "conversion_errors" {
count = var.conversion_errors_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Stream Analytics too many conversion errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.conversion_errors_message, var.message)
type = "query alert"
count = var.conversion_errors_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Stream Analytics too many conversion errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.conversion_errors_message, var.message)
type = "query alert"
query = <<EOQ
${var.conversion_errors_time_aggregator}(${var.conversion_errors_timeframe}): (
@ -127,18 +127,18 @@ resource "datadog_monitor" "runtime_errors" {
EOQ
thresholds = {
warning = var.runtime_errors_threshold_warning
warning = var.runtime_errors_threshold_warning
critical = var.runtime_errors_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:stream-analytics", "team:claranet", "created-by:terraform"], var.runtime_errors_extra_tags)

View File

@ -10,24 +10,24 @@ resource "datadog_monitor" "virtualmachine_status" {
) < 1
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:virtualmachine", "team:claranet", "created-by:terraform"], var.status_extra_tags)
}
resource "datadog_monitor" "virtualmachine_cpu_usage" {
count = var.cpu_usage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Virtual Machine CPU usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.cpu_usage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Virtual Machine CPU usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.cpu_usage_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.cpu_usage_time_aggregator}(${var.cpu_usage_timeframe}): (
@ -35,29 +35,29 @@ resource "datadog_monitor" "virtualmachine_cpu_usage" {
) > ${var.cpu_usage_threshold_critical}
EOQ
thresholds = {
critical = var.cpu_usage_threshold_critical
warning = var.cpu_usage_threshold_warning
}
thresholds = {
critical = var.cpu_usage_threshold_critical
warning = var.cpu_usage_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:virtualmachine", "team:claranet", "created-by:terraform"], var.cpu_usage_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:virtualmachine", "team:claranet", "created-by:terraform"], var.cpu_usage_extra_tags)
}
resource "datadog_monitor" "virtualmachine_credit_cpu_remaining_too_low" {
count = var.cpu_remaining_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Virtual Machine credit CPU {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.cpu_remaining_rate_message, var.message)
type = "query alert"
count = var.cpu_remaining_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Virtual Machine credit CPU {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.cpu_remaining_rate_message, var.message)
type = "query alert"
query = <<EOQ
${var.cpu_remaining_rate_time_aggregator}(${var.cpu_remaining_rate_timeframe}):
@ -68,21 +68,21 @@ query = <<EOQ
* 100 , 100) < ${var.cpu_remaining_rate_threshold_critical}
EOQ
thresholds = {
warning = var.cpu_remaining_rate_threshold_warning
critical = var.cpu_remaining_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:virtualmachine", "team:claranet", "created-by:terraform"], var.cpu_remaining_rate_extra_tags)
thresholds = {
warning = var.cpu_remaining_rate_threshold_warning
critical = var.cpu_remaining_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 1
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:virtualmachine", "team:claranet", "created-by:terraform"], var.cpu_remaining_rate_extra_tags)
}

View File

@ -14,19 +14,19 @@ resource "datadog_monitor" "concurrent_queries" {
EOQ
thresholds = {
warning = var.concurrent_queries_threshold_warning
warning = var.concurrent_queries_threshold_warning
critical = var.concurrent_queries_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
include_tags = true
notify_no_data = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
include_tags = true
notify_no_data = false
require_full_window = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
locked = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.concurrent_queries_extra_tags)
}
@ -35,10 +35,10 @@ EOQ
# Execution Time
#
resource "datadog_monitor" "execution_time" {
count = var.execution_time_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Execution Time {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}"
count = var.execution_time_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Execution Time {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}"
message = coalesce(var.execution_time_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
avg(${var.execution_time_timeframe}):
@ -46,32 +46,32 @@ resource "datadog_monitor" "execution_time" {
> ${var.execution_time_threshold_critical}
EOQ
thresholds = {
warning = var.execution_time_threshold_warning
critical = var.execution_time_threshold_critical
}
thresholds = {
warning = var.execution_time_threshold_warning
critical = var.execution_time_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
include_tags = true
notify_no_data = false
require_full_window = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
include_tags = true
notify_no_data = false
require_full_window = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.execution_time_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.execution_time_extra_tags)
}
#
# Scanned Bytes
#
resource "datadog_monitor" "scanned_bytes" {
count = var.scanned_bytes_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Scanned Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}"
message = coalesce(var.scanned_bytes_message, var.message)
type = "query alert"
count = var.scanned_bytes_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Scanned Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}"
message = coalesce(var.scanned_bytes_message, var.message)
type = "query alert"
query = <<EOQ
avg(${var.scanned_bytes_timeframe}):
@ -79,32 +79,32 @@ query = <<EOQ
> ${var.scanned_bytes_threshold_critical}
EOQ
thresholds = {
warning = var.scanned_bytes_threshold_warning
critical = var.scanned_bytes_threshold_critical
}
thresholds = {
warning = var.scanned_bytes_threshold_warning
critical = var.scanned_bytes_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
include_tags = true
notify_no_data = false
require_full_window = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
include_tags = true
notify_no_data = false
require_full_window = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.scanned_bytes_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.scanned_bytes_extra_tags)
}
#
# Scanned Bytes Billed
#
resource "datadog_monitor" "scanned_bytes_billed" {
count = var.scanned_bytes_billed_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Scanned Bytes Billed {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}"
message = coalesce(var.scanned_bytes_billed_message, var.message)
type = "query alert"
count = var.scanned_bytes_billed_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Scanned Bytes Billed {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}"
message = coalesce(var.scanned_bytes_billed_message, var.message)
type = "query alert"
query = <<EOQ
avg(${var.scanned_bytes_billed_timeframe}):
@ -146,19 +146,19 @@ resource "datadog_monitor" "available_slots" {
EOQ
thresholds = {
warning = var.available_slots_threshold_warning
warning = var.available_slots_threshold_warning
critical = var.available_slots_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
include_tags = true
notify_no_data = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
include_tags = true
notify_no_data = false
require_full_window = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
locked = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.available_slots_extra_tags)
}
@ -167,10 +167,10 @@ EOQ
# Stored Bytes
#
resource "datadog_monitor" "stored_bytes" {
count = var.stored_bytes_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Stored Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B ({{value}}B){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B ({{value}}B){{/is_warning}}"
count = var.stored_bytes_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Stored Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B ({{value}}B){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B ({{value}}B){{/is_warning}}"
message = coalesce(var.stored_bytes_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
avg(${var.stored_bytes_timeframe}):
@ -178,32 +178,32 @@ resource "datadog_monitor" "stored_bytes" {
> ${var.stored_bytes_threshold_critical}
EOQ
thresholds = {
warning = var.stored_bytes_threshold_warning
critical = var.stored_bytes_threshold_critical
}
thresholds = {
warning = var.stored_bytes_threshold_warning
critical = var.stored_bytes_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
include_tags = true
notify_no_data = false
require_full_window = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
include_tags = true
notify_no_data = false
require_full_window = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.stored_bytes_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.stored_bytes_extra_tags)
}
#
# Table Count
#
resource "datadog_monitor" "table_count" {
count = var.table_count_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Table Count {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.table_count_message, var.message)
type = "metric alert"
count = var.table_count_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Table Count {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.table_count_message, var.message)
type = "metric alert"
query = <<EOQ
avg(${var.table_count_timeframe}):
@ -211,32 +211,32 @@ query = <<EOQ
> ${var.table_count_threshold_critical}
EOQ
thresholds = {
warning = var.table_count_threshold_warning
critical = var.table_count_threshold_critical
}
thresholds = {
warning = var.table_count_threshold_warning
critical = var.table_count_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
include_tags = true
notify_no_data = false
require_full_window = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
include_tags = true
notify_no_data = false
require_full_window = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.table_count_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.table_count_extra_tags)
}
#
# Uploaded Bytes
#
resource "datadog_monitor" "uploaded_bytes" {
count = var.uploaded_bytes_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Uploaded Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}"
message = coalesce(var.uploaded_bytes_message, var.message)
type = "query alert"
count = var.uploaded_bytes_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP Big Query Uploaded Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}"
message = coalesce(var.uploaded_bytes_message, var.message)
type = "query alert"
query = <<EOQ
avg(${var.uploaded_bytes_timeframe}):
@ -278,19 +278,19 @@ resource "datadog_monitor" "uploaded_bytes_billed" {
EOQ
thresholds = {
warning = var.uploaded_bytes_billed_threshold_warning
warning = var.uploaded_bytes_billed_threshold_warning
critical = var.uploaded_bytes_billed_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
include_tags = true
notify_no_data = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
include_tags = true
notify_no_data = false
require_full_window = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
locked = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.uploaded_bytes_billed_extra_tags)
}

View File

@ -14,19 +14,19 @@ resource "datadog_monitor" "cpu_utilization" {
EOQ
thresholds = {
warning = var.cpu_utilization_threshold_warning
warning = var.cpu_utilization_threshold_warning
critical = var.cpu_utilization_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = false
renotify_interval = 0
notify_no_data = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:cloud-sql", "team:claranet", "created-by:terraform"], var.cpu_utilization_extra_tags)
}
@ -35,10 +35,10 @@ EOQ
# Disk Utilization
#
resource "datadog_monitor" "disk_utilization" {
count = var.disk_utilization_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cloud SQL Disk Utilization {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.disk_utilization_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cloud SQL Disk Utilization {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.disk_utilization_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.disk_utilization_time_aggregator}(${var.disk_utilization_timeframe}):
@ -46,32 +46,32 @@ resource "datadog_monitor" "disk_utilization" {
> ${var.disk_utilization_threshold_critical}
EOQ
thresholds = {
warning = var.disk_utilization_threshold_warning
critical = var.disk_utilization_threshold_critical
}
thresholds = {
warning = var.disk_utilization_threshold_warning
critical = var.disk_utilization_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = true
renotify_interval = 0
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = true
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:cloud-sql", "team:claranet", "created-by:terraform"], var.disk_utilization_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:cloud-sql", "team:claranet", "created-by:terraform"], var.disk_utilization_extra_tags)
}
#
# Disk Utilization Forecast
#
resource "datadog_monitor" "disk_utilization_forecast" {
count = var.disk_utilization_forecast_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cloud SQL Disk Utilization could reach {{#is_alert}}{{threshold}}%%{{/is_alert}} in a near future"
message = coalesce(var.disk_utilization_forecast_message, var.message)
type = "query alert"
count = var.disk_utilization_forecast_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cloud SQL Disk Utilization could reach {{#is_alert}}{{threshold}}%%{{/is_alert}} in a near future"
message = coalesce(var.disk_utilization_forecast_message, var.message)
type = "query alert"
query = <<EOQ
${var.disk_utilization_forecast_time_aggregator}(${var.disk_utilization_forecast_timeframe}):
@ -127,19 +127,19 @@ resource "datadog_monitor" "memory_utilization" {
EOQ
thresholds = {
warning = var.memory_utilization_threshold_warning
warning = var.memory_utilization_threshold_warning
critical = var.memory_utilization_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = false
renotify_interval = 0
notify_no_data = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:cloud-sql", "team:claranet", "created-by:terraform"], var.memory_utilization_extra_tags)
}
@ -148,10 +148,10 @@ EOQ
# Memory Utilization Forecast
#
resource "datadog_monitor" "memory_utilization_forecast" {
count = var.memory_utilization_forecast_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cloud SQL Memory Utilization could reach {{#is_alert}}{{threshold}}%%{{/is_alert}} in a near future"
count = var.memory_utilization_forecast_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cloud SQL Memory Utilization could reach {{#is_alert}}{{threshold}}%%{{/is_alert}} in a near future"
message = coalesce(var.memory_utilization_forecast_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.memory_utilization_forecast_time_aggregator}(${var.memory_utilization_forecast_timeframe}):
@ -173,32 +173,32 @@ var.memory_utilization_forecast_seasonal_seasonality,
>= ${var.memory_utilization_forecast_threshold_critical}
EOQ
thresholds = {
critical = var.memory_utilization_forecast_threshold_critical
critical_recovery = var.memory_utilization_forecast_threshold_critical_recovery
}
thresholds = {
critical = var.memory_utilization_forecast_threshold_critical
critical_recovery = var.memory_utilization_forecast_threshold_critical_recovery
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = false
renotify_interval = 0
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:cloud-sql", "team:claranet", "created-by:terraform"], var.memory_utilization_forecast_extra_tags)
}
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:cloud-sql", "team:claranet", "created-by:terraform"], var.memory_utilization_forecast_extra_tags)
}
#
# Failover Unavailable
#
resource "datadog_monitor" "failover_unavailable" {
count = var.failover_unavailable_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cloud SQL Failover Unavailable"
message = coalesce(var.failover_unavailable_message, var.message)
type = "metric alert"
#
# Failover Unavailable
#
resource "datadog_monitor" "failover_unavailable" {
count = var.failover_unavailable_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cloud SQL Failover Unavailable"
message = coalesce(var.failover_unavailable_message, var.message)
type = "metric alert"
query = <<EOQ
${var.failover_unavailable_time_aggregator}(${var.failover_unavailable_timeframe}):
@ -207,20 +207,20 @@ EOQ
<= ${var.failover_unavailable_threshold_critical}
EOQ
thresholds = {
critical = var.failover_unavailable_threshold_critical
}
thresholds = {
critical = var.failover_unavailable_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = false
renotify_interval = 0
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:cloud-sql", "team:claranet", "created-by:terraform"], var.failover_unavailable_extra_tags)
}
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:cloud-sql", "team:claranet", "created-by:terraform"], var.failover_unavailable_extra_tags)
}

View File

@ -15,18 +15,18 @@ EOQ
thresholds = {
critical = var.replication_lag_threshold_critical
warning = var.replication_lag_threshold_warning
warning = var.replication_lag_threshold_warning
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = true
renotify_interval = 0
notify_no_data = true
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:cloud-sql", "team:claranet", "created-by:terraform", "engine:mysql"], var.replication_lag_extra_tags)
}

View File

@ -14,19 +14,19 @@ resource "datadog_monitor" "cpu_utilization" {
EOQ
thresholds = {
warning = var.cpu_utilization_threshold_warning
warning = var.cpu_utilization_threshold_warning
critical = var.cpu_utilization_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = true
renotify_interval = 0
notify_no_data = true
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:gce-instance", "team:claranet", "created-by:terraform"], var.cpu_utilization_extra_tags)
}
@ -35,10 +35,10 @@ EOQ
# Disk Throttled Bps
#
resource "datadog_monitor" "disk_throttled_bps" {
count = var.disk_throttled_bps_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Compute Engine instance Disk Throttled Bps {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.disk_throttled_bps_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Compute Engine instance Disk Throttled Bps {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.disk_throttled_bps_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.disk_throttled_bps_time_aggregator}(${var.disk_throttled_bps_timeframe}):
@ -52,32 +52,32 @@ resource "datadog_monitor" "disk_throttled_bps" {
> ${var.disk_throttled_bps_threshold_critical}
EOQ
thresholds = {
warning = var.disk_throttled_bps_threshold_warning
critical = var.disk_throttled_bps_threshold_critical
}
thresholds = {
warning = var.disk_throttled_bps_threshold_warning
critical = var.disk_throttled_bps_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = var.disk_throttled_bps_notify_no_data
renotify_interval = 0
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = var.disk_throttled_bps_notify_no_data
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:gce-instance", "team:claranet", "created-by:terraform"], var.disk_throttled_bps_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:gce-instance", "team:claranet", "created-by:terraform"], var.disk_throttled_bps_extra_tags)
}
#
# Disk Throttled OPS
#
resource "datadog_monitor" "disk_throttled_ops" {
count = var.disk_throttled_ops_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Compute Engine instance Disk Throttled OPS {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.disk_throttled_ops_message, var.message)
type = "query alert"
count = var.disk_throttled_ops_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Compute Engine instance Disk Throttled OPS {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.disk_throttled_ops_message, var.message)
type = "query alert"
query = <<EOQ
${var.disk_throttled_ops_time_aggregator}(${var.disk_throttled_ops_timeframe}):
@ -91,21 +91,21 @@ query = <<EOQ
> ${var.disk_throttled_ops_threshold_critical}
EOQ
thresholds = {
warning = var.disk_throttled_ops_threshold_warning
critical = var.disk_throttled_ops_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = var.disk_throttled_ops_notify_no_data
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:gce-instance", "team:claranet", "created-by:terraform"], var.disk_throttled_ops_extra_tags)
thresholds = {
warning = var.disk_throttled_ops_threshold_warning
critical = var.disk_throttled_ops_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = var.disk_throttled_ops_notify_no_data
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:gce-instance", "team:claranet", "created-by:terraform"], var.disk_throttled_ops_extra_tags)
}

View File

@ -15,19 +15,19 @@ resource "datadog_monitor" "error_rate_4xx" {
EOQ
thresholds = {
warning = var.error_rate_4xx_threshold_warning
warning = var.error_rate_4xx_threshold_warning
critical = var.error_rate_4xx_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = false
renotify_interval = 0
notify_no_data = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:lb", "team:claranet", "created-by:terraform"], var.error_rate_4xx_extra_tags)
}
@ -36,10 +36,10 @@ EOQ
# 5XX Errors
#
resource "datadog_monitor" "error_rate_5xx" {
count = var.error_rate_5xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP LB 5xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.error_rate_5xx_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP LB 5xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.error_rate_5xx_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.error_rate_5xx_time_aggregator}(${var.error_rate_5xx_timeframe}):
@ -48,32 +48,32 @@ resource "datadog_monitor" "error_rate_5xx" {
* 100 > ${var.error_rate_5xx_threshold_critical}
EOQ
thresholds = {
warning = var.error_rate_5xx_threshold_warning
critical = var.error_rate_5xx_threshold_critical
}
thresholds = {
warning = var.error_rate_5xx_threshold_warning
critical = var.error_rate_5xx_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = false
renotify_interval = 0
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:lb", "team:claranet", "created-by:terraform"], var.error_rate_5xx_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:lb", "team:claranet", "created-by:terraform"], var.error_rate_5xx_extra_tags)
}
#
# Backend Latency for service
#
resource "datadog_monitor" "backend_latency_service" {
count = var.backend_latency_service_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP LB service backend latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.backend_latency_service_message, var.message)
type = "query alert"
count = var.backend_latency_service_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP LB service backend latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.backend_latency_service_message, var.message)
type = "query alert"
query = <<EOQ
${var.backend_latency_service_time_aggregator}(${var.backend_latency_service_timeframe}):
@ -81,32 +81,32 @@ query = <<EOQ
> ${var.backend_latency_service_threshold_critical}
EOQ
thresholds = {
warning = var.backend_latency_service_threshold_warning
critical = var.backend_latency_service_threshold_critical
}
thresholds = {
warning = var.backend_latency_service_threshold_warning
critical = var.backend_latency_service_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = false
renotify_interval = 0
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:lb", "team:claranet", "created-by:terraform"], var.backend_latency_service_extra_tags)
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:lb", "team:claranet", "created-by:terraform"], var.backend_latency_service_extra_tags)
}
#
# Backend Latency for bucket
#
resource "datadog_monitor" "backend_latency_bucket" {
count = var.backend_latency_bucket_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP LB bucket backend latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.backend_latency_bucket_message, var.message)
type = "query alert"
count = var.backend_latency_bucket_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP LB bucket backend latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.backend_latency_bucket_message, var.message)
type = "query alert"
query = <<EOQ
${var.backend_latency_bucket_time_aggregator}(${var.backend_latency_bucket_timeframe}):
@ -148,19 +148,19 @@ resource "datadog_monitor" "request_count" {
EOQ
thresholds = {
warning = var.request_count_threshold_warning
warning = var.request_count_threshold_warning
critical = var.request_count_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = false
renotify_interval = 0
notify_no_data = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:lb", "team:claranet", "created-by:terraform"], var.request_count_extra_tags)
}

View File

@ -17,15 +17,15 @@ EOQ
critical = var.sending_operations_count_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = true
renotify_interval = 0
notify_no_data = true
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:pubsub", "team:claranet", "created-by:terraform"], var.sending_operations_count_extra_tags)
}
@ -34,10 +34,10 @@ EOQ
# Unavailable Sending Operations Count
#
resource "datadog_monitor" "unavailable_sending_operations_count" {
count = var.unavailable_sending_operations_count_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP pubsub sending messages with result unavailable {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
count = var.unavailable_sending_operations_count_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] GCP pubsub sending messages with result unavailable {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.unavailable_sending_operations_count_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.unavailable_sending_operations_count_time_aggregator}(${var.unavailable_sending_operations_count_timeframe}):
@ -45,21 +45,21 @@ resource "datadog_monitor" "unavailable_sending_operations_count" {
>= ${var.unavailable_sending_operations_count_threshold_critical}
EOQ
thresholds = {
warning = var.unavailable_sending_operations_count_threshold_warning
critical = var.unavailable_sending_operations_count_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:pubsub", "team:claranet", "created-by:terraform"], var.unavailable_sending_operations_count_extra_tags)
thresholds = {
warning = var.unavailable_sending_operations_count_threshold_warning
critical = var.unavailable_sending_operations_count_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = false
notify_no_data = false
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:pubsub", "team:claranet", "created-by:terraform"], var.unavailable_sending_operations_count_extra_tags)
}

View File

@ -12,11 +12,11 @@ EOF
vars = {
message_alert = var.message_alert
message_alert = var.message_alert
message_warning = var.message_warning
message_nodata = coalesce(var.message_nodata, var.message_alert)
prepend_text = var.prepend_text
append_text = var.append_text
message_nodata = coalesce(var.message_nodata, var.message_alert)
prepend_text = var.prepend_text
append_text = var.append_text
}
}

View File

@ -12,19 +12,19 @@ resource "datadog_monitor" "not_responding" {
EOQ
thresholds = {
warning = var.not_responding_threshold_warning
warning = var.not_responding_threshold_warning
critical = 5
}
no_data_timeframe = var.not_responding_no_data_timeframe
new_host_delay = var.new_host_delay
notify_no_data = true
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
no_data_timeframe = var.not_responding_no_data_timeframe
new_host_delay = var.new_host_delay
notify_no_data = true
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = true
renotify_interval = 0
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.not_responding_extra_tags)
}
@ -33,10 +33,10 @@ EOQ
# Cluster Status Not Green
#
resource "datadog_monitor" "cluster_status_not_green" {
count = var.cluster_status_not_green_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch Cluster status not green"
count = var.cluster_status_not_green_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch Cluster status not green"
message = coalesce(var.cluster_status_not_green_message, var.message)
type = "metric alert"
type = "metric alert"
query = <<EOQ
${var.cluster_status_not_green_time_aggregator}(${var.cluster_status_not_green_timeframe}):
@ -44,31 +44,31 @@ resource "datadog_monitor" "cluster_status_not_green" {
<= ${var.cluster_status_not_green_threshold_critical}
EOQ
thresholds = {
# ok = 2
warning = var.cluster_status_not_green_threshold_warning # Yellow
critical = var.cluster_status_not_green_threshold_critical # Red
}
thresholds = {
# ok = 2
warning = var.cluster_status_not_green_threshold_warning # Yellow
critical = var.cluster_status_not_green_threshold_critical # Red
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.cluster_status_not_green_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.cluster_status_not_green_extra_tags)
}
#
# Cluster Initializing Shards
#
resource "datadog_monitor" "cluster_initializing_shards" {
count = var.cluster_initializing_shards_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch Cluster is initializing shards"
message = coalesce(var.cluster_initializing_shards_message, var.message)
type = "metric alert"
count = var.cluster_initializing_shards_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch Cluster is initializing shards"
message = coalesce(var.cluster_initializing_shards_message, var.message)
type = "metric alert"
query = <<EOQ
${var.cluster_initializing_shards_time_aggregator}(${var.cluster_initializing_shards_timeframe}):
@ -76,30 +76,30 @@ query = <<EOQ
> ${var.cluster_initializing_shards_threshold_critical}
EOQ
thresholds = {
warning = var.cluster_initializing_shards_threshold_warning
critical = var.cluster_initializing_shards_threshold_critical
}
thresholds = {
warning = var.cluster_initializing_shards_threshold_warning
critical = var.cluster_initializing_shards_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.cluster_initializing_shards_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.cluster_initializing_shards_extra_tags)
}
#
# Cluster Relocating Shards
#
resource "datadog_monitor" "cluster_relocating_shards" {
count = var.cluster_relocating_shards_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch Cluster is relocating shards"
message = coalesce(var.cluster_relocating_shards_message, var.message)
type = "metric alert"
count = var.cluster_relocating_shards_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch Cluster is relocating shards"
message = coalesce(var.cluster_relocating_shards_message, var.message)
type = "metric alert"
query = <<EOQ
${var.cluster_relocating_shards_time_aggregator}(${var.cluster_relocating_shards_timeframe}):
@ -139,17 +139,17 @@ resource "datadog_monitor" "cluster_unassigned_shards" {
EOQ
thresholds = {
warning = var.cluster_unassigned_shards_threshold_warning
warning = var.cluster_unassigned_shards_threshold_warning
critical = var.cluster_unassigned_shards_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.cluster_unassigned_shards_extra_tags)
}
@ -158,8 +158,8 @@ EOQ
# Free Space in nodes
#
resource "datadog_monitor" "node_free_space" {
count = var.node_free_space_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch free space < 10%"
count = var.node_free_space_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch free space < 10%"
message = coalesce(var.node_free_space_message, var.message)
type = "query alert"
@ -173,18 +173,18 @@ resource "datadog_monitor" "node_free_space" {
< ${var.node_free_space_threshold_critical}
EOQ
thresholds = {
warning = var.node_free_space_threshold_warning
critical = var.node_free_space_threshold_critical
}
thresholds = {
warning = var.node_free_space_threshold_warning
critical = var.node_free_space_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.node_free_space_extra_tags)
}
@ -193,10 +193,10 @@ notify_no_data = false
# JVM Heap Memory Usage
#
resource "datadog_monitor" "jvm_heap_memory_usage" {
count = var.jvm_heap_memory_usage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch JVM HEAP memory usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.jvm_heap_memory_usage_message, var.message)
type = "query alert"
count = var.jvm_heap_memory_usage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch JVM HEAP memory usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.jvm_heap_memory_usage_message, var.message)
type = "query alert"
query = <<EOQ
${var.jvm_heap_memory_usage_time_aggregator}(${var.jvm_heap_memory_usage_timeframe}):
@ -204,30 +204,30 @@ query = <<EOQ
> ${var.jvm_heap_memory_usage_threshold_critical}
EOQ
thresholds = {
warning = var.jvm_heap_memory_usage_threshold_warning
critical = var.jvm_heap_memory_usage_threshold_critical
}
thresholds = {
warning = var.jvm_heap_memory_usage_threshold_warning
critical = var.jvm_heap_memory_usage_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.jvm_heap_memory_usage_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.jvm_heap_memory_usage_extra_tags)
}
#
# JVM Memory Young Usage
#
resource "datadog_monitor" "jvm_memory_young_usage" {
count = var.jvm_memory_young_usage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch JVM memory Young usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.jvm_memory_young_usage_message, var.message)
type = "query alert"
count = var.jvm_memory_young_usage_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch JVM memory Young usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.jvm_memory_young_usage_message, var.message)
type = "query alert"
query = <<EOQ
${var.jvm_memory_young_usage_time_aggregator}(${var.jvm_memory_young_usage_timeframe}):
@ -267,17 +267,17 @@ resource "datadog_monitor" "jvm_memory_old_usage" {
EOQ
thresholds = {
warning = var.jvm_memory_old_usage_threshold_warning
warning = var.jvm_memory_old_usage_threshold_warning
critical = var.jvm_memory_old_usage_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.jvm_memory_old_usage_extra_tags)
}
@ -286,10 +286,10 @@ EOQ
# JVM Garbace Collector Old Collection Latency
#
resource "datadog_monitor" "jvm_gc_old_collection_latency" {
count = var.jvm_gc_old_collection_latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch average Old-generation garbage collections latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
count = var.jvm_gc_old_collection_latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch average Old-generation garbage collections latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.jvm_gc_old_collection_latency_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.jvm_gc_old_collection_latency_time_aggregator}(${var.jvm_gc_old_collection_latency_timeframe}):
@ -297,18 +297,18 @@ resource "datadog_monitor" "jvm_gc_old_collection_latency" {
> ${var.jvm_gc_old_collection_latency_threshold_critical}
EOQ
thresholds = {
warning = var.jvm_gc_old_collection_latency_threshold_warning
critical = var.jvm_gc_old_collection_latency_threshold_critical
}
thresholds = {
warning = var.jvm_gc_old_collection_latency_threshold_warning
critical = var.jvm_gc_old_collection_latency_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.jvm_gc_old_collection_latency_extra_tags)
}
@ -317,10 +317,10 @@ notify_no_data = false
# JVM Garbace Collector Young Collection Latency
#
resource "datadog_monitor" "jvm_gc_young_collection_latency" {
count = var.jvm_gc_young_collection_latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch average Young-generation garbage collections latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.jvm_gc_young_collection_latency_message, var.message)
type = "query alert"
count = var.jvm_gc_young_collection_latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch average Young-generation garbage collections latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.jvm_gc_young_collection_latency_message, var.message)
type = "query alert"
query = <<EOQ
${var.jvm_gc_young_collection_latency_time_aggregator}(${var.jvm_gc_young_collection_latency_timeframe}):
@ -328,32 +328,32 @@ query = <<EOQ
> ${var.jvm_gc_young_collection_latency_threshold_critical}
EOQ
thresholds = {
warning = var.jvm_gc_young_collection_latency_threshold_warning
critical = var.jvm_gc_young_collection_latency_threshold_critical
}
thresholds = {
warning = var.jvm_gc_young_collection_latency_threshold_warning
critical = var.jvm_gc_young_collection_latency_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.jvm_gc_young_collection_latency_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.jvm_gc_young_collection_latency_extra_tags)
}
#
# Indexing Latency
#
resource "datadog_monitor" "indexing_latency" {
count = var.indexing_latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch average indexing time by document {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.indexing_latency_message, var.message)
type = "query alert"
count = var.indexing_latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch average indexing time by document {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.indexing_latency_message, var.message)
type = "query alert"
// TODO add tags to filter by node type and do not apply this monitor on non-data nodes
// TODO add tags to filter by node type and do not apply this monitor on non-data nodes
query = <<EOQ
${var.indexing_latency_time_aggregator}(${var.indexing_latency_timeframe}):
avg:elasticsearch.indexing.index.time${module.filter-tags.query_alert} by {node_name}/ avg:elasticsearch.indexing.index.total${module.filter-tags.query_alert} by {node_name} * 1000
@ -393,17 +393,17 @@ resource "datadog_monitor" "flush_latency" {
EOQ
thresholds = {
warning = var.flush_latency_threshold_warning
warning = var.flush_latency_threshold_warning
critical = var.flush_latency_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.flush_latency_extra_tags)
}
@ -412,10 +412,10 @@ EOQ
# Open HTTP Connections Anomaly
#
resource "datadog_monitor" "http_connections_anomaly" {
count = var.http_connections_anomaly_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch number of current open HTTP connections anomaly detected"
count = var.http_connections_anomaly_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch number of current open HTTP connections anomaly detected"
message = coalesce(var.http_connections_anomaly_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.http_connections_anomaly_time_aggregator}(${var.http_connections_anomaly_timeframe}):
@ -431,69 +431,69 @@ resource "datadog_monitor" "http_connections_anomaly" {
>= ${var.http_connections_anomaly_threshold_critical}
EOQ
thresholds = {
warning = var.http_connections_anomaly_threshold_warning
critical = var.http_connections_anomaly_threshold_critical
}
thresholds = {
warning = var.http_connections_anomaly_threshold_warning
critical = var.http_connections_anomaly_threshold_critical
}
threshold_windows = {
trigger_window = var.http_connections_anomaly_alert_window
recovery_window = var.http_connections_anomaly_alert_window
}
threshold_windows = {
trigger_window = var.http_connections_anomaly_alert_window
recovery_window = var.http_connections_anomaly_alert_window
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.http_connections_anomaly_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.http_connections_anomaly_extra_tags)
}
#
# Query Latency
#
resource "datadog_monitor" "search_query_latency" {
count = var.search_query_latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch average search query latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.search_query_latency_message, var.message)
type = "query alert"
count = var.search_query_latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch average search query latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.search_query_latency_message, var.message)
type = "query alert"
// TODO add tags to filter by node type and do not apply this monitor on non-data nodes
// TODO add tags to filter by node type and do not apply this monitor on non-data nodes
query = <<EOQ
${var.search_query_latency_time_aggregator}(${var.search_query_latency_timeframe}):
avg:elasticsearch.search.query.time${module.filter-tags.query_alert} by {node_name} / avg:elasticsearch.search.query.total${module.filter-tags.query_alert} by {node_name} * 1000
> ${var.search_query_latency_threshold_critical}
EOQ
thresholds = {
warning = var.search_query_latency_threshold_warning
critical = var.search_query_latency_threshold_critical
}
thresholds = {
warning = var.search_query_latency_threshold_warning
critical = var.search_query_latency_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.search_query_latency_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.search_query_latency_extra_tags)
}
#
# Fetch Latency
#
resource "datadog_monitor" "fetch_latency" {
count = var.fetch_latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch average search fetch latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.fetch_latency_message, var.message)
type = "query alert"
count = var.fetch_latency_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch average search fetch latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}"
message = coalesce(var.fetch_latency_message, var.message)
type = "query alert"
// TODO add tags to filter by node type and do not apply this monitor on non-data nodes
// TODO add tags to filter by node type and do not apply this monitor on non-data nodes
query = <<EOQ
${var.fetch_latency_time_aggregator}(${var.fetch_latency_timeframe}):
avg:elasticsearch.search.fetch.time${module.filter-tags.query_alert} by {node_name} / avg:elasticsearch.search.fetch.total${module.filter-tags.query_alert} by {node_name} * 1000
@ -532,17 +532,17 @@ resource "datadog_monitor" "search_query_change" {
EOQ
thresholds = {
warning = var.search_query_change_threshold_warning
warning = var.search_query_change_threshold_warning
critical = var.search_query_change_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.search_query_change_extra_tags)
}
@ -551,10 +551,10 @@ EOQ
# Fetch Change
#
resource "datadog_monitor" "fetch_change" {
count = var.fetch_change_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch change alert on the number of search fetches currently running"
count = var.fetch_change_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch change alert on the number of search fetches currently running"
message = coalesce(var.fetch_change_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
pct_change(${var.fetch_change_time_aggregator}(${var.fetch_change_timeframe}),${var.fetch_change_timeshift}):
@ -562,64 +562,64 @@ resource "datadog_monitor" "fetch_change" {
>= ${var.fetch_change_threshold_critical}
EOQ
thresholds = {
warning = var.fetch_change_threshold_warning
critical = var.fetch_change_threshold_critical
}
thresholds = {
warning = var.fetch_change_threshold_warning
critical = var.fetch_change_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.fetch_change_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.fetch_change_extra_tags)
}
#
# Field Data Evictions
#
resource "datadog_monitor" "field_data_evictions_change" {
count = var.field_data_evictions_change_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch change alert on the total number of evictions from the fielddata cache"
message = coalesce(var.field_data_evictions_change_message, var.message)
type = "query alert"
count = var.field_data_evictions_change_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch change alert on the total number of evictions from the fielddata cache"
message = coalesce(var.field_data_evictions_change_message, var.message)
type = "query alert"
// TODO add tags to filter by node type and do not apply this monitor on non-data nodes
// TODO add tags to filter by node type and do not apply this monitor on non-data nodes
query = <<EOQ
change(${var.field_data_evictions_change_time_aggregator}(${var.field_data_evictions_change_timeframe}),${var.field_data_evictions_change_timeshift}):
avg:elasticsearch.fielddata.evictions${module.filter-tags.query_alert} by {node_name}
> ${var.field_data_evictions_change_threshold_critical}
EOQ
thresholds = {
warning = var.field_data_evictions_change_threshold_warning
critical = var.field_data_evictions_change_threshold_critical
}
thresholds = {
warning = var.field_data_evictions_change_threshold_warning
critical = var.field_data_evictions_change_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.field_data_evictions_change_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.field_data_evictions_change_extra_tags)
}
#
# Query Cache Evictions
#
resource "datadog_monitor" "query_cache_evictions_change" {
count = var.query_cache_evictions_change_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch change alert on the number of query cache evictions"
message = coalesce(var.query_cache_evictions_change_message, var.message)
type = "query alert"
count = var.query_cache_evictions_change_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch change alert on the number of query cache evictions"
message = coalesce(var.query_cache_evictions_change_message, var.message)
type = "query alert"
// TODO add tags to filter by node type and do not apply this monitor on non-data nodes
// TODO add tags to filter by node type and do not apply this monitor on non-data nodes
query = <<EOQ
change(${var.query_cache_evictions_change_time_aggregator}(${var.query_cache_evictions_change_timeframe}),${var.query_cache_evictions_change_timeshift}):
avg:elasticsearch.indices.query_cache.evictions${module.filter-tags.query_alert} by {node_name}
@ -659,17 +659,17 @@ resource "datadog_monitor" "request_cache_evictions_change" {
EOQ
thresholds = {
warning = var.request_cache_evictions_change_threshold_warning
warning = var.request_cache_evictions_change_threshold_warning
critical = var.request_cache_evictions_change_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.request_cache_evictions_change_extra_tags)
}
@ -678,10 +678,10 @@ EOQ
# Task Time in Queue
#
resource "datadog_monitor" "task_time_in_queue_change" {
count = var.task_time_in_queue_change_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch change alert on the average time spent by tasks in the queue"
count = var.task_time_in_queue_change_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticsearch change alert on the average time spent by tasks in the queue"
message = coalesce(var.task_time_in_queue_change_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
change(${var.task_time_in_queue_change_time_aggregator}(${var.task_time_in_queue_change_timeframe}),${var.task_time_in_queue_change_timeshift}):
@ -689,19 +689,19 @@ resource "datadog_monitor" "task_time_in_queue_change" {
> ${var.task_time_in_queue_change_threshold_critical}
EOQ
thresholds = {
warning = var.task_time_in_queue_change_threshold_warning
critical = var.task_time_in_queue_change_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.task_time_in_queue_change_extra_tags)
thresholds = {
warning = var.task_time_in_queue_change_threshold_warning
critical = var.task_time_in_queue_change_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_audit = false
locked = false
include_tags = true
require_full_window = true
notify_no_data = false
tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.task_time_in_queue_change_extra_tags)
}

View File

@ -8,23 +8,23 @@ resource "datadog_monitor" "mongodb_primary" {
${var.mongodb_primary_aggregator}(${var.mongodb_primary_timeframe}):
min:mongodb.replset.state${module.filter-tags.query_alert} by {replset_name} >= 2
EOQ
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
require_full_window = true
tags = concat(["env:${var.environment}", "type:database", "provider:mongo", "resource:mongodb", "team:claranet", "created-by:terraform"], var.mongodb_primary_extra_tags)
}
resource "datadog_monitor" "mongodb_secondary" {
count = var.mongodb_secondary_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] MongoDB secondary missing"
count = var.mongodb_secondary_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] MongoDB secondary missing"
message = coalesce(var.mongodb_secondary_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.mongodb_secondary_aggregator}(${var.mongodb_secondary_timeframe}):
@ -33,28 +33,28 @@ resource "datadog_monitor" "mongodb_secondary" {
> 1
EOQ
thresholds = {
critical = 1
warning = 0
}
thresholds = {
critical = 1
warning = 0
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
require_full_window = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
require_full_window = true
tags = concat(["env:${var.environment}", "type:database", "provider:mongo", "resource:mongodb", "team:claranet", "created-by:terraform"], var.mongodb_secondary_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:mongo", "resource:mongodb", "team:claranet", "created-by:terraform"], var.mongodb_secondary_extra_tags)
}
resource "datadog_monitor" "mongodb_server_count" {
count = var.mongodb_server_count_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] MongoDB too much servers or wrong monitoring config"
message = coalesce(var.mongodb_server_count_message, var.message)
type = "metric alert"
count = var.mongodb_server_count_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] MongoDB too much servers or wrong monitoring config"
message = coalesce(var.mongodb_server_count_message, var.message)
type = "metric alert"
query = <<EOQ
${var.mongodb_server_count_aggregator}(${var.mongodb_server_count_timeframe}):
@ -62,28 +62,28 @@ query = <<EOQ
> 99
EOQ
thresholds = {
critical = 99
warning = var.mongodb_desired_servers_count
}
thresholds = {
critical = 99
warning = var.mongodb_desired_servers_count
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
require_full_window = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
require_full_window = true
tags = concat(["env:${var.environment}", "type:database", "provider:mongo", "resource:mongodb", "team:claranet", "created-by:terraform"], var.mongodb_secondary_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:mongo", "resource:mongodb", "team:claranet", "created-by:terraform"], var.mongodb_secondary_extra_tags)
}
resource "datadog_monitor" "mongodb_replication" {
count = var.mongodb_replication_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] MongoDB replication lag"
message = coalesce(var.mongodb_replication_message, var.message)
type = "metric alert"
count = var.mongodb_replication_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] MongoDB replication lag"
message = coalesce(var.mongodb_replication_message, var.message)
type = "metric alert"
query = <<EOQ
${var.mongodb_replication_aggregator}(${var.mongodb_replication_timeframe}):

View File

@ -9,28 +9,28 @@ resource "datadog_monitor" "mysql_availability" {
EOQ
thresholds = {
warning = var.mysql_availability_threshold_warning
warning = var.mysql_availability_threshold_warning
critical = 5
}
no_data_timeframe = var.mysql_availability_no_data_timeframe
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
no_data_timeframe = var.mysql_availability_no_data_timeframe
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_availability_extra_tags)
}
resource "datadog_monitor" "mysql_connection" {
count = var.mysql_connection_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Connections limit {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.mysql_connection_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Connections limit {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.mysql_connection_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.mysql_connection_time_aggregator}(${var.mysql_connection_timeframe}): (
@ -39,27 +39,27 @@ resource "datadog_monitor" "mysql_connection" {
) * 100 > ${var.mysql_connection_threshold_critical}
EOQ
thresholds = {
warning = var.mysql_connection_threshold_warning
critical = var.mysql_connection_threshold_critical
}
thresholds = {
warning = var.mysql_connection_threshold_warning
critical = var.mysql_connection_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = true
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = true
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_connection_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_connection_extra_tags)
}
resource "datadog_monitor" "mysql_aborted" {
count = var.mysql_aborted_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Aborted connects {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.mysql_aborted_message, var.message)
type = "query alert"
count = var.mysql_aborted_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Aborted connects {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.mysql_aborted_message, var.message)
type = "query alert"
query = <<EOQ
${var.mysql_aborted_time_aggregator}(${var.mysql_aborted_timeframe}): (
@ -68,27 +68,27 @@ query = <<EOQ
) * 100 > ${var.mysql_aborted_threshold_critical}
EOQ
thresholds = {
warning = var.mysql_aborted_threshold_warning
critical = var.mysql_aborted_threshold_critical
}
thresholds = {
warning = var.mysql_aborted_threshold_warning
critical = var.mysql_aborted_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = true
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = true
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_aborted_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_aborted_extra_tags)
}
resource "datadog_monitor" "mysql_slow" {
count = var.mysql_slow_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Slow queries {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.mysql_slow_message, var.message)
type = "query alert"
count = var.mysql_slow_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Slow queries {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.mysql_slow_message, var.message)
type = "query alert"
query = <<EOQ
${var.mysql_slow_time_aggregator}(${var.mysql_slow_timeframe}): (
@ -127,26 +127,26 @@ resource "datadog_monitor" "mysql_pool_efficiency" {
EOQ
thresholds = {
warning = var.mysql_pool_efficiency_threshold_warning
warning = var.mysql_pool_efficiency_threshold_warning
critical = var.mysql_pool_efficiency_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = true
timeout_h = 0
include_tags = true
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_pool_efficiency_extra_tags)
}
resource "datadog_monitor" "mysql_pool_utilization" {
count = var.mysql_pool_utilization_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Innodb buffer pool utilization {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
count = var.mysql_pool_utilization_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql Innodb buffer pool utilization {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.mysql_pool_utilization_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.mysql_pool_utilization_time_aggregator}(${var.mysql_pool_utilization_timeframe}):
@ -156,27 +156,27 @@ resource "datadog_monitor" "mysql_pool_utilization" {
* 100 > ${var.mysql_pool_utilization_threshold_critical}
EOQ
thresholds = {
warning = var.mysql_pool_utilization_threshold_warning
critical = var.mysql_pool_utilization_threshold_critical
}
thresholds = {
warning = var.mysql_pool_utilization_threshold_warning
critical = var.mysql_pool_utilization_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = true
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = true
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_pool_utilization_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_pool_utilization_extra_tags)
}
resource "datadog_monitor" "mysql_threads_anomaly" {
count = var.mysql_threads_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql threads changed abnormally"
message = coalesce(var.mysql_threads_message, var.message)
type = "metric alert"
count = var.mysql_threads_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql threads changed abnormally"
message = coalesce(var.mysql_threads_message, var.message)
type = "metric alert"
query = <<EOQ
${var.mysql_threads_time_aggregator}(${var.mysql_threads_timeframe}):
@ -193,32 +193,32 @@ query = <<EOQ
>= ${var.mysql_threads_threshold_critical}
EOQ
thresholds = {
critical = var.mysql_threads_threshold_critical
critical_recovery = 0
}
thresholds = {
critical = var.mysql_threads_threshold_critical
critical_recovery = 0
}
threshold_windows = {
trigger_window = var.mysql_threads_alert_window
recovery_window = var.mysql_threads_alert_window
}
threshold_windows = {
trigger_window = var.mysql_threads_alert_window
recovery_window = var.mysql_threads_alert_window
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = true
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = true
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_threads_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_threads_extra_tags)
}
resource "datadog_monitor" "mysql_questions_anomaly" {
count = var.mysql_questions_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql queries changed abnormally"
message = coalesce(var.mysql_questions_message, var.message)
type = "metric alert"
count = var.mysql_questions_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql queries changed abnormally"
message = coalesce(var.mysql_questions_message, var.message)
type = "metric alert"
query = <<EOQ
${var.mysql_questions_time_aggregator}(${var.mysql_questions_timeframe}):

View File

@ -9,28 +9,28 @@ resource "datadog_monitor" "postgresql_availability" {
EOQ
thresholds = {
warning = var.postgresql_availability_threshold_warning
warning = var.postgresql_availability_threshold_warning
critical = 5
}
no_data_timeframe = var.postgresql_availability_no_data_timeframe
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
no_data_timeframe = var.postgresql_availability_no_data_timeframe
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:database", "provider:postgres", "resource:postgresql", "team:claranet", "created-by:terraform"], var.postgresql_availability_extra_tags)
}
resource "datadog_monitor" "postgresql_connection_too_high" {
count = var.postgresql_connection_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] PostgreSQL Connections {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.postgresql_connection_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] PostgreSQL Connections {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.postgresql_connection_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.postgresql_connection_time_aggregator}(${var.postgresql_connection_timeframe}):
@ -38,27 +38,27 @@ resource "datadog_monitor" "postgresql_connection_too_high" {
* 100 > ${var.postgresql_connection_threshold_critical}
EOQ
thresholds = {
warning = var.postgresql_connection_threshold_warning
critical = var.postgresql_connection_threshold_critical
}
thresholds = {
warning = var.postgresql_connection_threshold_warning
critical = var.postgresql_connection_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = true
timeout_h = 0
include_tags = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = true
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:database", "provider:postgres", "resource:postgresql", "team:claranet", "created-by:terraform"], var.postgresql_connection_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:postgres", "resource:postgresql", "team:claranet", "created-by:terraform"], var.postgresql_connection_extra_tags)
}
resource "datadog_monitor" "postgresql_too_many_locks" {
count = var.postgresql_lock_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] PostgreSQL too many locks {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.postgresql_lock_message, var.message)
type = "query alert"
count = var.postgresql_lock_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] PostgreSQL too many locks {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.postgresql_lock_message, var.message)
type = "query alert"
query = <<EOQ
${var.postgresql_lock_time_aggregator}(${var.postgresql_lock_timeframe}):
@ -66,19 +66,19 @@ query = <<EOQ
> ${var.postgresql_lock_threshold_critical}
EOQ
thresholds = {
warning = var.postgresql_lock_threshold_warning
critical = var.postgresql_lock_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = true
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:database", "provider:postgres", "resource:postgresql", "team:claranet", "created-by:terraform"], var.postgresql_lock_extra_tags)
thresholds = {
warning = var.postgresql_lock_threshold_warning
critical = var.postgresql_lock_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
require_full_window = true
timeout_h = 0
include_tags = true
tags = concat(["env:${var.environment}", "type:database", "provider:postgres", "resource:postgresql", "team:claranet", "created-by:terraform"], var.postgresql_lock_extra_tags)
}

View File

@ -12,28 +12,28 @@ resource "datadog_monitor" "not_responding" {
EOQ
thresholds = {
warning = var.not_responding_threshold_warning
warning = var.not_responding_threshold_warning
critical = 5
}
new_host_delay = var.new_host_delay
no_data_timeframe = var.not_responding_no_data_timeframe
notify_no_data = true
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
new_host_delay = var.new_host_delay
no_data_timeframe = var.not_responding_no_data_timeframe
notify_no_data = true
notify_audit = false
locked = false
timeout_h = 0
include_tags = true
require_full_window = true
renotify_interval = 0
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.not_responding_extra_tags)
}
resource "datadog_monitor" "evicted_keys" {
count = var.evictedkeys_change_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis evicted keys {{#is_alert}}{{{comparator}}} {{threshold}}% (+{{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% (+{{value}}%){{/is_warning}}"
count = var.evictedkeys_change_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis evicted keys {{#is_alert}}{{{comparator}}} {{threshold}}% (+{{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% (+{{value}}%){{/is_warning}}"
message = coalesce(var.evictedkeys_change_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
change(${var.evictedkeys_change_time_aggregator}(${var.evictedkeys_change_timeframe}),${var.evictedkeys_change_timeframe}): (
@ -41,29 +41,29 @@ resource "datadog_monitor" "evicted_keys" {
) > ${var.evictedkeys_change_threshold_critical}
EOQ
thresholds = {
warning = var.evictedkeys_change_threshold_warning
critical = var.evictedkeys_change_threshold_critical
}
thresholds = {
warning = var.evictedkeys_change_threshold_warning
critical = var.evictedkeys_change_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.evictedkeys_change_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.evictedkeys_change_extra_tags)
}
resource "datadog_monitor" "expirations" {
count = var.expirations_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis expired keys {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.expirations_rate_message, var.message)
type = "query alert"
count = var.expirations_rate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis expired keys {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.expirations_rate_message, var.message)
type = "query alert"
query = <<EOQ
${var.expirations_rate_time_aggregator}(${var.expirations_rate_timeframe}): (
@ -71,29 +71,29 @@ query = <<EOQ
) > ${var.expirations_rate_threshold_critical}
EOQ
thresholds = {
warning = var.expirations_rate_threshold_warning
critical = var.expirations_rate_threshold_critical
}
thresholds = {
warning = var.expirations_rate_threshold_warning
critical = var.expirations_rate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.expirations_rate_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.expirations_rate_extra_tags)
}
resource "datadog_monitor" "blocked_clients" {
count = var.blocked_clients_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis blocked clients {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.blocked_clients_message, var.message)
type = "query alert"
count = var.blocked_clients_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis blocked clients {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.blocked_clients_message, var.message)
type = "query alert"
query = <<EOQ
${var.blocked_clients_time_aggregator}(${var.blocked_clients_timeframe}): (
@ -133,28 +133,28 @@ resource "datadog_monitor" "keyspace_full" {
EOQ
thresholds = {
warning = var.keyspace_threshold_warning
warning = var.keyspace_threshold_warning
critical = var.keyspace_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.keyspace_extra_tags)
}
resource "datadog_monitor" "memory_used" {
count = var.mem_used_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis memory used {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.mem_used_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis memory used {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.mem_used_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.mem_used_time_aggregator}(${var.mem_used_timeframe}): (
@ -163,29 +163,29 @@ resource "datadog_monitor" "memory_used" {
) * 100 > ${var.mem_used_threshold_critical}
EOQ
thresholds = {
warning = var.mem_used_threshold_warning
critical = var.mem_used_threshold_critical
}
thresholds = {
warning = var.mem_used_threshold_warning
critical = var.mem_used_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.mem_used_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.mem_used_extra_tags)
}
resource "datadog_monitor" "memory_frag" {
count = var.mem_frag_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis memory fragmented {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.mem_frag_message, var.message)
type = "query alert"
count = var.mem_frag_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis memory fragmented {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.mem_frag_message, var.message)
type = "query alert"
query = <<EOQ
${var.mem_frag_time_aggregator}(${var.mem_frag_timeframe}):
@ -193,29 +193,29 @@ query = <<EOQ
* 100 > ${var.mem_frag_threshold_critical}
EOQ
thresholds = {
warning = var.mem_frag_threshold_warning
critical = var.mem_frag_threshold_critical
}
thresholds = {
warning = var.mem_frag_threshold_warning
critical = var.mem_frag_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.mem_frag_extra_tags)
tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.mem_frag_extra_tags)
}
resource "datadog_monitor" "rejected_connections" {
count = var.rejected_con_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis rejected connections {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.rejected_con_message, var.message)
type = "query alert"
count = var.rejected_con_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis rejected connections {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.rejected_con_message, var.message)
type = "query alert"
query = <<EOQ
change(${var.rejected_con_time_aggregator}(${var.rejected_con_timeframe}),${var.rejected_con_timeframe}): (
@ -254,28 +254,28 @@ resource "datadog_monitor" "latency" {
EOQ
thresholds = {
warning = var.latency_threshold_warning
warning = var.latency_threshold_warning
critical = var.latency_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.latency_extra_tags)
}
resource "datadog_monitor" "hitrate" {
count = var.hitrate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis hitrate {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.hitrate_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Redis hitrate {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.hitrate_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.hitrate_time_aggregator}(${var.hitrate_timeframe}): (
@ -285,21 +285,21 @@ resource "datadog_monitor" "hitrate" {
) * 100 < ${var.hitrate_threshold_critical}
EOQ
thresholds = {
warning = var.hitrate_threshold_warning
critical = var.hitrate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.hitrate_extra_tags)
thresholds = {
warning = var.hitrate_threshold_warning
critical = var.hitrate_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = false
tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.hitrate_extra_tags)
}

View File

@ -9,17 +9,17 @@ resource "datadog_monitor" "datadog_apache_process" {
EOQ
thresholds = {
warning = var.apache_connect_threshold_warning
warning = var.apache_connect_threshold_warning
critical = 5
}
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:middleware", "provider:apache", "resource:apache", "team:claranet", "created-by:terraform"], var.apache_connect_extra_tags)

View File

@ -9,28 +9,28 @@ resource "datadog_monitor" "datadog_nginx_process" {
EOQ
thresholds = {
warning = var.nginx_connect_threshold_warning
warning = var.nginx_connect_threshold_warning
critical = 5
}
no_data_timeframe = var.nginx_connect_no_data_timeframe
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
no_data_timeframe = var.nginx_connect_no_data_timeframe
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:middleware", "provider:nginx", "resource:nginx", "team:claranet", "created-by:terraform"], var.nginx_connect_extra_tags)
}
resource "datadog_monitor" "datadog_nginx_dropped_connections" {
count = var.nginx_dropped_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Nginx dropped connections {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
count = var.nginx_dropped_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Nginx dropped connections {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.nginx_dropped_message, var.message)
type = "metric alert"
type = "metric alert"
query = <<EOQ
${var.nginx_dropped_time_aggregator}(${var.nginx_dropped_timeframe}):
@ -38,19 +38,19 @@ resource "datadog_monitor" "datadog_nginx_dropped_connections" {
> ${var.nginx_dropped_threshold_critical}
EOQ
thresholds = {
critical = var.nginx_dropped_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:middleware", "provider:nginx", "resource:nginx", "team:claranet", "created-by:terraform"], var.nginx_dropped_extra_tags)
thresholds = {
critical = var.nginx_dropped_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:middleware", "provider:nginx", "resource:nginx", "team:claranet", "created-by:terraform"], var.nginx_dropped_extra_tags)
}

View File

@ -9,28 +9,28 @@ resource "datadog_monitor" "php_fpm_connect" {
EOQ
thresholds = {
warning = var.php_fpm_connect_threshold_warning
warning = var.php_fpm_connect_threshold_warning
critical = 5
}
no_data_timeframe = var.php_fpm_connect_no_data_timeframe
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
no_data_timeframe = var.php_fpm_connect_no_data_timeframe
new_host_delay = var.new_host_delay
notify_no_data = true
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:middleware", "provider:php-fpm", "resource:php-fpm", "team:claranet", "created-by:terraform"], var.php_fpm_connect_extra_tags)
}
resource "datadog_monitor" "php_fpm_connect_idle" {
count = var.php_fpm_busy_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Php-fpm busy worker {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.php_fpm_busy_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Php-fpm busy worker {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.php_fpm_busy_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.php_fpm_busy_time_aggregator}(${var.php_fpm_busy_timeframe}): (
@ -40,20 +40,20 @@ resource "datadog_monitor" "php_fpm_connect_idle" {
) * 100 > ${var.php_fpm_busy_threshold_critical}
EOQ
thresholds = {
warning = var.php_fpm_busy_threshold_warning
critical = var.php_fpm_busy_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:middleware", "provider:php-fpm", "resource:php-fpm", "team:claranet", "created-by:terraform"], var.php_fpm_busy_extra_tags)
thresholds = {
warning = var.php_fpm_busy_threshold_warning
critical = var.php_fpm_busy_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:middleware", "provider:php-fpm", "resource:php-fpm", "team:claranet", "created-by:terraform"], var.php_fpm_busy_extra_tags)
}

View File

@ -11,27 +11,27 @@ resource "datadog_monitor" "cpu" {
EOQ
thresholds = {
warning = var.cpu_threshold_warning
warning = var.cpu_threshold_warning
critical = var.cpu_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:system", "provider:system-check", "resource:generic", "team:claranet", "created-by:terraform"], var.cpu_extra_tags)
}
resource "datadog_monitor" "load" {
count = var.load_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] CPU load 5 ratio {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
count = var.load_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] CPU load 5 ratio {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}"
message = coalesce(var.load_message, var.message)
type = "query alert"
type = "query alert"
query = <<EOQ
${var.load_time_aggregator}(${var.load_timeframe}): (
@ -39,28 +39,28 @@ resource "datadog_monitor" "load" {
) > ${var.load_threshold_critical}
EOQ
thresholds = {
warning = var.load_threshold_warning
critical = var.load_threshold_critical
}
thresholds = {
warning = var.load_threshold_warning
critical = var.load_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:system", "provider:system-core", "resource:generic", "team:claranet", "created-by:terraform"], var.load_extra_tags)
tags = concat(["env:${var.environment}", "type:system", "provider:system-core", "resource:generic", "team:claranet", "created-by:terraform"], var.load_extra_tags)
}
resource "datadog_monitor" "disk_space" {
count = var.disk_space_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Disk space usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.disk_space_message, var.message)
type = "query alert"
count = var.disk_space_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Disk space usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = coalesce(var.disk_space_message, var.message)
type = "query alert"
query = <<EOQ
${var.disk_space_time_aggregator}(${var.disk_space_timeframe}):
@ -68,28 +68,28 @@ query = <<EOQ
* 100 > ${var.disk_space_threshold_critical}
EOQ
thresholds = {
warning = var.disk_space_threshold_warning
critical = var.disk_space_threshold_critical
}
thresholds = {
warning = var.disk_space_threshold_warning
critical = var.disk_space_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:system", "provider:disk", "resource:generic", "team:claranet", "created-by:terraform"], var.disk_space_extra_tags)
tags = concat(["env:${var.environment}", "type:system", "provider:disk", "resource:generic", "team:claranet", "created-by:terraform"], var.disk_space_extra_tags)
}
resource "datadog_monitor" "disk_space_forecast" {
count = var.disk_space_forecast_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Disk Space usage could reach {{#is_alert}}{{threshold}}%%{{/is_alert}} in a near future"
message = coalesce(var.disk_space_forecast_message, var.message)
type = "query alert"
count = var.disk_space_forecast_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Disk Space usage could reach {{#is_alert}}{{threshold}}%%{{/is_alert}} in a near future"
message = coalesce(var.disk_space_forecast_message, var.message)
type = "query alert"
query = <<EOQ
${var.disk_space_forecast_time_aggregator}(${var.disk_space_forecast_timeframe}):
@ -141,27 +141,27 @@ resource "datadog_monitor" "disk_inodes" {
EOQ
thresholds = {
warning = var.disk_inodes_threshold_warning
warning = var.disk_inodes_threshold_warning
critical = var.disk_inodes_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:system", "provider:disk", "resource:generic", "team:claranet", "created-by:terraform"], var.disk_inodes_extra_tags)
}
resource "datadog_monitor" "memory" {
count = var.memory_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Usable Memory {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
count = var.memory_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Usable Memory {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = var.memory_message
type = "query alert"
type = "query alert"
query = <<EOQ
${var.memory_time_aggregator}(${var.memory_timeframe}):
@ -170,21 +170,21 @@ resource "datadog_monitor" "memory" {
< ${var.memory_threshold_critical}
EOQ
thresholds = {
warning = var.memory_threshold_warning
critical = var.memory_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:system", "provider:system-check", "resource:generic", "team:claranet", "created-by:terraform"], var.memory_extra_tags)
thresholds = {
warning = var.memory_threshold_warning
critical = var.memory_threshold_critical
}
evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay
notify_no_data = false
renotify_interval = 0
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:system", "provider:system-check", "resource:generic", "team:claranet", "created-by:terraform"], var.memory_extra_tags)
}

View File

@ -9,18 +9,18 @@ resource "datadog_monitor" "host_unreachable" {
EOQ
thresholds = {
ok = 1
warning = 1
ok = 1
warning = 1
critical = 5
}
no_data_timeframe = var.unreachable_no_data_timeframe
new_host_delay = var.new_host_delay
notify_no_data = true
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
no_data_timeframe = var.unreachable_no_data_timeframe
new_host_delay = var.new_host_delay
notify_no_data = true
notify_audit = false
timeout_h = 0
include_tags = true
locked = false
require_full_window = true
tags = concat(["env:${var.environment}", "type:system", "provider:host", "resource:unreachable", "team:claranet", "created-by:terraform"], var.unreachable_extra_tags)