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

@ -42,21 +42,21 @@ resource "datadog_monitor" "nginx_ingress_too_many_4xx" {
* 100, 0) > ${var.ingress_4xx_threshold_critical} * 100, 0) > ${var.ingress_4xx_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.ingress_4xx_threshold_warning warning = var.ingress_4xx_threshold_warning
critical = var.ingress_4xx_threshold_critical critical = var.ingress_4xx_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = true 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) 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

@ -35,55 +35,55 @@ resource "datadog_monitor" "disk_out" {
"kubernetes_state.node.out_of_disk"${module.filter-tags.service_check}.by("kubernetescluster","node").last(6).count_by_status() "kubernetes_state.node.out_of_disk"${module.filter-tags.service_check}.by("kubernetescluster","node").last(6).count_by_status()
EOQ EOQ
thresholds = { thresholds = {
warning = var.disk_out_threshold_warning warning = var.disk_out_threshold_warning
critical = 5 critical = 5
} }
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = true 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" { resource "datadog_monitor" "memory_pressure" {
count = var.memory_pressure_enabled == "true" ? 1 : 0 count = var.memory_pressure_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node Memory pressure" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node Memory pressure"
message = coalesce(var.memory_pressure_message, var.message) message = coalesce(var.memory_pressure_message, var.message)
type = "service check" type = "service check"
query = <<EOQ query = <<EOQ
"kubernetes_state.node.memory_pressure"${module.filter-tags.service_check}.by("kubernetescluster","node").last(6).count_by_status() "kubernetes_state.node.memory_pressure"${module.filter-tags.service_check}.by("kubernetescluster","node").last(6).count_by_status()
EOQ EOQ
thresholds = { thresholds = {
warning = var.memory_pressure_threshold_warning warning = var.memory_pressure_threshold_warning
critical = 5 critical = 5
} }
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = true 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" { resource "datadog_monitor" "ready" {
count = var.ready_enabled == "true" ? 1 : 0 count = var.ready_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node not ready" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node not ready"
message = coalesce(var.ready_message, var.message) message = coalesce(var.ready_message, var.message)
type = "service check" type = "service check"
query = <<EOQ query = <<EOQ
"kubernetes_state.node.ready"${module.filter-tags.service_check}.by("kubernetescluster","node").last(6).count_by_status() "kubernetes_state.node.ready"${module.filter-tags.service_check}.by("kubernetescluster","node").last(6).count_by_status()
@ -143,49 +143,49 @@ resource "datadog_monitor" "kubelet_syncloop" {
"kubernetes.kubelet.check.syncloop"${module.filter-tags.service_check}.by("kubernetescluster","name").last(6).count_by_status() "kubernetes.kubelet.check.syncloop"${module.filter-tags.service_check}.by("kubernetescluster","name").last(6).count_by_status()
EOQ EOQ
thresholds = { thresholds = {
warning = var.kubelet_syncloop_threshold_warning warning = var.kubelet_syncloop_threshold_warning
critical = 5 critical = 5
} }
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = true 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" { resource "datadog_monitor" "unregister_net_device" {
count = var.unregister_net_device_enabled == "true" ? 1 : 0 count = var.unregister_net_device_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node Frequent unregister net device" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node Frequent unregister net device"
message = coalesce(var.unregister_net_device_message, var.message) message = coalesce(var.unregister_net_device_message, var.message)
type = "event alert" type = "event alert"
query = <<EOQ 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} 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 EOQ
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false 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" { resource "datadog_monitor" "node_unschedulable" {
count = var.node_unschedulable_enabled == "true" ? 1 : 0 count = var.node_unschedulable_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node unschedulable" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Kubernetes Node unschedulable"
message = coalesce(var.node_unschedulable_message, var.message) message = coalesce(var.node_unschedulable_message, var.message)
type = "metric alert" type = "metric alert"
query = <<EOQ query = <<EOQ
${var.node_unschedulable_time_aggregator}(${var.node_unschedulable_timeframe}): ${var.node_unschedulable_time_aggregator}(${var.node_unschedulable_timeframe}):
@ -254,21 +254,21 @@ resource "datadog_monitor" "volume_inodes" {
* 100 > ${var.volume_inodes_threshold_critical} * 100 > ${var.volume_inodes_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.volume_inodes_threshold_critical critical = var.volume_inodes_threshold_critical
warning = var.volume_inodes_threshold_warning warning = var.volume_inodes_threshold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = true 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) tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.volume_inodes_extra_tags)
} }

View File

@ -39,21 +39,21 @@ resource "datadog_monitor" "error" {
> ${var.error_threshold_critical} > ${var.error_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.error_threshold_critical critical = var.error_threshold_critical
warning = var.error_threshold_warning warning = var.error_threshold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = true 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) tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-pod", "team:claranet", "created-by:terraform"], var.error_extra_tags)
} }

View File

@ -35,28 +35,28 @@ resource "datadog_monitor" "cronjob" {
"kubernetes_state.cronjob.on_schedule_check"${module.filter-tags.service_check}.by("cronjob").last(6).count_by_status() "kubernetes_state.cronjob.on_schedule_check"${module.filter-tags.service_check}.by("cronjob").last(6).count_by_status()
EOQ EOQ
thresholds = { thresholds = {
warning = var.cronjob_threshold_warning warning = var.cronjob_threshold_warning
critical = 5 critical = 5
} }
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = true 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" { resource "datadog_monitor" "replica_available" {
count = var.replica_available_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.replica_available_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.replica_available_time_aggregator}(${var.replica_available_timeframe}): ${var.replica_available_time_aggregator}(${var.replica_available_timeframe}):
@ -65,28 +65,28 @@ query = <<EOQ
+ 1 < ${var.replica_available_threshold_critical} + 1 < ${var.replica_available_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.replica_available_threshold_critical critical = var.replica_available_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = true 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" { resource "datadog_monitor" "replica_ready" {
count = var.replica_ready_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.replica_ready_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.replica_available_time_aggregator}(${var.replica_available_timeframe}): ${var.replica_available_time_aggregator}(${var.replica_available_timeframe}):

View File

@ -40,27 +40,27 @@ resource "datadog_monitor" "ALB_latency" {
> ${var.latency_threshold_critical} > ${var.latency_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.latency_threshold_critical critical = var.latency_threshold_critical
warning = var.latency_threshold_warning warning = var.latency_threshold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = false require_full_window = false
timeout_h = 0 timeout_h = 0
include_tags = true 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" { resource "datadog_monitor" "ALB_httpcode_5xx" {
count = var.httpcode_alb_5xx_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.httpcode_alb_5xx_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.httpcode_alb_5xx_time_aggregator}(${var.httpcode_alb_5xx_timeframe}): ${var.httpcode_alb_5xx_time_aggregator}(${var.httpcode_alb_5xx_timeframe}):
@ -69,27 +69,27 @@ query = <<EOQ
* 100 > ${var.httpcode_alb_5xx_threshold_critical} * 100 > ${var.httpcode_alb_5xx_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.httpcode_alb_5xx_threshold_critical critical = var.httpcode_alb_5xx_threshold_critical
warning = var.httpcode_alb_5xx_threshold_warning warning = var.httpcode_alb_5xx_threshold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = false require_full_window = false
timeout_h = 0 timeout_h = 0
include_tags = true 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" { resource "datadog_monitor" "ALB_httpcode_4xx" {
count = var.httpcode_alb_4xx_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.httpcode_alb_4xx_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.httpcode_alb_4xx_time_aggregator}(${var.httpcode_alb_4xx_timeframe}): ${var.httpcode_alb_4xx_time_aggregator}(${var.httpcode_alb_4xx_timeframe}):
@ -156,19 +156,19 @@ resource "datadog_monitor" "ALB_httpcode_target_4xx" {
* 100 > ${var.httpcode_target_4xx_threshold_critical} * 100 > ${var.httpcode_target_4xx_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.httpcode_target_4xx_threshold_critical critical = var.httpcode_target_4xx_threshold_critical
warning = var.httpcode_target_4xx_threshold_warning warning = var.httpcode_target_4xx_threshold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = false require_full_window = false
timeout_h = 0 timeout_h = 0
include_tags = true 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) tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.httpcode_target_4xx_extra_tags)
} }

View File

