-
Notifications
You must be signed in to change notification settings - Fork 6
/
memory-requests-low-perc-state.tf
35 lines (31 loc) · 1.67 KB
/
memory-requests-low-perc-state.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 {
memory_requests_low_perc_state_filter = coalesce(
var.memory_requests_low_perc_state_filter_override,
var.filter_str
)
}
module "memory_requests_low_perc_state" {
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"
name = "Available Memory for Requests in percentage Low"
query = "max(${var.memory_requests_low_perc_state_evaluation_period}):( max:kubernetes_state.container.memory_requested{${local.memory_requests_low_perc_state_filter}} / max:kubernetes_state.node.memory_allocatable{${local.memory_requests_low_perc_state_filter}} ) * 100 > ${var.memory_requests_low_perc_state_critical}"
alert_message = "Kubernetes cluster memory room for Requests in percentage is too low"
recovery_message = "Kubernetes cluster memory Requests in percentage has recovered"
# monitor level vars
enabled = var.memory_requests_low_perc_state_enabled
alerting_enabled = var.memory_requests_low_perc_state_alerting_enabled
critical_threshold = var.memory_requests_low_perc_state_critical
warning_threshold = var.memory_requests_low_perc_state_warning
priority = min(var.memory_requests_low_perc_state_priority + var.priority_offset, 5)
docs = var.memory_requests_low_perc_state_docs
note = var.memory_requests_low_perc_state_note
# module level vars
env = var.env
service = var.service
service_display_name = var.service_display_name
notification_channel = var.notification_channel
additional_tags = var.additional_tags
locked = var.locked
name_prefix = var.name_prefix
name_suffix = var.name_suffix
}