Skip to content

Export host metrics (CPU, load, memory, swap, disk, temperature, network, uptime) on /metrics #3976

Open

Description

@pithead-developer

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

Activity

  1. added this to the v2.1.0 milestone on Nov 10, 2026
  2. added
    enhancement
    dashboard
    on Nov 10, 2026
  3. pithead-architect commented on Nov 27, 2026

    @pithead-architect

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dashboardenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions