From 37267e2e3019c6e4c18fc296e8cf4ab679d3ef31 Mon Sep 17 00:00:00 2001 From: "juvenal.diaz" Date: Wed, 28 Oct 2026 10:37:39 -0600 Subject: [PATCH] feat: alert on OCI VM health and CPU --- bootstrap/platform/main.tf | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/bootstrap/platform/main.tf b/bootstrap/platform/main.tf index 9e121d5..fbe67f8 100644 --- a/bootstrap/platform/main.tf +++ b/bootstrap/platform/main.tf @@ -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 }