diff --git a/docs/FAQ.md b/docs/FAQ.md index fb8e578121..c66ae761e9 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -333,6 +333,19 @@ does not prove that every reading is fresh. Missing or unavailable is not zero. failed), **Stale · Degraded** (the Proxmox provider is degraded), **Stale** (Pulse has no recent Proxmox readings), and **Degraded** (a node warning with current Proxmox readings). +- **Workloads (VMs and containers)** across Proxmox, VMware vSphere, Docker, and + Kubernetes surface stale primary provider telemetry without falsely flagging + fresh hypervisor readings when only an optional linked Pulse agent goes quiet. + Stale running and stopped workloads leave **Running** and join **Attention** + (while explicit **Offline**, **Error**, and **Failed** states stay ahead of + staleness), stale parent nodes show an amber **Stale data** badge in the node + group header (`Node telemetry is stale. Workload readings below reflect the + last poll received.`) without dimming guests as **Node offline**, affected + workload rows show an inline amber cue (`Stale · ` or `Stale data`) while + preserving last-known values, workload search matches stale labels, details, + and recorded source errors, and expanded workload drawers switch the header + indicator to amber and display an inline **Readings are stale** notice that + clears automatically when live telemetry recovers. - **Proxmox Ceph clusters** (`/proxmox/ceph`) show **Stale data** beneath the cluster name on desktop and phones when Proxmox polling goes quiet or hits a collection error, moving stale **Healthy** or **Unknown** clusters out of diff --git a/docs/UNIFIED_RESOURCES.md b/docs/UNIFIED_RESOURCES.md index e8ea888495..4aa3211a5d 100644 --- a/docs/UNIFIED_RESOURCES.md +++ b/docs/UNIFIED_RESOURCES.md @@ -102,6 +102,15 @@ On **Machines** (`/standalone/machines`), Pulse keeps a host's last known metric - **Table banner and row cue:** A table-level warning banner lists affected hosts and ages (`Telemetry is stale for (). CPU, memory, disk, and sensor readings shown are last known values until their agents report again.`). Each affected row displays an always-visible compact amber cue beneath the machine name (`Stale · ` or `Stale data` on desktop, and `Stale` on narrow screens). - **Expanded details, search, and fallbacks:** Expanding a stale machine displays an amber warning notice (`Agent has stopped reporting.`, the last report age, `Showing last known readings.`, and `Last error:` when recorded). Machine search matches stale labels, detail text, and recorded source errors. Retained RAID summaries are labelled `RAID Arrays (last known)`, and retained temperatures stay muted as last-known values. +### Stale workload telemetry + +Workload tables and drawers (VMs, system containers, and container workloads across Proxmox, VMware vSphere, Docker, and Kubernetes) project canonical resource staleness and primary provider `sourceStatus` directly onto each workload row: + +- **Primary provider scope:** Staleness tracks the workload's primary hypervisor or container provider (`Proxmox`, `vCenter`, `Docker`, or `Kubernetes`). On hybrid workloads (such as a Proxmox VM with an optional Pulse agent), fresh hypervisor readings stay unflagged when only the linked agent goes silent. Agent-sourced fields track agent staleness separately. +- **Filter routing and status priority:** Stale running and stopped workloads leave **Running** and route into **Attention** so stale workloads do not appear healthy, while explicit `offline`, `error`, and `failed` resource states stay ahead of staleness. If a running workload also has a failed attached availability probe, the header indicator keeps the probe warning alongside the stale label (`Running, not responding to probe · `). +- **Parent node headers and workload rows:** Only a confirmed offline parent node marks its guests **Node offline** and dims them. A stale or degraded parent node displays an amber **Stale data** badge in the node group header (`Node telemetry is stale. Workload readings below reflect the last poll received.`) while keeping last-known guest rows readable. Affected workload rows show an inline amber cue (`Stale · ` when report age is available, or `Stale data`) with hover detail while preserving last-known metrics. +- **Search and workload drawer:** Workload search matches stale labels, stale detail text (`Showing the last values received.`), and recorded source error text. Expanding a stale workload aligns the drawer header status dot to amber and shows an inline **Readings are stale** warning notice with the provider stale detail. Both clear reactively as soon as live telemetry resumes. + ## API ### Primary Endpoint diff --git a/frontend-modern/public/docs/FAQ.md b/frontend-modern/public/docs/FAQ.md index fb8e578121..c66ae761e9 100644 --- a/frontend-modern/public/docs/FAQ.md +++ b/frontend-modern/public/docs/FAQ.md @@ -333,6 +333,19 @@ does not prove that every reading is fresh. Missing or unavailable is not zero. failed), **Stale · Degraded** (the Proxmox provider is degraded), **Stale** (Pulse has no recent Proxmox readings), and **Degraded** (a node warning with current Proxmox readings). +- **Workloads (VMs and containers)** across Proxmox, VMware vSphere, Docker, and + Kubernetes surface stale primary provider telemetry without falsely flagging + fresh hypervisor readings when only an optional linked Pulse agent goes quiet. + Stale running and stopped workloads leave **Running** and join **Attention** + (while explicit **Offline**, **Error**, and **Failed** states stay ahead of + staleness), stale parent nodes show an amber **Stale data** badge in the node + group header (`Node telemetry is stale. Workload readings below reflect the + last poll received.`) without dimming guests as **Node offline**, affected + workload rows show an inline amber cue (`Stale · ` or `Stale data`) while + preserving last-known values, workload search matches stale labels, details, + and recorded source errors, and expanded workload drawers switch the header + indicator to amber and display an inline **Readings are stale** notice that + clears automatically when live telemetry recovers. - **Proxmox Ceph clusters** (`/proxmox/ceph`) show **Stale data** beneath the cluster name on desktop and phones when Proxmox polling goes quiet or hits a collection error, moving stale **Healthy** or **Unknown** clusters out of diff --git a/frontend-modern/public/docs/UNIFIED_RESOURCES.md b/frontend-modern/public/docs/UNIFIED_RESOURCES.md index e8ea888495..4aa3211a5d 100644 --- a/frontend-modern/public/docs/UNIFIED_RESOURCES.md +++ b/frontend-modern/public/docs/UNIFIED_RESOURCES.md @@ -102,6 +102,15 @@ On **Machines** (`/standalone/machines`), Pulse keeps a host's last known metric - **Table banner and row cue:** A table-level warning banner lists affected hosts and ages (`Telemetry is stale for (). CPU, memory, disk, and sensor readings shown are last known values until their agents report again.`). Each affected row displays an always-visible compact amber cue beneath the machine name (`Stale · ` or `Stale data` on desktop, and `Stale` on narrow screens). - **Expanded details, search, and fallbacks:** Expanding a stale machine displays an amber warning notice (`Agent has stopped reporting.`, the last report age, `Showing last known readings.`, and `Last error:` when recorded). Machine search matches stale labels, detail text, and recorded source errors. Retained RAID summaries are labelled `RAID Arrays (last known)`, and retained temperatures stay muted as last-known values. +### Stale workload telemetry + +Workload tables and drawers (VMs, system containers, and container workloads across Proxmox, VMware vSphere, Docker, and Kubernetes) project canonical resource staleness and primary provider `sourceStatus` directly onto each workload row: + +- **Primary provider scope:** Staleness tracks the workload's primary hypervisor or container provider (`Proxmox`, `vCenter`, `Docker`, or `Kubernetes`). On hybrid workloads (such as a Proxmox VM with an optional Pulse agent), fresh hypervisor readings stay unflagged when only the linked agent goes silent. Agent-sourced fields track agent staleness separately. +- **Filter routing and status priority:** Stale running and stopped workloads leave **Running** and route into **Attention** so stale workloads do not appear healthy, while explicit `offline`, `error`, and `failed` resource states stay ahead of staleness. If a running workload also has a failed attached availability probe, the header indicator keeps the probe warning alongside the stale label (`Running, not responding to probe · `). +- **Parent node headers and workload rows:** Only a confirmed offline parent node marks its guests **Node offline** and dims them. A stale or degraded parent node displays an amber **Stale data** badge in the node group header (`Node telemetry is stale. Workload readings below reflect the last poll received.`) while keeping last-known guest rows readable. Affected workload rows show an inline amber cue (`Stale · ` when report age is available, or `Stale data`) with hover detail while preserving last-known metrics. +- **Search and workload drawer:** Workload search matches stale labels, stale detail text (`Showing the last values received.`), and recorded source error text. Expanding a stale workload aligns the drawer header status dot to amber and shows an inline **Readings are stale** warning notice with the provider stale detail. Both clear reactively as soon as live telemetry resumes. + ## API ### Primary Endpoint diff --git a/frontend-modern/src/features/docs/__tests__/missingDataFAQ.test.ts b/frontend-modern/src/features/docs/__tests__/missingDataFAQ.test.ts index e4d7c5344e..443d9e37e4 100644 --- a/frontend-modern/src/features/docs/__tests__/missingDataFAQ.test.ts +++ b/frontend-modern/src/features/docs/__tests__/missingDataFAQ.test.ts @@ -69,10 +69,18 @@ describe('shipped missing-data FAQ', () => { it('routes each symptom to a real heading in a shipped guide', () => { const sections = [section('no-data-showing'), section('connection-refused')]; const links = sections.flatMap((element) => [...element.querySelectorAll('a[href]')]); - expect(links).toHaveLength(12); + expect(links).toHaveLength(15); expect( sections[0].querySelector('a[href="/docs/KUBERNETES#stale-kubernetes-readings"]'), ).not.toBeNull(); + expect( + sections[0].querySelector('a[href="/docs/RECOVERY#stale-proxmox-backup-telemetry"]'), + ).not.toBeNull(); + expect( + sections[0].querySelector( + 'a[href="/docs/PBS#stale-pbs-readings-and-unread-datastore-capacity"]', + ), + ).not.toBeNull(); expect( sections[0].querySelector( 'a[href="/docs/TROUBLESHOOTING#replication-jobs-are-pending-stale-or-missing"]', diff --git a/scripts/tests/test_stale_reading_help_docs.py b/scripts/tests/test_stale_reading_help_docs.py index 4d5db6f006..c368b335cf 100644 --- a/scripts/tests/test_stale_reading_help_docs.py +++ b/scripts/tests/test_stale_reading_help_docs.py @@ -827,6 +827,105 @@ class StaleReadingAndAgentHelpDocsTest(unittest.TestCase): self.assertIn('lead="Source telemetry is stale."', recoverable) self.assertIn("· Stale data", shared) + def test_help_documents_workload_stale_telemetry_across_rows_filters_and_drawers(self): + faq = doc_text("docs/FAQ.md") + faq_section = norm( + faq.split("### No data showing?\n", 1)[1].split("\n### ", 1)[0] + ) + for phrase in ( + "**Workloads (VMs and containers)** across Proxmox, VMware vSphere, Docker, and Kubernetes", + "without falsely flagging fresh hypervisor readings when only an optional linked Pulse agent goes quiet", + "Stale running and stopped workloads leave **Running** and join **Attention**", + "explicit **Offline**, **Error**, and **Failed** states stay ahead of staleness", + "amber **Stale data** badge in the node group header (`Node telemetry is stale. Workload readings below reflect the last poll received.`)", + "without dimming guests as **Node offline**", + "inline amber cue (`Stale · ` or `Stale data`)", + "workload search matches stale labels, details, and recorded source errors", + "inline **Readings are stale** notice that clears automatically when live telemetry recovers", + ): + with self.subTest(doc="FAQ.md", phrase=phrase): + self.assertIn(phrase, faq_section) + + unified = doc_text("docs/UNIFIED_RESOURCES.md") + stale_section = norm( + unified.split("### Stale workload telemetry\n", 1)[1].split("\n## ", 1)[0] + ) + for phrase in ( + "primary hypervisor or container provider (`Proxmox`, `vCenter`, `Docker`, or `Kubernetes`)", + "fresh hypervisor readings stay unflagged when only the linked agent goes silent", + "Stale running and stopped workloads leave **Running** and route into **Attention**", + "explicit `offline`, `error`, and `failed` resource states stay ahead of staleness", + "`Running, not responding to probe · `", + "Only a confirmed offline parent node marks its guests **Node offline** and dims them", + "`Node telemetry is stale. Workload readings below reflect the last poll received.`", + "`Stale · ` when report age is available, or `Stale data`", + "Workload search matches stale labels, stale detail text (`Showing the last values received.`), and recorded source error text", + "inline **Readings are stale** warning notice with the provider stale detail", + ): + with self.subTest(doc="UNIFIED_RESOURCES.md", phrase=phrase): + self.assertIn(phrase, stale_section) + + use_workloads = doc_text("frontend-modern/src/hooks/useWorkloads.ts") + selectors = doc_text("frontend-modern/src/components/Workloads/workloadSelectors.ts") + panel = doc_text("frontend-modern/src/components/Workloads/WorkloadPanel.tsx") + node_header = doc_text("frontend-modern/src/components/shared/NodeGroupHeader.tsx") + guest_row = doc_text("frontend-modern/src/components/Workloads/GuestRow.tsx") + guest_drawer = doc_text("frontend-modern/src/components/Workloads/GuestDrawer.tsx") + status_util = doc_text("frontend-modern/src/utils/status.ts") + + for marker in ( + "case 'proxmox-pve':", + "label: 'Proxmox'", + "case 'vmware-vsphere':", + "label: 'vCenter'", + "case 'docker':", + "label: 'Docker'", + "case 'kubernetes':", + "label: 'Kubernetes'", + "if (primarySource && CONNECTED_WORKLOAD_SOURCE_STATUS.test(primaryStatus)) {", + "Showing the last values received.", + "telemetryStale: resolveWorkloadTelemetryStale(resource, platformType)", + ): + self.assertIn(marker, use_workloads) + for marker in ( + "guest.telemetryStale &&", + "resourceStatus !== 'offline' &&", + "resourceStatus !== 'error' &&", + "resourceStatus !== 'failed'", + "return 'degraded';", + "guest.telemetryStale?.label,", + "guest.telemetryStale?.detail,", + "guest.telemetryStale?.error,", + ): + self.assertIn(marker, selectors) + self.assertIn( + "return pn ? getNodeStatusIndicator(pn).variant !== 'danger' : true;", + panel, + ) + for marker in ( + "data-node-group-stale", + 'title="Node telemetry is stale. Workload readings below reflect the last poll received."', + "Stale data", + ): + self.assertIn(marker, node_header) + for marker in ( + "data-workload-stale-cue", + "{stale().age ? `Stale · ${stale().age}` : stale().label}", + ): + self.assertIn(marker, guest_row) + for marker in ( + "getGuestHealthIndicator(props.guest, props.parentNodeOnline !== false)", + 'data-testid="guest-telemetry-stale-notice"', + '

Readings are stale

', + ): + self.assertIn(marker, guest_drawer) + for marker in ( + "`Running, not responding to probe · ${stale.label}`", + "if (stale) {", + "return { variant: 'warning', label: stale.detail || stale.label };", + ): + self.assertIn(marker, status_util) + def test_shipped_public_docs_mirrors_match_byte_for_byte(self): for name in ( "AGENT_SECURITY.md", @@ -836,6 +935,7 @@ class StaleReadingAndAgentHelpDocsTest(unittest.TestCase): "RECOVERY.md", "TRUENAS.md", "UNIFIED_AGENT.md", + "UNIFIED_RESOURCES.md", ): with self.subTest(doc=name): self.assertEqual(