-
Notifications
You must be signed in to change notification settings - Fork 6
/
memory-limits-low.tf
35 lines (31 loc) · 1.45 KB
/
memory-limits-low.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_limits_low_filter = coalesce(
var.memory_limits_low_filter_override,
var.filter_str
)
}
module "memory_limits_low" {
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"
name = "Available Memory for Limits Low"
query = "avg(${var.memory_limits_low_evaluation_period}):max:system.mem.total{${local.memory_limits_low_filter}} by {host,kube_cluster_name} - max:kubernetes.memory.limits{${local.memory_limits_low_filter}} by {host,kube_cluster_name} < ${var.memory_limits_low_critical}"
alert_message = "Kubernetes cluster memory room for limits is too low"
recovery_message = "Kubernetes cluster memory limits has recovered"
# monitor level vars
enabled = var.memory_limits_low_enabled
alerting_enabled = var.memory_limits_low_alerting_enabled
critical_threshold = var.memory_limits_low_critical
warning_threshold = var.memory_limits_low_warning
priority = min(var.memory_limits_low_priority + var.priority_offset, 5)
docs = var.memory_limits_low_docs
note = var.memory_limits_low_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
}