forked from kabisa/terraform-datadog-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpu-stolen.tf
35 lines (31 loc) · 1.44 KB
/
cpu-stolen.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
locals {
cpu_stolen_filter = coalesce(
var.cpu_stolen_filter_override,
var.filter_str
)
}
module "cpu_stolen" {
source = "weglot/generic-monitor/datadog"
version = "1.1.0"
name = "System - High cpu.stolen usage"
query = "avg(${var.cpu_stolen_evaluation_period}):avg:system.cpu.stolen{${local.cpu_stolen_filter}} by {${var.alert_by}} > ${var.cpu_stolen_critical}"
alert_message = "| ${var.service} | {{${var.alert_by}.name}} | cpu.stolen: {{value}} | High cpu.stolen usage"
recovery_message = "| ${var.service} | {{${var.alert_by}.name}} | cpu.stolen: {{value}} | cpu.stolen usage back to normal"
# monitor level vars
enabled = var.cpu_stolen_enabled
alerting_enabled = var.cpu_stolen_alerting_enabled
warning_threshold = var.cpu_stolen_warning
critical_threshold = var.cpu_stolen_critical
priority = min(var.cpu_stolen_priority + var.priority_offset, 5)
docs = var.cpu_stolen_docs
note = var.cpu_stolen_note
notification_channel = try(coalesce(var.cpu_stolen_notification_channel_override, var.notification_channel), "")
# module level vars
env = var.env
service = var.service
service_display_name = var.service_display_name
additional_tags = var.additional_tags
name_prefix = var.name_prefix
name_suffix = var.name_suffix
restricted_roles = var.restricted_roles
}