Add box resource telemetry and history to the cloud dashboard
Implementation is authorized and completed locally on feature/box-resource-telemetry; no commit or deployment was requested. User authorized read-only access to a directly Ethernet-connected representative box and necessary temporary local network configuration. Preserve the workstation's internet/default route. No package installs or remote service changes were performed. SSH used the configured authentication without host-key bypass. Outcome Operators can inspect current and historical host resource usage for a box in cloud-dashboard: CPU, RAM, filesystem capacity and GPU activity where supported. Missing, unsupported and stale data must not look like zero usage. Verified repository findings - kaukus-provisioner is a host systemd service, distributed as a static musl binary. It already connects outbound to NATS and announces every 30 seconds. HardwareInfo contains CPU model, total memory and NICs, but no resource utilization. - cloud-router receives announcements, persists latest box inventory in SQLite and protects box endpoints with boxes.manage. The control database uses one mutex-serialized connection; telemetry history must not cause control-path contention or unbounded backup growth. - cloud-dashboard has a box detail page with System/Diagnostics tabs and 3-second polling, and a fleet list polling every 4 seconds. It has no chart dependency. - Existing journal shipping demonstrates host-agent-to-NATS-to-router forwarding. No box time-series store or metrics backend deployment is configured in this checkout; external infrastructure availability is unverified. - local-streamer currently uses x264enc on the CPU; its README says VA-API encoding is disabled due to a pause-image freeze. User confirms all boxes use AMD integrated GPUs. The attached Ryzen 7 7730U/Barcelo box and its available counters are verified below; other AMD APU models/kernel-driver coverage remains unverified. Proposed scope for discussion - Collect host CPU utilization from counter deltas; RAM used/available/total using MemAvailable, plus swap; used/available/total filesystem capacity for host writable storage and recording storage, deduplicating shared filesystems and excluding virtual mounts. - GPU support targets AMD integrated GPUs only; no Intel/NVIDIA adapters are needed. Use the verified amdgpu sysfs/hwmon GPU-busy and memory counters; include available CPU/GPU temperature in the initial host-only scope. Investigate DRM fdinfo or versioned gpu_metrics fields for separate video-engine activity during streaming; support is not yet verified and must not be fabricated. Shared system memory and firmware-reserved GPU memory must not be presented as discrete dedicated VRAM or double counted in host RAM. Unsupported probes must not break other stats or provisioning. Confirm supported counters on other APU generations as needed. - Confirmed initial scope is host data only: CPU, RAM/swap, filesystem capacity, AMD GPU utilization/memory and available temperature readings. Container metrics are not important and are excluded. Network throughput, disk I/O, power charts, recording/upload backlog and alerts remain follow-up work; do not silently expand the initial implementation. - Prefer extending the existing host agent and reusing outbound NATS; no inbound ports or new box destination. Use the agreed 30-second sample interval, keeping collection bounded and independent of provisioning. User accepts offline gaps; use best-effort telemetry without durable local measurement buffering/backfill. Select additive heartbeat fields versus a separate telemetry subject after cadence and identity/ACL constraints are agreed. - Keep stable box identity independent of room reassignment. Version optional protocol fields, bound payload/device counts, validate sample values, handle counter resets/reboots and distinguish sample time from receive time/clock skew. - Agreed planning direction: add single-node VictoriaMetrics for numeric telemetry history alongside existing Grafana/Loki. User explicitly confirms keeping Loki for logs; VictoriaLogs evaluation/migration is out of scope. User accepted the recommendation with a starting cadence of 30 seconds and 30-day retention. Do not add Prometheus, a VictoriaMetrics cluster or a separate vmagent for this initial deployment. User-approved telemetry path: host agent -> existing outbound TLS-encrypted NATS connection -> cloud-router latest telemetry cache/Prometheus-format metrics exposition -> VictoriaMetrics native scraping. Messages contain measurements, box identity and timestamps, not credentials/configuration/recordings. No new inbound box ports, direct box-to-VictoriaMetrics connection or outbound box destination. Current/history dashboard reads stay behind cloud-router authorization. Approval covers the plan; implementation/deployment remains awaiting explicit go-ahead. Boxes need no inbound access or new outbound destination. The dashboard queries history through authorized, bounded cloud-router endpoints; Grafana can query VictoriaMetrics alongside Loki. Exposition must stop emitting stale/missing values rather than turn old readings into fresh samples; telemetry health/last-received time remains explicit. Deploy single-node VictoriaMetrics alongside the existing Grafana/Loki deployment for now; user accepts revisiting scale when needed. Size for 5 currently active boxes (currently no meetings), roughly one meeting per week, and anticipated growth to 10–20 boxes within a year. Collect continuously while boxes are online, not only during meetings. Include persistent VictoriaMetrics storage, disk sizing, internal-only scrape/query connectivity and Grafana datasource configuration. Alerts and recording-rule infrastructure are not required for the proposed initial monitoring scope. This is a planning decision, not authorization to implement or deploy. - Dashboard: summary CPU/RAM/disk values on fleet list; a reusable Resource/Performance panel in box detail with current values, synchronized charts, time ranges (proposed 1h/24h/7d/30d), last sample time and explicit stale/offline/unsupported states. Reuse existing authentication, API and polling patterns; refresh only bounded data and avoid history fetches on each general box poll. Chart dependency, if needed, requires user approval. - Proposed delivery: agree metric definitions/cadence/retention/hardware, verify collection on representative hardware, build end-to-end CPU/RAM/disk history, add GPU adapters, then fleet summaries and pilot rollout. No new framework or unrelated control-plane refactor. Planning decisions settled - Host-only metrics; no container metrics or alerts initially. Include available temperatures. - Offline gaps accepted; no durable local telemetry backlog/backfill. - Five active boxes today, about one meeting per week, expected growth to 10–20 boxes within a year. - Single-node VictoriaMetrics alongside existing Grafana/Loki, with persistent storage; 30-second cadence and 30-day retention. Revisit scaling as needed. Outstanding rollout/acceptance - No live deployment was authorized or performed. Release cloud-router/dashboard/provisioner together, apply migration 27, attach Grafana to the configured VictoriaMetrics datasource/network, and persist the VictoriaMetrics volume. - Existing boxes must explicitly review/apply their announced key once; migration does not infer trust from mutable announcement state. Changed/reflashed keys have an explicit re-enrollment flow that preserves room and meeting history, including assignments already pending during upgrade. - Confirm general GPU telemetry and any optional video-engine counter policy under an actual streaming workload. Separate encode/decode engine metrics remain intentionally absent until validated. Acceptance criteria for eventual implementation - Agreed metrics show accurate current values and retained history through the authorized dashboard/API. - Host and recording storage are correctly identified; shared filesystems are not double counted; GPU unsupported/shared-memory states are honest. - Old agents remain compatible; stale/offline/missing data and restarts/counter resets are handled without fabricated zeroes or chart continuity. - Collection and storage are bounded and cannot block provisioning or materially degrade streaming/control operations. - Focused protocol/parser/counter, auth/ingestion, retention/aggregation and UI regressions pass, alongside relevant Rust checks and dashboard tests/build. Real browser validation and representative-box idle/streaming checks are required for implementation acceptance. Hardware investigation resumed after user confirmed SSH was fixed. Read-only SSH as streamer now succeeds through the normal configured authentication with no identity overrides or host-key bypass. Scoped Ethernet IPv6 requires direct SSH because remote_python rejects scoped IPv6 host strings. After user confirmed the cable remained attached, local NetworkManager logs verified repeated DHCP timeout/reactivation cycles (~45 seconds). Created and activated an in-memory, non-autoconnect workstation profile 'Kaukus direct (temporary)' (UUID 226a02e1-c65c-45f3-bc07-eabaefcf649e) on enp0s31f6: IPv4 disabled, IPv6 link-local only, no default route or automatic DNS. The saved 'Wired connection 1' profile remains unchanged; Wi-Fi retains the default route. Restore normal wired behavior with nmcli connection up 'Wired connection 1'; remove the temporary profile with nmcli connection delete 'Kaukus direct (temporary)'. Verified on the attached representative box: AMD Ryzen 7 7730U with Radeon Graphics, PCI 1002:15e7 revision c4, amdgpu driver, Fedora CoreOS 44.20260829.3.1, kernel 7.1.10-200.fc44.x86_64. Unprivileged sysfs reads expose gpu_busy_percent, reserved VRAM and GTT usage/totals, GPU temperature (edge) and PPT power; mem_busy_percent is absent. The gpu_metrics binary header is verified as format/content revision 2.2, 128 bytes; activity field decoding and video-engine availability are not yet verified. This snapshot showed 0% GPU busy and 28 C; it is not an under-load validation. CPU/RAM proc files are readable. amdgpu_top/radeontop are not installed; basic collection does not require them. Read-only sudo inspection also succeeded: PCI identifies AMD Barcelo; no process currently has a DRM device descriptor open, so fdinfo video-engine counters could not be inspected. The local-streamer container is running. Its /data bind mount points to /var/home/streamer/local-streamer-data on the host; /data does not exist on the host. CoreOS / reports a ~6 MB read-only filesystem with zero available bytes by design and must not generate a disk-full warning. /var and /var/lib/containers share the same ~511 GB XFS filesystem (~483 GB available). Subsequent statvfs/stat checks confirmed the recording path shares /var's device ID 66308 and identical capacity figures, so they must not be counted as separate disks. Connectivity blocker resolved by the temporary local-only profile after user confirmation. Read-only SSH succeeded and the interface remained connected across a 55-second observation interval longer than the previous DHCP timeout, with all six before/after pings successful and the Wi-Fi default route unchanged. A one-second CPU counter-delta sample reported 0.25% busy excluding iowait; repeat GPU reads succeeded at 0% busy. These are idle observations, not streaming/load validation. Separate GPU video-engine activity remains unverified; retention/backend, initial scope, offline-gap policy, fleet sizing assumptions and hosting direction are now agreed. Implementation outcome on feature/box-resource-telemetry: kaukus-provisioner collects bounded CPU/RAM/swap/writable recording-filesystem/AMD iGPU/temperature telemetry every 30 seconds, skips disconnected publication and seals each payload to the router with authenticated HPKE. Operator approval transactionally pins the displayed box key; shared announcement credentials cannot replace it. Legacy, changed and pending identities have explicit compare-and-swap approval/re-enrollment without deleting room history. cloud-router validates identity/time/order/ranges, keeps only latest current state, emits stale-aware Prometheus metrics and serves bounded authorized VictoriaMetrics history masked for telemetry, metric and scrape gaps. Single-node VictoriaMetrics with pinned image, persistent volume, 30-day retention, scrape config and Grafana datasource is included; Loki is unchanged. cloud-dashboard shows fleet summaries and responsive dependency-free current/history charts with stale/missing states, race-safe range changes and key-review UX. Verified: cargo fmt; cargo check --workspace; 191 ordinary targeted Rust tests passed (124 cloud-router, 17 provisioner and 50 protocol, plus doc tests), plus both isolated real-NATS provisioning scenarios; affected strict Clippy passes when only the repository's known pre-existing collapsible-if/items-after-test-module/result-large-err lints are allowed. All 17 dashboard tests and production build pass. Development and production Compose configs and YAML parse; the pinned VictoriaMetrics image starts with the real config and accepts the full gap-masking MetricsQL query. Isolated Chrome acceptance passes desktop/mobile current/history charts, range switching, fleet summaries, initial telemetry-key approval and changed-key pending re-enrollment with exact captured request payloads and no browser errors. Static patch review findings were iteratively corrected. Representative box idle sysfs/proc/storage sources were read successfully, but the new agent binary was not deployed there and no active streaming-load/GPU-engine validation was performed. Production infrastructure preparation on router.kaukus.no: as deploy, backed up /home/deploy/router/docker-compose.yml to docker-compose.yml.before-victoriametrics-20261028T134621Z; added pinned single-node VictoriaMetrics v1.150.0 digest, 30-day retention, 512 MiB limit, persistent router_victoria-metrics-data volume and internal cloud-router scrape config; added VICTORIA_METRICS_URL/dependencies to the live compose; provisioned Grafana's VictoriaMetrics Prometheus datasource and restarted only Grafana. Compose validation passed. VictoriaMetrics is running on router_backend, health returns OK, storage initialized with the container memory limit, and Grafana API confirms the datasource. Post-deployment verification: cloud-router 0.2.0 is healthy, migration 27 applied, VICTORIA_METRICS_URL is configured, and /metrics returns valid exposition. VictoriaMetrics target cloud-router-boxes is healthy with no scrape error and the stored standard up series is 1. First test-box telemetry is now live after provisioner 1.2.0 deployment and operator key approval. VictoriaMetrics reports telemetry_up=1 plus current CPU (~1.02%), memory (~7.43%), storage (~20.0%), AMD GPU (0% idle), CPU temperature (47.75 C) and GPU temperature (46 C) for box 006de041088c425cac36962151b6e0e3. This verifies authenticated end-to-end collection, scrape, storage and query on representative AMD hardware at idle. Existing router services remained running and Grafana datasource remains provisioned. Other boxes remain on older agents/unapproved identities. Active streaming-load and video-engine behavior remain unverified. No box agent deployment or streaming-load validation performed. Pull request - #138: https://git.kaukus.no/Kaukus/streaming-engines/pulls/138 - Head feature/box-resource-telemetry; base main. Commit a644b41 (feature: Add box resource telemetry) is pushed. Task remains in progress because production rollout and active streaming-load GPU validation are outstanding.
Checklist
4 of 5 complete- Agree initial metrics, GPU hardware coverage, sampling cadence, retention/backend and offline-gap policy before implementation.
- Implement and verify bounded host CPU/RAM/filesystem collection and backward-compatible NATS ingestion without blocking control operations.
- Implement and verify persistent history, retention, bounded chart queries and honest missing/stale/offline behavior.
- Verify GPU collection on agreed representative hardware, including engine-specific and unsupported states.
- Deliver fleet summaries and box history charts; pass relevant automated, real-browser and representative-box idle/streaming validation.
- Area
- Streaming
- Project
- streaming-engines
- Kind
- Feature
- Task ID
tsk_h3seust3cw- Updated