apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: name: homelab-high-signal-alerts namespace: monitoring labels: release: prometheus-stack role: alert-rules spec: groups: - name: homelab.availability rules: - alert: HomelabKubernetesNodeNotReady expr: kube_node_status_condition{condition="Ready",status="true"} == 0 for: 10m labels: severity: critical annotations: summary: "Kubernetes node {{ $labels.node }} is not Ready" description: "A node has been NotReady for 10 minutes. Run ./jeannie doctor-cluster." - alert: HomelabPodRestartStorm expr: increase(kube_pod_container_status_restarts_total[15m]) >= 3 for: 5m labels: severity: warning annotations: summary: "Pod restart storm in {{ $labels.namespace }}/{{ $labels.pod }}" description: "A container restarted at least 3 times in 15 minutes. Check pod logs and recent deployments." - alert: HomelabDeploymentUnavailable expr: kube_deployment_status_replicas_available < kube_deployment_spec_replicas for: 10m labels: severity: warning annotations: summary: "Deployment {{ $labels.namespace }}/{{ $labels.deployment }} is unavailable" description: "Available replicas are below desired replicas for 10 minutes." - alert: HomelabStaleResidualPods expr: | sum by (namespace, pod) ( kube_pod_status_phase{phase=~"Failed|Unknown"} == 1 ) > 0 for: 30m labels: severity: warning annotations: summary: "Stale residual pod {{ $labels.namespace }}/{{ $labels.pod }} needs cleanup" description: "A pod has stayed Failed or Unknown for 30 minutes. Jeannie can clean controller-owned residual pods after node disruption." - name: homelab.storage rules: - alert: HomelabNodeDiskPressure expr: kube_node_status_condition{condition="DiskPressure",status="true"} == 1 for: 5m labels: severity: critical self_heal: "true" annotations: summary: "Node {{ $labels.node }} reports DiskPressure" description: "Kubelet image filesystem pressure has crossed its eviction threshold (85% in the Pimox profile). Jeannie can prune unused images and old pod logs on the alerting Pimox worker." - alert: HomelabPersistentVolumeAlmostFull expr: (1 - kubelet_volume_stats_available_bytes / kubelet_volume_stats_capacity_bytes) * 100 > 85 for: 15m labels: severity: warning annotations: summary: "PVC {{ $labels.namespace }}/{{ $labels.persistentvolumeclaim }} is over 85% full" description: "PVC capacity is near exhaustion. Review app storage before it becomes an outage." - alert: HomelabHostFilesystemNearlyFull expr: 100 * (1 - node_filesystem_avail_bytes{fstype!~"tmpfs|overlay|squashfs",mountpoint=~"/|/data|/var/lib/docker"} / node_filesystem_size_bytes{fstype!~"tmpfs|overlay|squashfs",mountpoint=~"/|/data|/var/lib/docker"}) > 85 for: 15m labels: severity: warning self_heal: "true" annotations: summary: "Host filesystem {{ $labels.mountpoint }} on {{ $labels.instance }} is over 85% full" description: "The {{ $labels.mountpoint }} mount on {{ $labels.instance }} is near exhaustion. Review disk usage before it becomes an outage." - name: homelab.edge rules: - alert: HomelabOCIEdgeNodeExporterDown expr: up{job="oci-edge-node"} == 0 for: 10m labels: severity: warning annotations: summary: "OCI edge node metrics target is down" description: "The OCI edge VM node exporter is unreachable. Check OCI instance health, restricted monitoring ingress, and the scrape route." - alert: HomelabOCIEmailNodeExporterDown expr: up{job="oci-email-node"} == 0 for: 10m labels: severity: warning annotations: summary: "OCI email node metrics target is down" description: "The OCI email VM node exporter is unreachable. Check the VM, restricted monitoring ingress, and the scrape route." - alert: HomelabOCIEmailFilesystemNearlyFull expr: 100 * (1 - node_filesystem_avail_bytes{job="oci-email-node",fstype!~"tmpfs|overlay|squashfs",mountpoint="/"} / node_filesystem_size_bytes{job="oci-email-node",fstype!~"tmpfs|overlay|squashfs",mountpoint="/"}) > 85 for: 15m labels: severity: warning annotations: summary: "OCI email VM root filesystem is over 85% full" description: "Review mail queues, logs, and storage before the email VM becomes unavailable." - alert: HomelabTraefik5xxSpike expr: sum(rate(traefik_service_requests_total{code=~"5.."}[5m])) > 0.05 for: 10m labels: severity: warning annotations: summary: "Traefik is returning elevated 5xx responses" description: "Public edge or backend service may be unhealthy. Run ./jeannie doctor-edge." - alert: HomelabWebsiteDown expr: absent(kube_deployment_status_replicas_available{namespace="website-production",deployment="php-website-deployment"} > 0) for: 5m labels: severity: critical annotations: summary: "Website deployment has no available replicas" description: "The public website has no available Kubernetes replicas." - alert: HomelabGiteaRouteDown expr: absent(up{job=~".*gitea.*"} == 1) for: 15m labels: severity: warning annotations: summary: "No Gitea scrape target is healthy" description: "If Gitea is intentionally not scraped, keep Uptime Kuma as the source of truth; otherwise check ./jeannie doctor-gitea." - name: homelab.dns rules: - alert: HomelabPiHoleDNSDown expr: absent(up{job=~".*pihole.*"} == 1) for: 15m labels: severity: warning annotations: summary: "No Pi-hole scrape target is healthy" description: "If Pi-hole is intentionally not scraped, Uptime Kuma still monitors DNS. Run ./jeannie doctor-rpi." - name: homelab.jeannie-api rules: - alert: JeannieApiMetricsDown expr: absent(up{job="jeannie-api"} == 1) for: 5m labels: severity: critical self_heal: "true" annotations: summary: "Jeannie API metrics target is down" description: "The Debian-hosted Jeannie API is not reachable through the public edge. Jeannie self-heal may restart jeannie-server." - alert: JeannieApiHigh5xx expr: sum(rate(jeannie_http_requests_total{job="jeannie-api",status=~"5.."}[5m])) > 0.05 for: 10m labels: severity: warning annotations: summary: "Jeannie API is returning elevated 5xx responses" description: "The Debian-hosted API is returning more than 0.05 server errors per second for 10 minutes." - alert: JeannieApiHighLatency expr: | ( sum(rate(jeannie_http_request_duration_seconds_sum{job="jeannie-api"}[5m])) / sum(rate(jeannie_http_request_duration_seconds_count{job="jeannie-api"}[5m])) ) > 2 for: 10m labels: severity: warning annotations: summary: "Jeannie API latency is elevated" description: "Average API request latency has exceeded 2 seconds for 10 minutes." - alert: JeannieApiAuthFailures expr: increase(jeannie_auth_failures_total{job="jeannie-api"}[15m]) > 10 for: 5m labels: severity: warning annotations: summary: "Jeannie API has repeated authentication failures" description: "More than 10 invalid API authentication attempts occurred in 15 minutes."