@ -41,28 +41,28 @@ resource "datadog_monitor" "API_http_5xx_errors_count" {
* 100 > ${var.http_5xx_requests_threshold_critical} * 100 > ${var.http_5xx_requests_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.http_5xx_requests_threshold_warning warning = var.http_5xx_requests_threshold_warning
critical = var.http_5xx_requests_threshold_critical critical = var.http_5xx_requests_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = false require_full_window = false
timeout_h = 1 timeout_h = 1
include_tags = true 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 # Monitoring API Gateway 4xx errors percent
resource "datadog_monitor" "API_http_4xx_errors_count" { resource "datadog_monitor" "API_http_4xx_errors_count" {
count = var.http_4xx_requests_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.http_4xx_requests_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.http_4xx_requests_time_aggregator}(${var.http_4xx_requests_timeframe}): ${var.http_4xx_requests_time_aggregator}(${var.http_4xx_requests_timeframe}):
@ -71,19 +71,19 @@ query = <<EOQ
* 100 > ${var.http_4xx_requests_threshold_critical} * 100 > ${var.http_4xx_requests_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.http_4xx_requests_threshold_warning warning = var.http_4xx_requests_threshold_warning
critical = var.http_4xx_requests_threshold_critical critical = var.http_4xx_requests_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = false require_full_window = false
timeout_h = 1 timeout_h = 1
include_tags = true 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) tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:apigateway", "team:claranet", "created-by:terraform"], var.http_4xx_requests_extra_tags)
} }

View File

@ -40,24 +40,24 @@ resource "datadog_monitor" "elasticache_max_connection" {
) >= 65000 ) >= 65000
EOQ EOQ
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = true notify_no_data = true
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "elasticache_no_connection" {
count = var.no_connection_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.no_connection_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.no_connection_time_aggregator}(${var.no_connection_timeframe}): ( ${var.no_connection_time_aggregator}(${var.no_connection_timeframe}): (
@ -65,24 +65,24 @@ query = <<EOQ
) <= 0 ) <= 0
EOQ EOQ
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "elasticache_swap" {
count = var.swap_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.swap_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.swap_time_aggregator}(${var.swap_timeframe}): ( ${var.swap_time_aggregator}(${var.swap_timeframe}): (
@ -150,21 +150,21 @@ resource "datadog_monitor" "elasticache_eviction_growing" {
> ${var.eviction_growing_threshold_critical} > ${var.eviction_growing_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.eviction_growing_threshold_warning warning = var.eviction_growing_threshold_warning
critical = var.eviction_growing_threshold_critical critical = var.eviction_growing_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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) tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform"], var.eviction_growing_extra_tags)
} }

View File

@ -42,21 +42,21 @@ resource "datadog_monitor" "memcached_cpu_high" {
) > ${var.cpu_high_threshold_critical} ) > ${var.cpu_high_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.cpu_high_threshold_warning warning = var.cpu_high_threshold_warning
critical = var.cpu_high_threshold_critical critical = var.cpu_high_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = true notify_no_data = true
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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) 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

