feat: alert on OCI VM health and CPU
This commit is contained in:
parent
be83c16f7e
commit
37267e2e30
|
|
@ -1843,6 +1843,67 @@ resource "helm_release" "prometheus_stack" {
|
|||
|
||||
values = [
|
||||
yamlencode({
|
||||
additionalPrometheusRulesMap = {
|
||||
homelab-oci-vm = {
|
||||
groups = [{
|
||||
name = "homelab-oci-vm"
|
||||
rules = [
|
||||
{
|
||||
alert = "HomelabOciEdgeNodeExporterDown"
|
||||
expr = "up{job=\"oci-edge-node\"} == 0"
|
||||
"for" = "5m"
|
||||
labels = {
|
||||
severity = "critical"
|
||||
host_group = "public-edge"
|
||||
}
|
||||
annotations = {
|
||||
summary = "OCI edge VM node exporter is down"
|
||||
description = "Prometheus cannot scrape the OCI edge VM node exporter for 5 minutes."
|
||||
}
|
||||
},
|
||||
{
|
||||
alert = "HomelabOciEmailNodeExporterDown"
|
||||
expr = "up{job=\"oci-email-node\"} == 0"
|
||||
"for" = "5m"
|
||||
labels = {
|
||||
severity = "critical"
|
||||
host_group = "email"
|
||||
}
|
||||
annotations = {
|
||||
summary = "OCI email VM node exporter is down"
|
||||
description = "Prometheus cannot scrape the OCI email VM node exporter for 5 minutes."
|
||||
}
|
||||
},
|
||||
{
|
||||
alert = "HomelabOciEdgeHighCpu"
|
||||
expr = "100 - (avg by (instance) (rate(node_cpu_seconds_total{job=\"oci-edge-node\",mode=\"idle\"}[5m])) * 100) > 85"
|
||||
"for" = "15m"
|
||||
labels = {
|
||||
severity = "warning"
|
||||
host_group = "public-edge"
|
||||
}
|
||||
annotations = {
|
||||
summary = "OCI edge VM CPU usage is high"
|
||||
description = "OCI edge VM CPU utilization has exceeded 85% for 15 minutes."
|
||||
}
|
||||
},
|
||||
{
|
||||
alert = "HomelabOciEmailHighCpu"
|
||||
expr = "100 - (avg by (instance) (rate(node_cpu_seconds_total{job=\"oci-email-node\",mode=\"idle\"}[5m])) * 100) > 85"
|
||||
"for" = "15m"
|
||||
labels = {
|
||||
severity = "warning"
|
||||
host_group = "email"
|
||||
}
|
||||
annotations = {
|
||||
summary = "OCI email VM CPU usage is high"
|
||||
description = "OCI email VM CPU utilization has exceeded 85% for 15 minutes."
|
||||
}
|
||||
}
|
||||
]
|
||||
}]
|
||||
}
|
||||
}
|
||||
kubeControllerManager = {
|
||||
enabled = false
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue