Repository navigation
Description
What's the problem
/metrics carries 28 pithead_* families, of which only one is a host metric (pithead_disk_used_percent). There is no CPU, load, memory, swap, per-volume disk, temperature, network or uptime series, and no Grafana artifact or exporter on either branch. People who scrape /metrics into Grafana cannot build a box-health panel. /metrics is always on today (docs/monitoring.md: "always on and needs no configuration").
What it impacts
Operators who run Prometheus/Grafana, and anyone alerting on a full disk, swapping or overheating host. Under the dashboard-only default nothing changes until an operator enables api or both. cpu, load, memory and the /data filesystem are already sampled (collector/system.py on both branches; host_resources.py on develop-v2.1.0 only). Swap, temperature, network, uptime and per-volume disk have no collector yet, so new /proc and /sys reads are needed.
How I found it
Grafana users asked for box-health panels. I read web/views/prometheus.py (hand-rendered, identical on develop and develop-v2.1.0), docs/monitoring.md and the compose and quadlet files: no node_exporter, cAdvisor or Grafana anywhere. host_resources on develop-v2.1.0 declares swap and temperature unsupported. A live sample was not possible.
How important is it
Medium; part reuse, part new collectors. New feature (2.1.0), and the main thing Grafana users lack.
Acceptance criteria
- /metrics adds gauges, all prefixed pithead_host_: cpu_used_percent, load1/load5/load15, memory_total_bytes, memory_available_bytes, swap_total_bytes, swap_used_bytes, filesystem_size_bytes and filesystem_avail_bytes with a label mount (the /data filesystem, plus any further mounts the dashboard container can see; unknown today; no device names or host paths beyond a short fixed volume name), temperature_celsius with label sensor, network_receive_bytes_total and network_transmit_bytes_total (counters, label interface), uptime_seconds.
- A series is omitted, not zero, when its source is unavailable; a pithead_host_collector_up gauge says which collectors work.
- Served only in interface mode (Add a dashboard.mode setting: dashboard only (default), API only (headless), or both #3974) api or both; in dashboard-only mode, the default, /metrics returns 404 to external callers (existing UI calls do not use /metrics). A test asserts the fresh-install default returns 404. Gated by the interface-mode setting once its issue (to be filed first, number to be cited here) lands.
- Auth follows Dashboard login page with admin and read-only roles, replacing the browser's basic-auth prompt #3872 (read-only /metrics credential, folded in from closed Provide read-only monitoring credentials separate from dashboard administration #3183); until it lands, the existing optional Caddy basic_auth applies, and with no dashboard password /metrics is open. No new listener, no new exporter container.
- No hostname, IP, MAC or hardware serial appears as a label or value.
- The existing 28 families (total, including pithead_disk_used_percent) are unchanged; docs/monitoring.md documents the new families and a Grafana scrape example, and insecure_skip_verify is removed from the scrape example in the Prometheus metrics section.
- Tests: exposition-format parse, label set per volume, omission on missing source, auth required, 404 in dashboard-only mode, and no hostname, IP or MAC in any label or value.
Possible solutions
- Extend the hand-written renderer using the collectors already in collector/system.py and host_resources, adding new /proc and /sys readers for the missing series (no new dependency).
- prometheus_client versus hand-written text: the library gives a tested exposition format at the cost of a new dependency; hand-written keeps the current renderer.
- Ship node_exporter as a service: richer metrics, but a new container and listener (see Provide read-only monitoring credentials separate from dashboard administration #3183 for the earlier decision against one, and the no-second-exporter, no-new-listener criteria in Dashboard login page with admin and read-only roles, replacing the browser's basic-auth prompt #3872).
- /proc and /sys reads versus psutil. Unknown: whether the dashboard container can see per-volume mounts and hardware sensors on the appliance.
- Related: Forward appliance fixture credentials to authenticated metrics coverage #3667 (authenticated /metrics e2e fixture coverage) is the fixture the auth test should reuse.
Activity
pithead-architect commentedon Nov 27, 2026
Release regroom (owner request, 2026-11-27): moved from v2.1.0 to v2.1.3. Headless-dashboard and system-info UI chain depends on the login work in 2.1.0; second UI chunk.