# fleet-prometheus liveness rules.
#
# No Alertmanager is wired up by design. These rules only make alerts FIRING,
# visible at GET /api/v1/alerts on this Prometheus instance. Delivery to
# Telegram is a SEPARATE future task: brain-watchdog (on PIHA) polls that API
# over the VPS Tailscale IP and forwards. Do NOT add alerting/Alertmanager
# config here.
#
# SCOPE — alert ONLY for always-on infra nodes: vps, piha. Their up==0 is a
# real fault.
#
# Deliberately EXCLUDED: solaria, lustro. They are intermittent (planned
# power-off at times), so up==0 is not always an incident. Their liveness will
# be handled LATER by anomaly detection (metric-history based, separate
# backlog project), never by a static time-based rule. They stay scraped and
# visible in prometheus.yml — just not alerted here.

groups:
  - name: fleet-liveness
    rules:
      - alert: NodeDown
        expr: up{node=~"vps|piha"} == 0
        for: 5m
        labels:
          severity: critical
        annotations:
          summary: "Node {{ $labels.node }} down"
          description: "Node {{ $labels.node }} down — up==0 ponad 5m (job {{ $labels.job }}, instance {{ $labels.instance }})."
