Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Show real CPU low and record in the Proxmox node drawer

rcourtman60fb6e842b70
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index 50344121e9..9a0ad0a645 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -159,6 +159,11 @@ clearing, false/zero values, unchanged peer-site rows and full/fast equivalence.
merges, row, Overview and History with synthetic inputs. This is no native
QGA/thaw, installed recovery, fleet-performance or release-availability claim.
+Choosing a node's temperature source in `resourceStateAdapters.ts` reads one
+more field of the facet already in the canonical payload
+(`proxmox.temperatureDetails`) when earlier sources have no usable reading. It
+adds no resource read, merge pass, timer or subscription.
+
### Unavailable filesystem values share the existing disk model
The filesystem list and guest Overview use the same nullable measured-byte ratio
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 9a954da020..40bf3e9036 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -3182,6 +3182,15 @@ footer after the visible rows. The footer may dim the final row edge and expose
the remaining-row count, but expanding or collapsing it only changes the
client-side visible slice; it must not refetch, reorder, or redefine the
canonical resource collection.
+The shared `nodeFromResource` adapter takes a node's temperature from the first
+source with a usable reading: a platform or Proxmox temperature record, the
+agent facet, then `proxmox.temperatureDetails`. That last field is the Proxmox
+poller's full reading for a node without a host agent, including the CPU low
+and record values it tracks; `proxmox.temperature` is only the scalar maximum.
+A bare scalar reading carries no history, so the adapter leaves the CPU low and
+record unset rather than repeating the current value, and the node drawer omits
+those rows. `resourceStateAdapters.test.ts` pins both with the API's payload
+shape.
The registry and presentation coalescer also own metric-source freshness. When
two source facets contribute the same metric, source priority decides only if
both sources have equivalent freshness. A stale source must not hold CPU,
diff --git a/frontend-modern/browser-verification/541999f4ef0c4619.json b/frontend-modern/browser-verification/541999f4ef0c4619.json
new file mode 100644
index 0000000000..c648f4ae89
--- /dev/null
+++ b/frontend-modern/browser-verification/541999f4ef0c4619.json
@@ -0,0 +1,36 @@
+{
+ "version": 1,
+ "base_sha": "3b290640a51ef0f488f9cd06b4aa644adbdcc6b3",
+ "verified_at": "2026-10-06T15:25:00Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/utils/resourceStateAdapters.ts"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/utils/resourceStateAdapters.ts": "5b170b1c0d735afc584b0784403cd3510a8ab12aeb3e387e9baec6b80fcb5853"
+ },
+ "routes": [
+ "/proxmox"
+ ],
+ "viewports": [
+ {
+ "width": 1440,
+ "height": 900
+ },
+ {
+ "width": 390,
+ "height": 844
+ }
+ ],
+ "states": [
+ "Private mock stack built from this tree (backend :7681, Vite :5199); /api/resources confirmed the real node payload shape: proxmox.temperature is the scalar maximum and proxmox.temperatureDetails the full reading",
+ "Proxmox node Analytics A (pve31) as a PVE-only node (agent facet removed from REST and websocket payloads), main's adapter swapped in: drawer Thermals showed CPU low 82\u00b0C and CPU record 82\u00b0C, the current reading repeated as history",
+ "Same PVE-only node with this change and no low/record in temperatureDetails: CPU low and CPU record rows absent, Temperature and NVMe still shown",
+ "Same PVE-only node with this change and temperatureDetails carrying cpuMin 38.5 and cpuMaxRecord 91.2: drawer showed CPU low 39\u00b0C and CPU record 91\u00b0C at 1440x900 and 390x844",
+ "Agent-linked mock node (agent facet present) with this change, with and without an injected record: drawer identical to main (Temperature from the agent facet, no CPU low/record rows), table TEMP column unchanged at 82\u00b0C"
+ ],
+ "interactions": [
+ "Opened the node drawer from the row's detail toggle (aria-controls proxmox-host-drawer-<id>) on /proxmox at desktop and phone widths",
+ "Read the Thermals card rows and the row's TEMP cell, and took screenshots, for main's adapter and for this change, via Playwright with REST and websocket payload rewriting"
+ ]
+}
diff --git a/frontend-modern/src/utils/__tests__/resourceStateAdapters.coverage2.test.ts b/frontend-modern/src/utils/__tests__/resourceStateAdapters.coverage2.test.ts
index 679c95f6a3..d78b7157dc 100644
--- a/frontend-modern/src/utils/__tests__/resourceStateAdapters.coverage2.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceStateAdapters.coverage2.test.ts
@@ -981,7 +981,9 @@ describe('buildTemperature (via nodeFromResource)', () => {
);
expect(node?.temperature?.cpuPackage).toBe(42);
expect(node?.temperature?.cpuMax).toBe(42);
- expect(node?.temperature?.cpuMin).toBe(42);
+ // A bare reading has no low or record history to report.
+ expect(node?.temperature?.cpuMin).toBeUndefined();
+ expect(node?.temperature?.cpuMaxRecord).toBeUndefined();
expect(node?.temperature?.available).toBe(true);
expect(node?.temperature?.hasCPU).toBe(true);
});
diff --git a/frontend-modern/src/utils/__tests__/resourceStateAdapters.test.ts b/frontend-modern/src/utils/__tests__/resourceStateAdapters.test.ts
index bea2d130c6..dbb6aef82c 100644
--- a/frontend-modern/src/utils/__tests__/resourceStateAdapters.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceStateAdapters.test.ts
@@ -254,6 +254,61 @@ describe('resourceStateAdapters nodeFromResource', () => {
]);
});
+ it("reads a Proxmox node's CPU low and record from the poller's temperature details", () => {
+ // The unified resource API publishes the scalar maximum as
+ // proxmox.temperature and the full reading as proxmox.temperatureDetails.
+ const proxmox = {
+ nodeName: 'pve-node-2',
+ temperature: 58,
+ temperatureDetails: {
+ available: true,
+ hasCPU: true,
+ cpuPackage: 52,
+ cpuMax: 58,
+ cpuMin: 41,
+ cpuMaxRecord: 76,
+ minRecorded: '2026-10-06T08:00:00Z',
+ maxRecorded: '2026-10-06T12:00:00Z',
+ cores: [{ core: 0, temp: 58 }],
+ lastUpdate: '2026-10-06T15:00:00Z',
+ },
+ };
+ const node = nodeFromResource({
+ ...createNodeResource({ proxmox }),
+ temperature: 58,
+ proxmox,
+ } as unknown as Resource);
+
+ expect(node?.temperature).toMatchObject({
+ available: true,
+ cpuPackage: 52,
+ cpuMax: 58,
+ cpuMin: 41,
+ cpuMaxRecord: 76,
+ lastUpdate: '2026-10-06T15:00:00Z',
+ });
+ expect(node?.temperature?.cores).toEqual([{ core: 0, temp: 58 }]);
+
+ // Without details there is no history: the current reading must not be
+ // reported as the node's low or record.
+ const bare = nodeFromResource({
+ ...createNodeResource({ proxmox: { nodeName: 'pve-node-2', temperature: 58 } }),
+ temperature: 58,
+ } as unknown as Resource);
+ expect(bare?.temperature?.cpuPackage).toBe(58);
+ expect(bare?.temperature?.cpuMin).toBeUndefined();
+ expect(bare?.temperature?.cpuMaxRecord).toBeUndefined();
+
+ // A node with a host agent keeps reading the agent facet first.
+ const agentLinked = nodeFromResource({
+ ...createNodeResource({ proxmox, agent: { agentId: 'pve-agent', temperature: 61 } }),
+ temperature: 61,
+ proxmox,
+ } as unknown as Resource);
+ expect(agentLinked?.temperature?.cpuPackage).toBe(61);
+ expect(agentLinked?.temperature?.cpuMin).toBeUndefined();
+ });
+
it('preserves linked-agent GPU telemetry for the Proxmox node drawer', () => {
const gpu = {
id: '0',
diff --git a/frontend-modern/src/utils/resourceStateAdapters.ts b/frontend-modern/src/utils/resourceStateAdapters.ts
index fef157dbc0..f78e577757 100644
--- a/frontend-modern/src/utils/resourceStateAdapters.ts
+++ b/frontend-modern/src/utils/resourceStateAdapters.ts
@@ -1378,13 +1378,19 @@ const buildTemperature = (
nodeMeta?: Record<string, unknown>,
): Temperature | undefined => {
const platform = resourcePlatformData(resource);
- const raw =
- asRecord(platform?.temperature) ||
- asRecord(nodeMeta?.temperature) ||
- asRecord(platform?.agent) ||
- undefined;
-
- if (raw) {
+ // Take the first source with a usable reading. A Proxmox node without a host
+ // agent publishes its full reading, including the CPU low and record values
+ // the poller tracks, only as proxmox.temperatureDetails (proxmox.temperature
+ // is the scalar maximum), so it comes before the bare-reading fallback.
+ const candidates = [
+ platform?.temperature,
+ nodeMeta?.temperature,
+ platform?.agent,
+ nodeMeta?.temperatureDetails,
+ ];
+ for (const candidate of candidates) {
+ const raw = asRecord(candidate);
+ if (!raw) continue;
const available = asBoolean(raw.available);
const cpuPackage = asNumber(raw.cpuPackage) ?? asNumber(raw.temperature) ?? asNumber(raw.cpu);
const lastUpdate = toISOTime(raw.lastUpdate, resource.lastSeen);
@@ -1441,11 +1447,11 @@ const buildTemperature = (
if (typeof resource.temperature === 'number' && Number.isFinite(resource.temperature)) {
const temp = resource.temperature;
+ // A bare reading carries no low or record history. Leave them unset so the
+ // drawer omits those rows instead of repeating the current value as a record.
return {
cpuPackage: temp,
cpuMax: temp,
- cpuMin: temp,
- cpuMaxRecord: temp,
available: true,
hasCPU: true,
lastUpdate: toISOTime(undefined, resource.lastSeen),