-
Notifications
You must be signed in to change notification settings - Fork 3
/
disk-in-use-percentage.tf
38 lines (33 loc) · 1.65 KB
/
disk-in-use-percentage.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
36
37
38
locals {
disk_in_use_percentage_filter = coalesce(
var.disk_in_use_percentage_filter_override,
var.filter_str
)
}
module "disk_in_use_percentage" {
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"
name = "Disk In Use Percentage"
query = "avg(${var.disk_in_use_percentage_evaluation_period}):min:system.disk.in_use{${local.disk_in_use_percentage_filter}} by {${var.alert_by}} * 100 > ${var.disk_in_use_percentage_critical}"
# alert specific configuration
require_full_window = true
alert_message = "Disk usage on CloudAMQP Node {{${var.alert_by}.name}} has dropped below {{threshold}} ({{value}}%) available"
recovery_message = "Disk usage on CloudAMQP Node {{${var.alert_by}.name}} has recovered ({{value}}%) available"
# monitor level vars
enabled = var.disk_in_use_percentage_enabled
alerting_enabled = var.disk_in_use_percentage_alerting_enabled
warning_threshold = var.disk_in_use_percentage_warning
critical_threshold = var.disk_in_use_percentage_critical
priority = min(var.disk_in_use_percentage_priority + var.priority_offset, 5)
docs = var.disk_in_use_percentage_docs
note = var.disk_in_use_percentage_note
notification_channel = try(coalesce(var.disk_in_use_percentage_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
locked = var.locked
name_prefix = var.name_prefix
name_suffix = var.name_suffix
}