@ -42,24 +42,24 @@ resource "datadog_monitor" "redis_cpu_high" {
) > ${var.cpu_high_threshold_critical} ) > ${var.cpu_high_threshold_critical}
EOQ EOQ
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = true notify_no_data = true
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "redis_replication_lag" {
count = var.replication_lag_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.replication_lag_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.replication_lag_time_aggregator}(${var.replication_lag_timeframe}): ( ${var.replication_lag_time_aggregator}(${var.replication_lag_timeframe}): (
@ -67,29 +67,29 @@ query = <<EOQ
) > ${var.replication_lag_threshold_critical} ) > ${var.replication_lag_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.replication_lag_threshold_warning warning = var.replication_lag_threshold_warning
critical = var.replication_lag_threshold_critical critical = var.replication_lag_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "redis_commands" {
count = var.commands_enabled == "true" ? 1 : 0 count = var.commands_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache redis is receiving no commands" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Elasticache redis is receiving no commands"
message = coalesce(var.commands_message, var.message) message = coalesce(var.commands_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
sum(${var.commands_timeframe}): ( sum(${var.commands_timeframe}): (

View File

@ -48,30 +48,30 @@ resource "datadog_monitor" "es_free_space_low" {
) < ${var.diskspace_threshold_critical} ) < ${var.diskspace_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.diskspace_threshold_warning warning = var.diskspace_threshold_warning
critical = var.diskspace_threshold_critical critical = var.diskspace_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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 ### ### Elasticsearch cluster CPU monitor ###
resource "datadog_monitor" "es_cpu_90_15min" { resource "datadog_monitor" "es_cpu_90_15min" {
count = var.cpu_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.cpu_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.cpu_time_aggregator}(${var.cpu_timeframe}): ( ${var.cpu_time_aggregator}(${var.cpu_timeframe}): (
@ -79,21 +79,21 @@ query = <<EOQ
) > ${var.cpu_threshold_critical} ) > ${var.cpu_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.cpu_threshold_warning warning = var.cpu_threshold_warning
critical = var.cpu_threshold_critical critical = var.cpu_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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) tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.cpu_extra_tags)
} }

View File

@ -43,29 +43,29 @@ resource "datadog_monitor" "ELB_too_much_4xx" {
* 100 > ${var.elb_4xx_threshold_critical} * 100 > ${var.elb_4xx_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.elb_4xx_threshold_warning warning = var.elb_4xx_threshold_warning
critical = var.elb_4xx_threshold_critical critical = var.elb_4xx_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "ELB_too_much_5xx" {
count = var.elb_5xx_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.elb_5xx_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
sum(${var.elb_5xx_timeframe}): sum(${var.elb_5xx_timeframe}):
@ -74,29 +74,29 @@ query = <<EOQ
* 100 > ${var.elb_5xx_threshold_critical} * 100 > ${var.elb_5xx_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.elb_5xx_threshold_warning warning = var.elb_5xx_threshold_warning
critical = var.elb_5xx_threshold_critical critical = var.elb_5xx_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "ELB_too_much_4xx_backend" {
count = var.elb_backend_4xx_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.elb_backend_4xx_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
sum(${var.elb_backend_4xx_timeframe}): sum(${var.elb_backend_4xx_timeframe}):
@ -166,21 +166,21 @@ resource "datadog_monitor" "ELB_backend_latency" {
> ${var.elb_backend_latency_critical} > ${var.elb_backend_latency_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.elb_backend_latency_warning warning = var.elb_backend_latency_warning
critical = var.elb_backend_latency_critical critical = var.elb_backend_latency_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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) tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_backend_latency_extra_tags)
} }

View File

@ -42,29 +42,29 @@ resource "datadog_monitor" "rds_free_space_low" {
) < ${var.diskspace_threshold_critical} ) < ${var.diskspace_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.diskspace_threshold_warning warning = var.diskspace_threshold_warning
critical = var.diskspace_threshold_critical critical = var.diskspace_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = true notify_no_data = true
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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 ### ### RDS Replica Lag monitor ###
resource "datadog_monitor" "rds_replica_lag" { resource "datadog_monitor" "rds_replica_lag" {
count = var.replicalag_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.replicalag_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
avg(${var.replicalag_timeframe}): ( avg(${var.replicalag_timeframe}): (
@ -72,20 +72,20 @@ query = <<EOQ
) > ${var.replicalag_threshold_critical} ) > ${var.replicalag_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.replicalag_threshold_warning warning = var.replicalag_threshold_warning
critical = var.replicalag_threshold_critical critical = var.replicalag_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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) tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:rds", "team:claranet", "created-by:terraform"], var.replicalag_extra_tags)
} }

View File

@ -38,29 +38,29 @@ resource "datadog_monitor" "apimgt_failed_requests" {
) * 100 > ${var.failed_requests_threshold_critical} ) * 100 > ${var.failed_requests_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.failed_requests_threshold_critical critical = var.failed_requests_threshold_critical
warning = var.failed_requests_threshold_warning warning = var.failed_requests_threshold_warning
} }
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
notify_no_data = false notify_no_data = false
notify_audit = false notify_audit = false
timeout_h = 1 timeout_h = 1
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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.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" { resource "datadog_monitor" "apimgt_other_requests" {
count = var.other_requests_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.other_requests_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.other_requests_time_aggregator}(${var.other_requests_timeframe}): ( ${var.other_requests_time_aggregator}(${var.other_requests_timeframe}): (
@ -69,29 +69,29 @@ query = <<EOQ
) * 100 > ${var.other_requests_threshold_critical} ) * 100 > ${var.other_requests_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.other_requests_threshold_critical critical = var.other_requests_threshold_critical
warning = var.other_requests_threshold_warning warning = var.other_requests_threshold_warning
} }
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
notify_no_data = false notify_no_data = false
notify_audit = false notify_audit = false
timeout_h = 1 timeout_h = 1
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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.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" { resource "datadog_monitor" "apimgt_unauthorized_requests" {
count = var.unauthorized_requests_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.unauthorized_requests_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.unauthorized_requests_time_aggregator}(${var.unauthorized_requests_timeframe}): ( ${var.unauthorized_requests_time_aggregator}(${var.unauthorized_requests_timeframe}): (

View File

@ -40,28 +40,28 @@ resource "datadog_monitor" "appservices_memory_usage_count" {
) > ${var.memory_usage_threshold_critical} ) > ${var.memory_usage_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.memory_usage_threshold_warning warning = var.memory_usage_threshold_warning
critical = var.memory_usage_threshold_critical critical = var.memory_usage_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = false require_full_window = false
timeout_h = 0 timeout_h = 0
include_tags = true 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 # Monitoring App Services 5xx errors percent
resource "datadog_monitor" "appservices_http_5xx_errors_count" { resource "datadog_monitor" "appservices_http_5xx_errors_count" {
count = var.http_5xx_requests_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.http_5xx_requests_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.http_5xx_requests_time_aggregator}(${var.http_5xx_requests_timeframe}): ( ${var.http_5xx_requests_time_aggregator}(${var.http_5xx_requests_timeframe}): (
@ -70,28 +70,28 @@ query = <<EOQ
) * 100 > ${var.http_5xx_requests_threshold_critical} ) * 100 > ${var.http_5xx_requests_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.http_5xx_requests_threshold_warning warning = var.http_5xx_requests_threshold_warning
critical = var.http_5xx_requests_threshold_critical critical = var.http_5xx_requests_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = false require_full_window = false
timeout_h = 1 timeout_h = 1
include_tags = true 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 # Monitoring App Services 4xx errors percent
resource "datadog_monitor" "appservices_http_4xx_errors_count" { resource "datadog_monitor" "appservices_http_4xx_errors_count" {
count = var.http_4xx_requests_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.http_4xx_requests_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.http_4xx_requests_time_aggregator}(${var.http_4xx_requests_timeframe}): ( ${var.http_4xx_requests_time_aggregator}(${var.http_4xx_requests_timeframe}): (
@ -159,17 +159,17 @@ resource "datadog_monitor" "appservices_status" {
${var.status_time_aggregator}(${var.status_timeframe}):avg:azure.app_services.status${module.filter-tags.query_alert} by {resource_group,region,name} < 1 ${var.status_time_aggregator}(${var.status_timeframe}):avg:azure.app_services.status${module.filter-tags.query_alert} by {resource_group,region,name} < 1
EOQ EOQ
thresholds = { thresholds = {
critical = 1 critical = 1
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = true notify_no_data = true
renotify_interval = 0 renotify_interval = 0
require_full_window = false require_full_window = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.status_extra_tags) tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.status_extra_tags)
} }

View File

@ -40,19 +40,19 @@ resource "datadog_monitor" "azure_search_throttled_queries_rate" {
) > ${var.throttled_queries_rate_threshold_critical} ) > ${var.throttled_queries_rate_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.throttled_queries_rate_threshold_warning warning = var.throttled_queries_rate_threshold_warning
critical = var.throttled_queries_rate_threshold_critical critical = var.throttled_queries_rate_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = false require_full_window = false
timeout_h = 0 timeout_h = 0
include_tags = true 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) 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

@ -50,29 +50,29 @@ resource "datadog_monitor" "cosmos_db_4xx_requests" {
, 0) * 100 > ${var.cosmos_db_4xx_request_rate_threshold_critical} , 0) * 100 > ${var.cosmos_db_4xx_request_rate_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.cosmos_db_4xx_request_rate_threshold_critical critical = var.cosmos_db_4xx_request_rate_threshold_critical
warning = var.cosmos_db_4xx_request_rate_threshold_warning warning = var.cosmos_db_4xx_request_rate_threshold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "cosmos_db_5xx_requests" {
count = var.cosmos_db_5xx_requests_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.cosmos_db_5xx_requests_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.cosmos_db_5xx_request_time_aggregator}(${var.cosmos_db_5xx_request_timeframe}): default( ( ${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} , 0) * 100 > ${var.cosmos_db_5xx_request_rate_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.cosmos_db_5xx_request_rate_threshold_critical critical = var.cosmos_db_5xx_request_rate_threshold_critical
warning = var.cosmos_db_5xx_request_rate_threshold_warning warning = var.cosmos_db_5xx_request_rate_threshold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "cosmos_db_scaling" {
count = var.cosmos_db_scaling_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.cosmos_db_scaling_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 # List of available status codes : https://docs.microsoft.com/en-us/rest/api/cosmos-db/http-status-codes-for-cosmosdb
query = <<EOQ query = <<EOQ
${var.cosmos_db_scaling_time_aggregator}(${var.cosmos_db_scaling_timeframe}): default( ${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) / 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

@ -39,29 +39,29 @@ resource "datadog_monitor" "eventgrid_failed_messages" {
) > ${var.failed_messages_rate_thresold_critical} ) > ${var.failed_messages_rate_thresold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.failed_messages_rate_thresold_critical critical = var.failed_messages_rate_thresold_critical
warning = var.failed_messages_rate_thresold_warning warning = var.failed_messages_rate_thresold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "eventgrid_unmatched_events" {
count = var.unmatched_events_rate_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.unmatched_events_rate_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.unmatched_events_rate_time_aggregator}(${var.unmatched_events_rate_timeframe}): (default( ${var.unmatched_events_rate_time_aggregator}(${var.unmatched_events_rate_timeframe}): (default(
@ -73,21 +73,21 @@ query = <<EOQ
) > ${var.unmatched_events_rate_thresold_critical} ) > ${var.unmatched_events_rate_thresold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.unmatched_events_rate_thresold_critical critical = var.unmatched_events_rate_thresold_critical
warning = var.unmatched_events_rate_thresold_warning warning = var.unmatched_events_rate_thresold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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) tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventgrid", "team:claranet", "created-by:terraform"], var.unmatched_events_rate_extra_tags)
} }

View File

@ -36,29 +36,29 @@ resource "datadog_monitor" "eventhub_failed_requests" {
) * 100 > ${var.failed_requests_rate_thresold_critical} ) * 100 > ${var.failed_requests_rate_thresold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.failed_requests_rate_thresold_critical critical = var.failed_requests_rate_thresold_critical
warning = var.failed_requests_rate_thresold_warning warning = var.failed_requests_rate_thresold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "eventhub_errors" {
count = var.errors_rate_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.errors_rate_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.errors_rate_time_aggregator}(${var.errors_rate_timeframe}): ( ( ${var.errors_rate_time_aggregator}(${var.errors_rate_timeframe}): ( (
@ -69,21 +69,21 @@ query = <<EOQ
) * 100 > ${var.errors_rate_thresold_critical} ) * 100 > ${var.errors_rate_thresold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.errors_rate_thresold_critical critical = var.errors_rate_thresold_critical
warning = var.errors_rate_thresold_warning warning = var.errors_rate_thresold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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) tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventhub", "team:claranet", "created-by:terraform"], var.errors_rate_extra_tags)
} }

View File

@ -39,27 +39,27 @@ resource "datadog_monitor" "function_high_connections_count" {
> ${var.high_connections_count_threshold_critical} > ${var.high_connections_count_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.high_connections_count_threshold_warning warning = var.high_connections_count_threshold_warning
critical = var.high_connections_count_threshold_critical critical = var.high_connections_count_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = false require_full_window = false
timeout_h = 1 timeout_h = 1
include_tags = true 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" { resource "datadog_monitor" "function_high_threads_count" {
count = var.high_threads_count_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.high_threads_count_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.high_threads_count_time_aggregator}(${var.high_threads_count_timeframe}): ${var.high_threads_count_time_aggregator}(${var.high_threads_count_timeframe}):
@ -67,19 +67,19 @@ query = <<EOQ
> ${var.high_threads_count_threshold_critical} > ${var.high_threads_count_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.high_threads_count_threshold_warning warning = var.high_threads_count_threshold_warning
critical = var.high_threads_count_threshold_critical critical = var.high_threads_count_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = false require_full_window = false
timeout_h = 1 timeout_h = 1
include_tags = true 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) 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

@ -46,29 +46,29 @@ resource "datadog_monitor" "too_many_list_jobs_failed" {
* 100, 0) > ${var.failed_listjobs_rate_threshold_critical} * 100, 0) > ${var.failed_listjobs_rate_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.failed_listjobs_rate_threshold_warning warning = var.failed_listjobs_rate_threshold_warning
critical = var.failed_listjobs_rate_threshold_critical critical = var.failed_listjobs_rate_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 1 timeout_h = 1
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "too_many_query_jobs_failed" {
count = var.failed_queryjobs_rate_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.failed_queryjobs_rate_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.failed_queryjobs_rate_time_aggregator}(${var.failed_queryjobs_rate_timeframe}): ${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} * 100, 0) > ${var.failed_queryjobs_rate_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.failed_queryjobs_rate_threshold_warning warning = var.failed_queryjobs_rate_threshold_warning
critical = var.failed_queryjobs_rate_threshold_critical critical = var.failed_queryjobs_rate_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 1 timeout_h = 1
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "status" {
count = var.status_enabled == "true" ? 1 : 0 count = var.status_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub is down" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] IOT Hub is down"
message = coalesce(var.status_message, var.message) message = coalesce(var.status_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.status_time_aggregator}(${var.status_timeframe}): ( ${var.status_time_aggregator}(${var.status_timeframe}): (
@ -162,29 +162,29 @@ resource "datadog_monitor" "too_many_c2d_methods_failed" {
* 100, 0) > ${var.failed_c2d_methods_rate_threshold_critical} * 100, 0) > ${var.failed_c2d_methods_rate_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.failed_c2d_methods_rate_threshold_warning warning = var.failed_c2d_methods_rate_threshold_warning
critical = var.failed_c2d_methods_rate_threshold_critical critical = var.failed_c2d_methods_rate_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 1 timeout_h = 1
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "too_many_c2d_twin_read_failed" {
count = var.failed_c2d_twin_read_rate_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.failed_c2d_twin_read_rate_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.failed_c2d_twin_read_rate_time_aggregator}(${var.failed_c2d_twin_read_rate_timeframe}): ${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} * 100, 0) > ${var.failed_c2d_twin_read_rate_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.failed_c2d_twin_read_rate_threshold_warning warning = var.failed_c2d_twin_read_rate_threshold_warning
critical = var.failed_c2d_twin_read_rate_threshold_critical critical = var.failed_c2d_twin_read_rate_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 1 timeout_h = 1
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "too_many_c2d_twin_update_failed" {
count = var.failed_c2d_twin_update_rate_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.failed_c2d_twin_update_rate_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.failed_c2d_twin_update_rate_time_aggregator}(${var.failed_c2d_twin_update_rate_timeframe}): ${var.failed_c2d_twin_update_rate_time_aggregator}(${var.failed_c2d_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} * 100, 0) > ${var.failed_d2c_twin_update_rate_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.failed_d2c_twin_update_rate_threshold_warning warning = var.failed_d2c_twin_update_rate_threshold_warning
critical = var.failed_d2c_twin_update_rate_threshold_critical critical = var.failed_d2c_twin_update_rate_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 1 timeout_h = 1
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "too_many_d2c_telemetry_egress_dropped" {
count = var.dropped_d2c_telemetry_egress_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.dropped_d2c_telemetry_egress_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.dropped_d2c_telemetry_egress_time_aggregator}(${var.dropped_d2c_telemetry_egress_timeframe}): ${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} * 100, 0) > ${var.dropped_d2c_telemetry_egress_rate_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.dropped_d2c_telemetry_egress_rate_threshold_warning warning = var.dropped_d2c_telemetry_egress_rate_threshold_warning
critical = var.dropped_d2c_telemetry_egress_rate_threshold_critical critical = var.dropped_d2c_telemetry_egress_rate_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 1 timeout_h = 1
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "too_many_d2c_telemetry_egress_orphaned" {
count = var.orphaned_d2c_telemetry_egress_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.orphaned_d2c_telemetry_egress_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.orphaned_d2c_telemetry_egress_time_aggregator}(${var.orphaned_d2c_telemetry_egress_timeframe}): ${var.orphaned_d2c_telemetry_egress_time_aggregator}(${var.orphaned_d2c_telemetry_egress_timeframe}):
@ -431,16 +431,16 @@ resource "datadog_monitor" "too_many_d2c_telemetry_ingress_nosent" {
, 0) > 0 , 0) > 0
EOQ EOQ
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 1 timeout_h = 1
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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

@ -38,29 +38,29 @@ resource "datadog_monitor" "keyvault_api_result" {
, 100) < ${var.api_result_threshold_critical} , 100) < ${var.api_result_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.api_result_threshold_critical critical = var.api_result_threshold_critical
warning = var.api_result_threshold_warning warning = var.api_result_threshold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "keyvault_api_latency" {
count = var.api_latency_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.status_message, var.message)
type = "metric alert" type = "metric alert"
query = <<EOQ query = <<EOQ
${var.api_latency_time_aggregator}(${var.api_latency_timeframe}): ${var.api_latency_time_aggregator}(${var.api_latency_timeframe}):
@ -68,21 +68,21 @@ query = <<EOQ
> ${var.api_latency_threshold_critical} > ${var.api_latency_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.api_latency_threshold_critical critical = var.api_latency_threshold_critical
warning = var.api_latency_threshold_warning warning = var.api_latency_threshold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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) tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:keyvault", "team:claranet", "created-by:terraform"], var.api_latency_extra_tags)
} }

View File

@ -40,28 +40,28 @@ resource "datadog_monitor" "mysql_free_storage" {
) < ${var.free_storage_threshold_critical} ) < ${var.free_storage_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.free_storage_threshold_critical critical = var.free_storage_threshold_critical
warning = var.free_storage_threshold_warning warning = var.free_storage_threshold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "mysql_io_consumption" {
count = var.io_consumption_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.io_consumption_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
@ -70,29 +70,29 @@ query = <<EOQ
) > ${var.io_consumption_threshold_critical} ) > ${var.io_consumption_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.io_consumption_threshold_critical critical = var.io_consumption_threshold_critical
warning = var.io_consumption_threshold_warning warning = var.io_consumption_threshold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "mysql_memory_usage" {
count = var.memory_usage_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.memory_usage_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.memory_usage_time_aggregator}(${var.memory_usage_timeframe}): ( ${var.memory_usage_time_aggregator}(${var.memory_usage_timeframe}): (

View File

@ -40,24 +40,24 @@ resource "datadog_monitor" "postgresql_no_connection" {
) < 1 ) < 1
EOQ EOQ
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = true notify_no_data = true
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "postgresql_free_storage" {
count = var.free_storage_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.free_storage_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.free_storage_time_aggregator}(${var.free_storage_timeframe}): ( ${var.free_storage_time_aggregator}(${var.free_storage_timeframe}): (
@ -65,29 +65,29 @@ query = <<EOQ
) < ${var.free_storage_threshold_critical} ) < ${var.free_storage_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.free_storage_threshold_critical critical = var.free_storage_threshold_critical
warning = var.free_storage_threshold_warning warning = var.free_storage_threshold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "postgresql_io_consumption" {
count = var.io_consumption_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.io_consumption_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.io_consumption_time_aggregator}(${var.io_consumption_timeframe}): ( ${var.io_consumption_time_aggregator}(${var.io_consumption_timeframe}): (

View File

@ -35,29 +35,29 @@ resource "datadog_monitor" "evictedkeys" {
) > ${var.evictedkeys_limit_threshold_critical} ) > ${var.evictedkeys_limit_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.evictedkeys_limit_threshold_warning warning = var.evictedkeys_limit_threshold_warning
critical = var.evictedkeys_limit_threshold_critical critical = var.evictedkeys_limit_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "percent_processor_time" {
count = var.percent_processor_time_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.percent_processor_time_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.percent_processor_time_time_aggregator}(${var.percent_processor_time_timeframe}): ( ${var.percent_processor_time_time_aggregator}(${var.percent_processor_time_timeframe}): (
@ -65,29 +65,29 @@ query = <<EOQ
) > ${var.percent_processor_time_threshold_critical} ) > ${var.percent_processor_time_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.percent_processor_time_threshold_warning warning = var.percent_processor_time_threshold_warning
critical = var.percent_processor_time_threshold_critical critical = var.percent_processor_time_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "server_load" {
count = var.server_load_rate_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.server_load_rate_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.server_load_rate_time_aggregator}(${var.server_load_rate_timeframe}): ( ${var.server_load_rate_time_aggregator}(${var.server_load_rate_timeframe}): (

View File

@ -35,28 +35,28 @@ resource "datadog_monitor" "cpu_percentage" {
) > ${var.cpu_percentage_threshold_critical} ) > ${var.cpu_percentage_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.cpu_percentage_threshold_warning warning = var.cpu_percentage_threshold_warning
critical = var.cpu_percentage_threshold_critical critical = var.cpu_percentage_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "memory_percentage" {
count = var.memory_percentage_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.memory_percentage_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
@ -65,21 +65,21 @@ query = <<EOQ
) > ${var.memory_percentage_threshold_critical} ) > ${var.memory_percentage_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.memory_percentage_threshold_warning warning = var.memory_percentage_threshold_warning
critical = var.memory_percentage_threshold_critical critical = var.memory_percentage_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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) tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:serverfarms", "team:claranet", "created-by:terraform"], var.memory_percentage_extra_tags)
} }

View File

@ -35,24 +35,24 @@ resource "datadog_monitor" "service_bus_no_active_connections" {
) < 1 ) < 1
EOQ EOQ
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "service_bus_user_errors" {
count = var.user_errors_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.user_errors_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.user_errors_time_aggregator}(${var.user_errors_timeframe}): ( ${var.user_errors_time_aggregator}(${var.user_errors_timeframe}): (
@ -61,29 +61,29 @@ query = <<EOQ
) * 100 > ${var.user_errors_threshold_critical} ) * 100 > ${var.user_errors_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.user_errors_threshold_critical critical = var.user_errors_threshold_critical
warning = var.user_errors_threshold_warning warning = var.user_errors_threshold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "service_bus_server_errors" {
count = var.server_errors_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.server_errors_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.server_errors_time_aggregator}(${var.server_errors_timeframe}): ( ${var.server_errors_time_aggregator}(${var.server_errors_timeframe}): (

View File

@ -35,29 +35,29 @@ resource "datadog_monitor" "sql-database_cpu" {
) > ${var.cpu_threshold_critical} ) > ${var.cpu_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.cpu_threshold_critical critical = var.cpu_threshold_critical
warning = var.cpu_threshold_warning warning = var.cpu_threshold_warning
} }
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "sql-database_free_space_low" {
count = var.diskspace_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.diskspace_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.diskspace_time_aggregator}(${var.diskspace_timeframe}): ( ${var.diskspace_time_aggregator}(${var.diskspace_timeframe}): (
@ -65,29 +65,29 @@ query = <<EOQ
) > ${var.diskspace_threshold_critical} ) > ${var.diskspace_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.diskspace_threshold_warning warning = var.diskspace_threshold_warning
critical = var.diskspace_threshold_critical critical = var.diskspace_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "sql-database_dtu_consumption_high" {
count = var.dtu_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.dtu_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.dtu_time_aggregator}(${var.dtu_timeframe}): ( ${var.dtu_time_aggregator}(${var.dtu_timeframe}): (

View File

@ -40,29 +40,29 @@ resource "datadog_monitor" "sql_elasticpool_free_space_low" {
) > ${var.diskspace_threshold_critical} ) > ${var.diskspace_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.diskspace_threshold_warning warning = var.diskspace_threshold_warning
critical = var.diskspace_threshold_critical critical = var.diskspace_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "sql_elasticpool_dtu_consumption_high" {
count = var.dtu_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.dtu_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.dtu_time_aggregator}(${var.dtu_timeframe}): ( ${var.dtu_time_aggregator}(${var.dtu_timeframe}): (
@ -70,21 +70,21 @@ query = <<EOQ
) > ${var.dtu_threshold_critical} ) > ${var.dtu_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.dtu_threshold_warning warning = var.dtu_threshold_warning
critical = var.dtu_threshold_critical critical = var.dtu_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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) tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-elasticpool", "team:claranet", "created-by:terraform"], var.dtu_extra_tags)
} }

View File

@ -40,29 +40,29 @@ resource "datadog_monitor" "successful_requests" {
100)) < ${var.successful_requests_threshold_critical} 100)) < ${var.successful_requests_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.successful_requests_threshold_critical 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 new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
notify_no_data = false notify_no_data = false
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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.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" { resource "datadog_monitor" "latency" {
count = var.latency_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.latency_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.latency_time_aggregator}(${var.latency_timeframe}): (default( ${var.latency_time_aggregator}(${var.latency_timeframe}): (default(
@ -70,29 +70,29 @@ query = <<EOQ
0)) > ${var.latency_threshold_critical} 0)) > ${var.latency_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.latency_threshold_critical critical = var.latency_threshold_critical
warning = var.latency_threshold_warning warning = var.latency_threshold_warning
} }
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
notify_no_data = false notify_no_data = false
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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.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" { resource "datadog_monitor" "timeout_error_requests" {
count = var.timeout_error_requests_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.timeout_error_requests_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.timeout_error_requests_time_aggregator}(${var.timeout_error_requests_timeframe}): (default( ${var.timeout_error_requests_time_aggregator}(${var.timeout_error_requests_timeframe}): (default(
@ -160,29 +160,29 @@ resource "datadog_monitor" "throttling_error_requests" {
0)) > ${var.throttling_error_requests_threshold_critical} 0)) > ${var.throttling_error_requests_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.throttling_error_requests_threshold_critical critical = var.throttling_error_requests_threshold_critical
warning = var.throttling_error_requests_threshold_warning warning = var.throttling_error_requests_threshold_warning
} }
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
notify_no_data = false notify_no_data = false
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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.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" { resource "datadog_monitor" "server_other_error_requests" {
count = var.server_other_error_requests_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.server_other_error_requests_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.server_other_error_requests_time_aggregator}(${var.server_other_error_requests_timeframe}): (default( ${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} 0)) > ${var.server_other_error_requests_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.server_other_error_requests_threshold_critical critical = var.server_other_error_requests_threshold_critical
warning = var.server_other_error_requests_threshold_warning warning = var.server_other_error_requests_threshold_warning
} }
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
notify_no_data = false notify_no_data = false
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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.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" { resource "datadog_monitor" "client_other_error_requests" {
count = var.client_other_error_requests_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.client_other_error_requests_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.client_other_error_requests_time_aggregator}(${var.client_other_error_requests_timeframe}): (default( ${var.client_other_error_requests_time_aggregator}(${var.client_other_error_requests_timeframe}): (default(

View File

@ -35,29 +35,29 @@ resource "datadog_monitor" "su_utilization" {
) > ${var.su_utilization_threshold_critical} ) > ${var.su_utilization_threshold_critical}
EOQ EOQ
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = false require_full_window = false
thresholds = { thresholds = {
warning = var.su_utilization_threshold_warning warning = var.su_utilization_threshold_warning
critical = var.su_utilization_threshold_critical 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" { resource "datadog_monitor" "failed_function_requests" {
count = var.failed_function_requests_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.failed_function_requests_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.failed_function_requests_time_aggregator}(${var.failed_function_requests_timeframe}): ( ${var.failed_function_requests_time_aggregator}(${var.failed_function_requests_timeframe}): (
@ -66,29 +66,29 @@ query = <<EOQ
) * 100 > ${var.failed_function_requests_threshold_critical} ) * 100 > ${var.failed_function_requests_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.failed_function_requests_threshold_warning warning = var.failed_function_requests_threshold_warning
critical = var.failed_function_requests_threshold_critical critical = var.failed_function_requests_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 60 renotify_interval = 60
notify_audit = false notify_audit = false
timeout_h = 1 timeout_h = 1
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "conversion_errors" {
count = var.conversion_errors_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.conversion_errors_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.conversion_errors_time_aggregator}(${var.conversion_errors_timeframe}): ( ${var.conversion_errors_time_aggregator}(${var.conversion_errors_timeframe}): (

View File

@ -35,29 +35,29 @@ resource "datadog_monitor" "virtualmachine_cpu_usage" {
) > ${var.cpu_usage_threshold_critical} ) > ${var.cpu_usage_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.cpu_usage_threshold_critical critical = var.cpu_usage_threshold_critical
warning = var.cpu_usage_threshold_warning warning = var.cpu_usage_threshold_warning
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "virtualmachine_credit_cpu_remaining_too_low" {
count = var.cpu_remaining_rate_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.cpu_remaining_rate_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.cpu_remaining_rate_time_aggregator}(${var.cpu_remaining_rate_timeframe}): ${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} * 100 , 100) < ${var.cpu_remaining_rate_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.cpu_remaining_rate_threshold_warning warning = var.cpu_remaining_rate_threshold_warning
critical = var.cpu_remaining_rate_threshold_critical critical = var.cpu_remaining_rate_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 1 timeout_h = 1
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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) tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:virtualmachine", "team:claranet", "created-by:terraform"], var.cpu_remaining_rate_extra_tags)
} }

View File

@ -46,32 +46,32 @@ resource "datadog_monitor" "execution_time" {
> ${var.execution_time_threshold_critical} > ${var.execution_time_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.execution_time_threshold_warning warning = var.execution_time_threshold_warning
critical = var.execution_time_threshold_critical critical = var.execution_time_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
include_tags = true include_tags = true
notify_no_data = false notify_no_data = false
require_full_window = false require_full_window = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
locked = false 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 # Scanned Bytes
# #
resource "datadog_monitor" "scanned_bytes" { resource "datadog_monitor" "scanned_bytes" {
count = var.scanned_bytes_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.scanned_bytes_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
avg(${var.scanned_bytes_timeframe}): avg(${var.scanned_bytes_timeframe}):
@ -79,32 +79,32 @@ query = <<EOQ
> ${var.scanned_bytes_threshold_critical} > ${var.scanned_bytes_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.scanned_bytes_threshold_warning warning = var.scanned_bytes_threshold_warning
critical = var.scanned_bytes_threshold_critical critical = var.scanned_bytes_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
include_tags = true include_tags = true
notify_no_data = false notify_no_data = false
require_full_window = false require_full_window = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
locked = false 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 # Scanned Bytes Billed
# #
resource "datadog_monitor" "scanned_bytes_billed" { resource "datadog_monitor" "scanned_bytes_billed" {
count = var.scanned_bytes_billed_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.scanned_bytes_billed_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
avg(${var.scanned_bytes_billed_timeframe}): avg(${var.scanned_bytes_billed_timeframe}):
@ -178,32 +178,32 @@ resource "datadog_monitor" "stored_bytes" {
> ${var.stored_bytes_threshold_critical} > ${var.stored_bytes_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.stored_bytes_threshold_warning warning = var.stored_bytes_threshold_warning
critical = var.stored_bytes_threshold_critical critical = var.stored_bytes_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
include_tags = true include_tags = true
notify_no_data = false notify_no_data = false
require_full_window = false require_full_window = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
locked = false 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 # Table Count
# #
resource "datadog_monitor" "table_count" { resource "datadog_monitor" "table_count" {
count = var.table_count_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.table_count_message, var.message)
type = "metric alert" type = "metric alert"
query = <<EOQ query = <<EOQ
avg(${var.table_count_timeframe}): avg(${var.table_count_timeframe}):
@ -211,32 +211,32 @@ query = <<EOQ
> ${var.table_count_threshold_critical} > ${var.table_count_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.table_count_threshold_warning warning = var.table_count_threshold_warning
critical = var.table_count_threshold_critical critical = var.table_count_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
include_tags = true include_tags = true
notify_no_data = false notify_no_data = false
require_full_window = false require_full_window = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
locked = false 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 # Uploaded Bytes
# #
resource "datadog_monitor" "uploaded_bytes" { resource "datadog_monitor" "uploaded_bytes" {
count = var.uploaded_bytes_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.uploaded_bytes_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
avg(${var.uploaded_bytes_timeframe}): avg(${var.uploaded_bytes_timeframe}):

View File

@ -46,31 +46,31 @@ resource "datadog_monitor" "disk_utilization" {
> ${var.disk_utilization_threshold_critical} > ${var.disk_utilization_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.disk_utilization_threshold_warning warning = var.disk_utilization_threshold_warning
critical = var.disk_utilization_threshold_critical critical = var.disk_utilization_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
require_full_window = false require_full_window = false
notify_no_data = true notify_no_data = true
renotify_interval = 0 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 # Disk Utilization Forecast
# #
resource "datadog_monitor" "disk_utilization_forecast" { resource "datadog_monitor" "disk_utilization_forecast" {
count = var.disk_utilization_forecast_enabled == "true" ? 1 : 0 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" 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) message = coalesce(var.disk_utilization_forecast_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
@ -189,12 +189,12 @@ EOQ
renotify_interval = 0 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 # Failover Unavailable
# #
resource "datadog_monitor" "failover_unavailable" { resource "datadog_monitor" "failover_unavailable" {
count = var.failover_unavailable_enabled == "true" ? 1 : 0 count = var.failover_unavailable_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cloud SQL Failover Unavailable" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Cloud SQL Failover Unavailable"
message = coalesce(var.failover_unavailable_message, var.message) message = coalesce(var.failover_unavailable_message, var.message)
@ -222,5 +222,5 @@ EOQ
renotify_interval = 0 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

@ -52,32 +52,32 @@ resource "datadog_monitor" "disk_throttled_bps" {
> ${var.disk_throttled_bps_threshold_critical} > ${var.disk_throttled_bps_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.disk_throttled_bps_threshold_warning warning = var.disk_throttled_bps_threshold_warning
critical = var.disk_throttled_bps_threshold_critical critical = var.disk_throttled_bps_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
require_full_window = false require_full_window = false
notify_no_data = var.disk_throttled_bps_notify_no_data notify_no_data = var.disk_throttled_bps_notify_no_data
renotify_interval = 0 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 # Disk Throttled OPS
# #
resource "datadog_monitor" "disk_throttled_ops" { resource "datadog_monitor" "disk_throttled_ops" {
count = var.disk_throttled_ops_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.disk_throttled_ops_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.disk_throttled_ops_time_aggregator}(${var.disk_throttled_ops_timeframe}): ${var.disk_throttled_ops_time_aggregator}(${var.disk_throttled_ops_timeframe}):
@ -91,21 +91,21 @@ query = <<EOQ
> ${var.disk_throttled_ops_threshold_critical} > ${var.disk_throttled_ops_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.disk_throttled_ops_threshold_warning warning = var.disk_throttled_ops_threshold_warning
critical = var.disk_throttled_ops_threshold_critical critical = var.disk_throttled_ops_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = var.disk_throttled_ops_notify_no_data notify_no_data = var.disk_throttled_ops_notify_no_data
notify_audit = false notify_audit = false
locked = false locked = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
require_full_window = false require_full_window = false
renotify_interval = 0 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) 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

@ -48,32 +48,32 @@ resource "datadog_monitor" "error_rate_5xx" {
* 100 > ${var.error_rate_5xx_threshold_critical} * 100 > ${var.error_rate_5xx_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.error_rate_5xx_threshold_warning warning = var.error_rate_5xx_threshold_warning
critical = var.error_rate_5xx_threshold_critical critical = var.error_rate_5xx_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
require_full_window = false require_full_window = false
notify_no_data = false notify_no_data = false
renotify_interval = 0 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 # Backend Latency for service
# #
resource "datadog_monitor" "backend_latency_service" { resource "datadog_monitor" "backend_latency_service" {
count = var.backend_latency_service_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.backend_latency_service_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.backend_latency_service_time_aggregator}(${var.backend_latency_service_timeframe}): ${var.backend_latency_service_time_aggregator}(${var.backend_latency_service_timeframe}):
@ -81,32 +81,32 @@ query = <<EOQ
> ${var.backend_latency_service_threshold_critical} > ${var.backend_latency_service_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.backend_latency_service_threshold_warning warning = var.backend_latency_service_threshold_warning
critical = var.backend_latency_service_threshold_critical critical = var.backend_latency_service_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
require_full_window = false require_full_window = false
notify_no_data = false notify_no_data = false
renotify_interval = 0 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 # Backend Latency for bucket
# #
resource "datadog_monitor" "backend_latency_bucket" { resource "datadog_monitor" "backend_latency_bucket" {
count = var.backend_latency_bucket_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.backend_latency_bucket_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.backend_latency_bucket_time_aggregator}(${var.backend_latency_bucket_timeframe}): ${var.backend_latency_bucket_time_aggregator}(${var.backend_latency_bucket_timeframe}):

View File

@ -45,21 +45,21 @@ resource "datadog_monitor" "unavailable_sending_operations_count" {
>= ${var.unavailable_sending_operations_count_threshold_critical} >= ${var.unavailable_sending_operations_count_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.unavailable_sending_operations_count_threshold_warning warning = var.unavailable_sending_operations_count_threshold_warning
critical = var.unavailable_sending_operations_count_threshold_critical critical = var.unavailable_sending_operations_count_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
require_full_window = false require_full_window = false
notify_no_data = false notify_no_data = false
renotify_interval = 0 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) 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

@ -44,31 +44,31 @@ resource "datadog_monitor" "cluster_status_not_green" {
<= ${var.cluster_status_not_green_threshold_critical} <= ${var.cluster_status_not_green_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
# ok = 2 # ok = 2
warning = var.cluster_status_not_green_threshold_warning # Yellow warning = var.cluster_status_not_green_threshold_warning # Yellow
critical = var.cluster_status_not_green_threshold_critical # Red critical = var.cluster_status_not_green_threshold_critical # Red
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
include_tags = true include_tags = true
require_full_window = 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_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 # Cluster Initializing Shards
# #
resource "datadog_monitor" "cluster_initializing_shards" { resource "datadog_monitor" "cluster_initializing_shards" {
count = var.cluster_initializing_shards_enabled == "true" ? 1 : 0 count = var.cluster_initializing_shards_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch Cluster is initializing shards" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch Cluster is initializing shards"
message = coalesce(var.cluster_initializing_shards_message, var.message) message = coalesce(var.cluster_initializing_shards_message, var.message)
type = "metric alert" type = "metric alert"
query = <<EOQ query = <<EOQ
${var.cluster_initializing_shards_time_aggregator}(${var.cluster_initializing_shards_timeframe}): ${var.cluster_initializing_shards_time_aggregator}(${var.cluster_initializing_shards_timeframe}):
@ -76,30 +76,30 @@ query = <<EOQ
> ${var.cluster_initializing_shards_threshold_critical} > ${var.cluster_initializing_shards_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.cluster_initializing_shards_threshold_warning warning = var.cluster_initializing_shards_threshold_warning
critical = var.cluster_initializing_shards_threshold_critical critical = var.cluster_initializing_shards_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
include_tags = true include_tags = true
require_full_window = 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_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 # Cluster Relocating Shards
# #
resource "datadog_monitor" "cluster_relocating_shards" { resource "datadog_monitor" "cluster_relocating_shards" {
count = var.cluster_relocating_shards_enabled == "true" ? 1 : 0 count = var.cluster_relocating_shards_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch Cluster is relocating shards" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ElasticSearch Cluster is relocating shards"
message = coalesce(var.cluster_relocating_shards_message, var.message) message = coalesce(var.cluster_relocating_shards_message, var.message)
type = "metric alert" type = "metric alert"
query = <<EOQ query = <<EOQ
${var.cluster_relocating_shards_time_aggregator}(${var.cluster_relocating_shards_timeframe}): ${var.cluster_relocating_shards_time_aggregator}(${var.cluster_relocating_shards_timeframe}):
@ -173,18 +173,18 @@ resource "datadog_monitor" "node_free_space" {
< ${var.node_free_space_threshold_critical} < ${var.node_free_space_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.node_free_space_threshold_warning warning = var.node_free_space_threshold_warning
critical = var.node_free_space_threshold_critical critical = var.node_free_space_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
include_tags = true include_tags = true
require_full_window = 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.node_free_space_extra_tags) 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 # JVM Heap Memory Usage
# #
resource "datadog_monitor" "jvm_heap_memory_usage" { resource "datadog_monitor" "jvm_heap_memory_usage" {
count = var.jvm_heap_memory_usage_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.jvm_heap_memory_usage_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.jvm_heap_memory_usage_time_aggregator}(${var.jvm_heap_memory_usage_timeframe}): ${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} > ${var.jvm_heap_memory_usage_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.jvm_heap_memory_usage_threshold_warning warning = var.jvm_heap_memory_usage_threshold_warning
critical = var.jvm_heap_memory_usage_threshold_critical critical = var.jvm_heap_memory_usage_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
include_tags = true include_tags = true
require_full_window = 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_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 # JVM Memory Young Usage
# #
resource "datadog_monitor" "jvm_memory_young_usage" { resource "datadog_monitor" "jvm_memory_young_usage" {
count = var.jvm_memory_young_usage_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.jvm_memory_young_usage_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.jvm_memory_young_usage_time_aggregator}(${var.jvm_memory_young_usage_timeframe}): ${var.jvm_memory_young_usage_time_aggregator}(${var.jvm_memory_young_usage_timeframe}):
@ -297,18 +297,18 @@ resource "datadog_monitor" "jvm_gc_old_collection_latency" {
> ${var.jvm_gc_old_collection_latency_threshold_critical} > ${var.jvm_gc_old_collection_latency_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.jvm_gc_old_collection_latency_threshold_warning warning = var.jvm_gc_old_collection_latency_threshold_warning
critical = var.jvm_gc_old_collection_latency_threshold_critical critical = var.jvm_gc_old_collection_latency_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
include_tags = true include_tags = true
require_full_window = 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_gc_old_collection_latency_extra_tags) 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 # JVM Garbace Collector Young Collection Latency
# #
resource "datadog_monitor" "jvm_gc_young_collection_latency" { resource "datadog_monitor" "jvm_gc_young_collection_latency" {
count = var.jvm_gc_young_collection_latency_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.jvm_gc_young_collection_latency_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.jvm_gc_young_collection_latency_time_aggregator}(${var.jvm_gc_young_collection_latency_timeframe}): ${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} > ${var.jvm_gc_young_collection_latency_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.jvm_gc_young_collection_latency_threshold_warning warning = var.jvm_gc_young_collection_latency_threshold_warning
critical = var.jvm_gc_young_collection_latency_threshold_critical critical = var.jvm_gc_young_collection_latency_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
include_tags = true include_tags = true
require_full_window = 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_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 # Indexing Latency
# #
resource "datadog_monitor" "indexing_latency" { resource "datadog_monitor" "indexing_latency" {
count = var.indexing_latency_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.indexing_latency_message, var.message)
type = "query alert" 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 query = <<EOQ
${var.indexing_latency_time_aggregator}(${var.indexing_latency_timeframe}): ${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 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
@ -431,69 +431,69 @@ resource "datadog_monitor" "http_connections_anomaly" {
>= ${var.http_connections_anomaly_threshold_critical} >= ${var.http_connections_anomaly_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.http_connections_anomaly_threshold_warning warning = var.http_connections_anomaly_threshold_warning
critical = var.http_connections_anomaly_threshold_critical critical = var.http_connections_anomaly_threshold_critical
} }
threshold_windows = { threshold_windows = {
trigger_window = var.http_connections_anomaly_alert_window trigger_window = var.http_connections_anomaly_alert_window
recovery_window = var.http_connections_anomaly_alert_window recovery_window = var.http_connections_anomaly_alert_window
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
include_tags = true include_tags = true
require_full_window = 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.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 # Query Latency
# #
resource "datadog_monitor" "search_query_latency" { resource "datadog_monitor" "search_query_latency" {
count = var.search_query_latency_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.search_query_latency_message, var.message)
type = "query alert" 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 query = <<EOQ
${var.search_query_latency_time_aggregator}(${var.search_query_latency_timeframe}): ${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 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} > ${var.search_query_latency_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.search_query_latency_threshold_warning warning = var.search_query_latency_threshold_warning
critical = var.search_query_latency_threshold_critical critical = var.search_query_latency_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
include_tags = true include_tags = true
require_full_window = 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_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 # Fetch Latency
# #
resource "datadog_monitor" "fetch_latency" { resource "datadog_monitor" "fetch_latency" {
count = var.fetch_latency_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.fetch_latency_message, var.message)
type = "query alert" 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 query = <<EOQ
${var.fetch_latency_time_aggregator}(${var.fetch_latency_timeframe}): ${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 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
@ -562,64 +562,64 @@ resource "datadog_monitor" "fetch_change" {
>= ${var.fetch_change_threshold_critical} >= ${var.fetch_change_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.fetch_change_threshold_warning warning = var.fetch_change_threshold_warning
critical = var.fetch_change_threshold_critical critical = var.fetch_change_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
include_tags = true include_tags = true
require_full_window = 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.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 # Field Data Evictions
# #
resource "datadog_monitor" "field_data_evictions_change" { resource "datadog_monitor" "field_data_evictions_change" {
count = var.field_data_evictions_change_enabled == "true" ? 1 : 0 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" 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) message = coalesce(var.field_data_evictions_change_message, var.message)
type = "query alert" 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 query = <<EOQ
change(${var.field_data_evictions_change_time_aggregator}(${var.field_data_evictions_change_timeframe}),${var.field_data_evictions_change_timeshift}): 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} avg:elasticsearch.fielddata.evictions${module.filter-tags.query_alert} by {node_name}
> ${var.field_data_evictions_change_threshold_critical} > ${var.field_data_evictions_change_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.field_data_evictions_change_threshold_warning warning = var.field_data_evictions_change_threshold_warning
critical = var.field_data_evictions_change_threshold_critical critical = var.field_data_evictions_change_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
include_tags = true include_tags = true
require_full_window = 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.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 # Query Cache Evictions
# #
resource "datadog_monitor" "query_cache_evictions_change" { resource "datadog_monitor" "query_cache_evictions_change" {
count = var.query_cache_evictions_change_enabled == "true" ? 1 : 0 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" 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) message = coalesce(var.query_cache_evictions_change_message, var.message)
type = "query alert" 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 query = <<EOQ
change(${var.query_cache_evictions_change_time_aggregator}(${var.query_cache_evictions_change_timeframe}),${var.query_cache_evictions_change_timeshift}): 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} avg:elasticsearch.indices.query_cache.evictions${module.filter-tags.query_alert} by {node_name}
@ -689,19 +689,19 @@ resource "datadog_monitor" "task_time_in_queue_change" {
> ${var.task_time_in_queue_change_threshold_critical} > ${var.task_time_in_queue_change_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.task_time_in_queue_change_threshold_warning warning = var.task_time_in_queue_change_threshold_warning
critical = var.task_time_in_queue_change_threshold_critical critical = var.task_time_in_queue_change_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_audit = false notify_audit = false
locked = false locked = false
include_tags = true include_tags = true
require_full_window = 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.task_time_in_queue_change_extra_tags) 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

@ -33,28 +33,28 @@ resource "datadog_monitor" "mongodb_secondary" {
> 1 > 1
EOQ EOQ
thresholds = { thresholds = {
critical = 1 critical = 1
warning = 0 warning = 0
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
require_full_window = 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" { resource "datadog_monitor" "mongodb_server_count" {
count = var.mongodb_server_count_enabled == "true" ? 1 : 0 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" 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) message = coalesce(var.mongodb_server_count_message, var.message)
type = "metric alert" type = "metric alert"
query = <<EOQ query = <<EOQ
${var.mongodb_server_count_aggregator}(${var.mongodb_server_count_timeframe}): ${var.mongodb_server_count_aggregator}(${var.mongodb_server_count_timeframe}):
@ -62,28 +62,28 @@ query = <<EOQ
> 99 > 99
EOQ EOQ
thresholds = { thresholds = {
critical = 99 critical = 99
warning = var.mongodb_desired_servers_count warning = var.mongodb_desired_servers_count
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
require_full_window = 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" { resource "datadog_monitor" "mongodb_replication" {
count = var.mongodb_replication_enabled == "true" ? 1 : 0 count = var.mongodb_replication_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] MongoDB replication lag" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] MongoDB replication lag"
message = coalesce(var.mongodb_replication_message, var.message) message = coalesce(var.mongodb_replication_message, var.message)
type = "metric alert" type = "metric alert"
query = <<EOQ query = <<EOQ
${var.mongodb_replication_aggregator}(${var.mongodb_replication_timeframe}): ${var.mongodb_replication_aggregator}(${var.mongodb_replication_timeframe}):

View File

@ -39,27 +39,27 @@ resource "datadog_monitor" "mysql_connection" {
) * 100 > ${var.mysql_connection_threshold_critical} ) * 100 > ${var.mysql_connection_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.mysql_connection_threshold_warning warning = var.mysql_connection_threshold_warning
critical = var.mysql_connection_threshold_critical critical = var.mysql_connection_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = true require_full_window = true
timeout_h = 0 timeout_h = 0
include_tags = true 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" { resource "datadog_monitor" "mysql_aborted" {
count = var.mysql_aborted_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.mysql_aborted_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.mysql_aborted_time_aggregator}(${var.mysql_aborted_timeframe}): ( ${var.mysql_aborted_time_aggregator}(${var.mysql_aborted_timeframe}): (
@ -68,27 +68,27 @@ query = <<EOQ
) * 100 > ${var.mysql_aborted_threshold_critical} ) * 100 > ${var.mysql_aborted_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.mysql_aborted_threshold_warning warning = var.mysql_aborted_threshold_warning
critical = var.mysql_aborted_threshold_critical critical = var.mysql_aborted_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = true require_full_window = true
timeout_h = 0 timeout_h = 0
include_tags = true 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" { resource "datadog_monitor" "mysql_slow" {
count = var.mysql_slow_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.mysql_slow_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.mysql_slow_time_aggregator}(${var.mysql_slow_timeframe}): ( ${var.mysql_slow_time_aggregator}(${var.mysql_slow_timeframe}): (
@ -156,27 +156,27 @@ resource "datadog_monitor" "mysql_pool_utilization" {
* 100 > ${var.mysql_pool_utilization_threshold_critical} * 100 > ${var.mysql_pool_utilization_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.mysql_pool_utilization_threshold_warning warning = var.mysql_pool_utilization_threshold_warning
critical = var.mysql_pool_utilization_threshold_critical critical = var.mysql_pool_utilization_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = true require_full_window = true
timeout_h = 0 timeout_h = 0
include_tags = true 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" { resource "datadog_monitor" "mysql_threads_anomaly" {
count = var.mysql_threads_enabled == "true" ? 1 : 0 count = var.mysql_threads_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql threads changed abnormally" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql threads changed abnormally"
message = coalesce(var.mysql_threads_message, var.message) message = coalesce(var.mysql_threads_message, var.message)
type = "metric alert" type = "metric alert"
query = <<EOQ query = <<EOQ
${var.mysql_threads_time_aggregator}(${var.mysql_threads_timeframe}): ${var.mysql_threads_time_aggregator}(${var.mysql_threads_timeframe}):
@ -193,32 +193,32 @@ query = <<EOQ
>= ${var.mysql_threads_threshold_critical} >= ${var.mysql_threads_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.mysql_threads_threshold_critical critical = var.mysql_threads_threshold_critical
critical_recovery = 0 critical_recovery = 0
} }
threshold_windows = { threshold_windows = {
trigger_window = var.mysql_threads_alert_window trigger_window = var.mysql_threads_alert_window
recovery_window = var.mysql_threads_alert_window recovery_window = var.mysql_threads_alert_window
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = true require_full_window = true
timeout_h = 0 timeout_h = 0
include_tags = true 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" { resource "datadog_monitor" "mysql_questions_anomaly" {
count = var.mysql_questions_enabled == "true" ? 1 : 0 count = var.mysql_questions_enabled == "true" ? 1 : 0
name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql queries changed abnormally" name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Mysql queries changed abnormally"
message = coalesce(var.mysql_questions_message, var.message) message = coalesce(var.mysql_questions_message, var.message)
type = "metric alert" type = "metric alert"
query = <<EOQ query = <<EOQ
${var.mysql_questions_time_aggregator}(${var.mysql_questions_timeframe}): ${var.mysql_questions_time_aggregator}(${var.mysql_questions_timeframe}):

View File

@ -38,27 +38,27 @@ resource "datadog_monitor" "postgresql_connection_too_high" {
* 100 > ${var.postgresql_connection_threshold_critical} * 100 > ${var.postgresql_connection_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.postgresql_connection_threshold_warning warning = var.postgresql_connection_threshold_warning
critical = var.postgresql_connection_threshold_critical critical = var.postgresql_connection_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = true require_full_window = true
timeout_h = 0 timeout_h = 0
include_tags = true 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" { resource "datadog_monitor" "postgresql_too_many_locks" {
count = var.postgresql_lock_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.postgresql_lock_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.postgresql_lock_time_aggregator}(${var.postgresql_lock_timeframe}): ${var.postgresql_lock_time_aggregator}(${var.postgresql_lock_timeframe}):
@ -66,19 +66,19 @@ query = <<EOQ
> ${var.postgresql_lock_threshold_critical} > ${var.postgresql_lock_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.postgresql_lock_threshold_warning warning = var.postgresql_lock_threshold_warning
critical = var.postgresql_lock_threshold_critical critical = var.postgresql_lock_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
require_full_window = true require_full_window = true
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
tags = concat(["env:${var.environment}", "type:database", "provider:postgres", "resource:postgresql", "team:claranet", "created-by:terraform"], var.postgresql_lock_extra_tags) tags = concat(["env:${var.environment}", "type:database", "provider:postgres", "resource:postgresql", "team:claranet", "created-by:terraform"], var.postgresql_lock_extra_tags)
} }

View File

@ -41,29 +41,29 @@ resource "datadog_monitor" "evicted_keys" {
) > ${var.evictedkeys_change_threshold_critical} ) > ${var.evictedkeys_change_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.evictedkeys_change_threshold_warning warning = var.evictedkeys_change_threshold_warning
critical = var.evictedkeys_change_threshold_critical critical = var.evictedkeys_change_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = true 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" { resource "datadog_monitor" "expirations" {
count = var.expirations_rate_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.expirations_rate_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.expirations_rate_time_aggregator}(${var.expirations_rate_timeframe}): ( ${var.expirations_rate_time_aggregator}(${var.expirations_rate_timeframe}): (
@ -71,29 +71,29 @@ query = <<EOQ
) > ${var.expirations_rate_threshold_critical} ) > ${var.expirations_rate_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.expirations_rate_threshold_warning warning = var.expirations_rate_threshold_warning
critical = var.expirations_rate_threshold_critical critical = var.expirations_rate_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "blocked_clients" {
count = var.blocked_clients_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.blocked_clients_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.blocked_clients_time_aggregator}(${var.blocked_clients_timeframe}): ( ${var.blocked_clients_time_aggregator}(${var.blocked_clients_timeframe}): (
@ -163,29 +163,29 @@ resource "datadog_monitor" "memory_used" {
) * 100 > ${var.mem_used_threshold_critical} ) * 100 > ${var.mem_used_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.mem_used_threshold_warning warning = var.mem_used_threshold_warning
critical = var.mem_used_threshold_critical critical = var.mem_used_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "memory_frag" {
count = var.mem_frag_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.mem_frag_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.mem_frag_time_aggregator}(${var.mem_frag_timeframe}): ${var.mem_frag_time_aggregator}(${var.mem_frag_timeframe}):
@ -193,29 +193,29 @@ query = <<EOQ
* 100 > ${var.mem_frag_threshold_critical} * 100 > ${var.mem_frag_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.mem_frag_threshold_warning warning = var.mem_frag_threshold_warning
critical = var.mem_frag_threshold_critical critical = var.mem_frag_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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" { resource "datadog_monitor" "rejected_connections" {
count = var.rejected_con_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.rejected_con_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
change(${var.rejected_con_time_aggregator}(${var.rejected_con_timeframe}),${var.rejected_con_timeframe}): ( change(${var.rejected_con_time_aggregator}(${var.rejected_con_timeframe}),${var.rejected_con_timeframe}): (
@ -285,21 +285,21 @@ resource "datadog_monitor" "hitrate" {
) * 100 < ${var.hitrate_threshold_critical} ) * 100 < ${var.hitrate_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.hitrate_threshold_warning warning = var.hitrate_threshold_warning
critical = var.hitrate_threshold_critical critical = var.hitrate_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = 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) tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.hitrate_extra_tags)
} }

View File

@ -38,19 +38,19 @@ resource "datadog_monitor" "datadog_nginx_dropped_connections" {
> ${var.nginx_dropped_threshold_critical} > ${var.nginx_dropped_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
critical = var.nginx_dropped_threshold_critical critical = var.nginx_dropped_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = true 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) tags = concat(["env:${var.environment}", "type:middleware", "provider:nginx", "resource:nginx", "team:claranet", "created-by:terraform"], var.nginx_dropped_extra_tags)
} }

View File

@ -40,20 +40,20 @@ resource "datadog_monitor" "php_fpm_connect_idle" {
) * 100 > ${var.php_fpm_busy_threshold_critical} ) * 100 > ${var.php_fpm_busy_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.php_fpm_busy_threshold_warning warning = var.php_fpm_busy_threshold_warning
critical = var.php_fpm_busy_threshold_critical critical = var.php_fpm_busy_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = true 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) 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

@ -39,28 +39,28 @@ resource "datadog_monitor" "load" {
) > ${var.load_threshold_critical} ) > ${var.load_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.load_threshold_warning warning = var.load_threshold_warning
critical = var.load_threshold_critical critical = var.load_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = true 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" { resource "datadog_monitor" "disk_space" {
count = var.disk_space_enabled == "true" ? 1 : 0 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}}" 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) message = coalesce(var.disk_space_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.disk_space_time_aggregator}(${var.disk_space_timeframe}): ${var.disk_space_time_aggregator}(${var.disk_space_timeframe}):
@ -68,28 +68,28 @@ query = <<EOQ
* 100 > ${var.disk_space_threshold_critical} * 100 > ${var.disk_space_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.disk_space_threshold_warning warning = var.disk_space_threshold_warning
critical = var.disk_space_threshold_critical critical = var.disk_space_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = true 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" { resource "datadog_monitor" "disk_space_forecast" {
count = var.disk_space_forecast_enabled == "true" ? 1 : 0 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" 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) message = coalesce(var.disk_space_forecast_message, var.message)
type = "query alert" type = "query alert"
query = <<EOQ query = <<EOQ
${var.disk_space_forecast_time_aggregator}(${var.disk_space_forecast_timeframe}): ${var.disk_space_forecast_time_aggregator}(${var.disk_space_forecast_timeframe}):
@ -170,21 +170,21 @@ resource "datadog_monitor" "memory" {
< ${var.memory_threshold_critical} < ${var.memory_threshold_critical}
EOQ EOQ
thresholds = { thresholds = {
warning = var.memory_threshold_warning warning = var.memory_threshold_warning
critical = var.memory_threshold_critical critical = var.memory_threshold_critical
} }
evaluation_delay = var.evaluation_delay evaluation_delay = var.evaluation_delay
new_host_delay = var.new_host_delay new_host_delay = var.new_host_delay
notify_no_data = false notify_no_data = false
renotify_interval = 0 renotify_interval = 0
notify_audit = false notify_audit = false
timeout_h = 0 timeout_h = 0
include_tags = true include_tags = true
locked = false locked = false
require_full_window = true 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) tags = concat(["env:${var.environment}", "type:system", "provider:system-check", "resource:generic", "team:claranet", "created-by:terraform"], var.memory_extra_tags)
} }