MON-316 Update file name and correct typo
This commit is contained in:
parent
ffb690d07f
commit
86aba7c838
83
cloud/azure/serverfarms/monitors-azure-serverfarms.tf
Normal file
83
cloud/azure/serverfarms/monitors-azure-serverfarms.tf
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
resource "datadog_monitor" "status" {
|
||||||
|
count = "${var.status_enabled ? 1 : 0}"
|
||||||
|
name = "[${var.environment}] Serverfarm {{name}} is down"
|
||||||
|
message = "${coalesce(var.status_message, var.message)}"
|
||||||
|
|
||||||
|
query = <<EOF
|
||||||
|
${var.status_time_aggregator}(${var.status_timeframe}): (
|
||||||
|
avg:azure.web_serverfarms.status${module.filter-tags.query_alert} by {resource_group,region,name}
|
||||||
|
) != 1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
type = "metric alert"
|
||||||
|
|
||||||
|
silenced = "${var.status_silenced}"
|
||||||
|
|
||||||
|
notify_no_data = true
|
||||||
|
evaluation_delay = "${var.evaluation_delay}"
|
||||||
|
renotify_interval = 0
|
||||||
|
notify_audit = false
|
||||||
|
timeout_h = 0
|
||||||
|
include_tags = true
|
||||||
|
locked = false
|
||||||
|
require_full_window = false
|
||||||
|
new_host_delay = "${var.new_host_delay}"
|
||||||
|
|
||||||
|
tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:serverfarms", "team:claranet", "created-by:terraform", "${var.status_extra_tags}"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "datadog_monitor" "cpu_percentage" {
|
||||||
|
count = "${var.cpu_percentage_enabled ? 1 : 0}"
|
||||||
|
name = "[${var.environment}] Serverfarm {{name}} CPU percentage is too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
|
||||||
|
message = "${coalesce(var.cpu_percentage_message, var.message)}"
|
||||||
|
|
||||||
|
query = <<EOF
|
||||||
|
${var.cpu_percentage_time_aggregator}(${var.cpu_percentage_timeframe}): (
|
||||||
|
avg:azure.web_serverfarms.cpu_percentage${module.filter-tags.query_alert} by {resource_group,region,name}
|
||||||
|
) != 1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
type = "metric alert"
|
||||||
|
|
||||||
|
silenced = "${var.cpu_percentage_silenced}"
|
||||||
|
|
||||||
|
notify_no_data = true
|
||||||
|
evaluation_delay = "${var.evaluation_delay}"
|
||||||
|
renotify_interval = 0
|
||||||
|
notify_audit = false
|
||||||
|
timeout_h = 0
|
||||||
|
include_tags = true
|
||||||
|
locked = false
|
||||||
|
require_full_window = false
|
||||||
|
new_host_delay = "${var.new_host_delay}"
|
||||||
|
|
||||||
|
tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:serverfarms", "team:claranet", "created-by:terraform", "${var.cpu_percentage_extra_tags}"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "datadog_monitor" "memory_percentage" {
|
||||||
|
count = "${var.memory_percentage_enabled ? 1 : 0}"
|
||||||
|
name = "[${var.environment}] Serverfarm {{name}} CPU 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)}"
|
||||||
|
|
||||||
|
query = <<EOF
|
||||||
|
${var.memory_percentage_time_aggregator}(${var.memory_percentage_timeframe}): (
|
||||||
|
avg:azure.web_serverfarms.memory_percentage${module.filter-tags.query_alert} by {resource_group,region,name}
|
||||||
|
) != 1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
type = "metric alert"
|
||||||
|
|
||||||
|
silenced = "${var.memory_percentage_silenced}"
|
||||||
|
|
||||||
|
notify_no_data = true
|
||||||
|
evaluation_delay = "${var.evaluation_delay}"
|
||||||
|
renotify_interval = 0
|
||||||
|
notify_audit = false
|
||||||
|
timeout_h = 0
|
||||||
|
include_tags = true
|
||||||
|
locked = false
|
||||||
|
require_full_window = false
|
||||||
|
new_host_delay = "${var.new_host_delay}"
|
||||||
|
|
||||||
|
tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:serverfarms", "team:claranet", "created-by:terraform", "${var.memory_percentage_extra_tags}"]
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
output "status_id" {
|
||||||
|
description = "id for monitor status"
|
||||||
|
value = "${datadog_monitor.status.*.id}"
|
||||||
|
}
|
||||||
|
|
||||||
|
output "cpu_percentage_id" {
|
||||||
|
description = "id for monitor cpu_percentage"
|
||||||
|
value = "${datadog_monitor.cpu_percentage.*.id}"
|
||||||
|
}
|
||||||
|
|
||||||
|
output "memory_percentage_id" {
|
||||||
|
description = "id for monitor memory_percentage"
|
||||||
|
value = "${datadog_monitor.memory_percentage.*.id}"
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user