homelab-codex-ws/services/fleet-prometheus/prometheus.yml
oskar 4518b15f98 feat(fleet-prometheus): scaffold fleet liveness Prometheus (VPS)
Clean scaffold of a Prometheus instance dedicated to fleet liveness, deliberately
separate from the home `prom` on PIHA. Scrapes only itself + the VPS-local
node_exporter for now.

- image pinned to prom/prometheus:v3.5.0 (LTS) — no :latest anti-pattern
- TSDB retention 15d / 2GB on the tight VPS; --web.enable-lifecycle for reloads
- mem_limit 512m, oom_score_adj +200 (sacrificial OOM victim before control-plane)
- tailscale-internal exposure via plain published 9090, mirroring control-plane
- node_exporter scraped via host.docker.internal:9100 (it runs network_mode: host)
- secret-free prometheus.yml; alerting/rule_files left as commented placeholders
- in-container healthcheck via busybox wget (present in the image; curl is not)

Smoke: docker compose config OK; promtool check config SUCCESS; up -d ->
/-/healthy + /-/ready OK; both targets (prometheus, fleet-node) report up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 18:07:18 +02:00

40 lines
1.5 KiB
YAML

# fleet-prometheus — fleet liveness source of truth.
#
# Deliberately SEPARATE from the home `prom` on PIHA (LAN-only). The `fleet`
# external label and the `fleet-` job naming make it unambiguous in every
# scraped series that this instance monitors the distributed fleet, not the
# home LAN. This file is SECRET-FREE by contract — never inline tokens here
# (the home prom embedding a plaintext HAOS token is the anti-pattern we avoid).
global:
scrape_interval: 15s
external_labels:
fleet: "homelab-codex"
# alerting:
# # Alertmanager wiring is added in a separate step (fleet liveness alerting).
# alertmanagers: []
# rule_files:
# # Liveness rules (e.g. up == 0 for: 5m) are added in a separate step.
# - "rules/*.yml"
scrape_configs:
# Self-monitoring — Prometheus scrapes its own /metrics. Bridged container
# listens on 0.0.0.0:9090, so localhost resolves inside the container.
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090"]
# First and only fleet target for this scaffold: the VPS-local node_exporter,
# which runs network_mode: host and listens on the host's :9100. Reached via
# the host-gateway alias declared in docker-compose.yml.
- job_name: "fleet-node"
static_configs:
- targets: ["host.docker.internal:9100"]
labels:
node: "vps"
# NOTE: Tailscale fleet targets (100.x node_exporters across SATURN, SOLARIA,
# PIHA, CHELSTY) are added in a separate step — not part of this scaffold.