-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathhpa-status.tf
35 lines (30 loc) · 1.26 KB
/
hpa-status.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 {
hpa_status_filter = (
var.hpa_status_filter_override != "" ? var.hpa_status_filter_override : var.filter_str
)
}
module "hpa_status" {
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"
name = "HPA Status not OK"
query = "avg(${var.hpa_status_evaluation_period}):avg:kubernetes_state.hpa.condition{${local.hpa_status_filter}} by {hpa,kube_namespace,status,condition} < 1"
alert_message = "Kubernetes HPA Status for Node {{node}} is not ok"
recovery_message = "Kubernetes HPA Status for Node {{node}} has recovered"
# monitor level vars
enabled = var.state_metrics_monitoring && var.hpa_status_enabled
alerting_enabled = var.hpa_status_alerting_enabled
critical_threshold = 1
# No warning_threshold possible
priority = min(var.hpa_status_priority + var.priority_offset, 5)
docs = var.hpa_status_docs
note = var.hpa_status_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
}