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.

Say when a Docker host goes silent, and stop repeating host columns

rcourtman97c2f6f6ac46
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index f6fda0fd90..2fbbbe5d0c 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -8304,3 +8304,14 @@ chain at desktop and phone widths with keyboard/touch refresh, class-dark CSS,
403/503 controls and pending recovery. Unit controls separately cover current
request ownership and disposal. No mutation, route, navigation entry, queue
policy, permission or recipient-delivery contract is added by these states.
+
+### Platform tables read staleness from one helper
+
+`features/platformPage/resourceStaleness.ts` turns the backend's `stale`
+health verdict into a short label for platform tables, so a table that stops
+presenting a silent resource's last metrics as live does it the same way:
+dimmed metric cells plus the age with a no-signal icon, the full sentence on
+hover and as the accessible name. Grouped platform tables that already name
+the group in a shared grouped-table header row drop columns that would repeat
+the group's own value on every row.
+
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index ae04260b9a..d7704fa281 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -5859,3 +5859,21 @@ The Actions page now hides its Patrol Watch only guidance while the
presentation only: the action audit list, approval counts, review dialog,
routing and every recorded action outcome are read and rendered exactly as
before, and no resource or action identity changes.
+
+### Docker tables state silence and drop per-row host context
+
+`EvaluateResourceHealth` keeps the first reason as the one that explains the
+verdict, and when a stronger verdict (an alert, an availability failure, an
+offline host) wins while a source is stale, it appends a trailing
+`telemetry_stale` reason with the backend-formatted age, so the summary API's
+top reason is unchanged while surfaces can still tell that a resource stopped
+reporting. That reason, alone under a `stale` verdict or trailing another, is
+the only staleness signal platform tables read, through
+`features/platformPage/resourceStaleness.ts`; tables never derive staleness
+from `lastSeen` themselves. A stale Docker host dims its CPU, memory and
+disk cells and shows the age under Uptime ("No report for 1h" on hover and
+for assistive tech), and its container group header says the same. In
+grouped-by-host mode the containers table drops the Host and Engine
+columns, which repeat one value per group, and the group header names the
+engine once; flat mode keeps both columns.
+
diff --git a/frontend-modern/browser-verification/53ad9feb5295d777.json b/frontend-modern/browser-verification/53ad9feb5295d777.json
new file mode 100644
index 0000000000..0e245b92ce
--- /dev/null
+++ b/frontend-modern/browser-verification/53ad9feb5295d777.json
@@ -0,0 +1,40 @@
+{
+ "version": 1,
+ "base_sha": "efe6fc21ae10a6bf173cc17e6203aaf6c97dc130",
+ "verified_at": "2026-10-05T00:46:57Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/features/docker/DockerContainersTable.tsx",
+ "frontend-modern/src/features/docker/DockerHostsTable.tsx",
+ "frontend-modern/src/features/docker/dockerContainerTableModel.ts",
+ "frontend-modern/src/features/platformPage/resourceStaleness.ts"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/features/docker/DockerContainersTable.tsx": "fe623ced8151ed7278e3a1cbe05c898e53d6d6a5c70f313897ad314a3ee23dab",
+ "frontend-modern/src/features/docker/DockerHostsTable.tsx": "e4eec3adf7ab2f4b0016ef88c3d02ac301cfe193fa23fd2195dca58166c5574a",
+ "frontend-modern/src/features/docker/dockerContainerTableModel.ts": "b7880b014dfb457c2ab909f4bbdc1f5ee6bef0605f6308588057fedb787f6b20",
+ "frontend-modern/src/features/platformPage/resourceStaleness.ts": "f51fdd91d6ea9ee576fcb54f4aa4cc64fc52a3ad4641e0024298fdfc5c6f332e"
+ },
+ "routes": [
+ "/docker/overview"
+ ],
+ "viewports": [
+ {
+ "width": 1440,
+ "height": 900
+ },
+ {
+ "width": 390,
+ "height": 844
+ }
+ ],
+ "states": [
+ "Mock estate with five Docker hosts and 39 containers grouped by host. Before: every container row repeated its host name and engine (docker 26.1.3) in Host and Engine columns, truncating images; Field Office Edge 01 (no report for 1h) showed CPU 26% / memory 58% bars as if live.",
+ "After at 1440: Host and Engine columns gone in grouped mode, each group header reads e.g. \"12 containers podman 4.9.3\"; field-office-edge-01 header adds \"No report for 1h\". Hosts table dims that host's CPU/memory/disk and shows a no-signal icon with 1h under Uptime.",
+ "Phone 390x844: the stale host row keeps dimmed bars and the icon+age in the UP column without truncation; group headers show the engine.",
+ "Backend rebuilt with the trailing telemetry_stale reason; the stale host shows 2m after restart; alert-plus-stale is covered by Go and component tests because the mock does not produce it live."
+ ],
+ "interactions": [
+ "Loaded the overview signed in at both widths and inspected full-page screenshots; hovered the stale cell for its title; component tests cover the saved engine sort being ignored while grouped."
+ ]
+}
diff --git a/frontend-modern/src/features/docker/DockerContainersTable.tsx b/frontend-modern/src/features/docker/DockerContainersTable.tsx
index 85e9c3c0bd..cd8a7142ed 100644
--- a/frontend-modern/src/features/docker/DockerContainersTable.tsx
+++ b/frontend-modern/src/features/docker/DockerContainersTable.tsx
@@ -1,3 +1,4 @@
+import { getResourceStaleness } from '@/features/platformPage/resourceStaleness';
import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
import { useSearchParams } from '@solidjs/router';
import { type FilterDef } from '@/components/shared/FilterBar';
@@ -418,7 +419,14 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
});
const groupedRows = createMemo<DockerContainerHostGroup[]>(() => {
const groups = new Map<string, Resource[]>();
- for (const resource of sortedRows()) {
+ // Host and engine columns are hidden while grouped, so a sort saved on
+ // either would reorder rows with no visible indicator; grouped mode falls
+ // back to the attention-first order instead and flat mode keeps the sort.
+ const hiddenSortKey = sort.sortKey() === 'host' || sort.sortKey() === 'runtime';
+ const sourceRows = hiddenSortKey
+ ? [...scopedRows()].sort(compareDockerContainers)
+ : sortedRows();
+ for (const resource of sourceRows) {
const host = dockerHostName(resource);
const rows = groups.get(host);
if (rows) rows.push(resource);
@@ -466,6 +474,7 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
showRuntimeColumn(),
showRestartColumn(),
showStateColumn(),
+ { groupedByHost: isGroupable() && groupingMode() === 'grouped' },
),
);
const visibleColumnIds = createMemo(() => visibleColumns().map((column) => column.id));
@@ -698,6 +707,20 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
const indicator = group.hostResource
? getSimpleStatusIndicator(group.hostResource.status)
: undefined;
+ // The host's own engine metadata is authoritative; without it, name every
+ // distinct engine its containers report rather than just the first row's.
+ const engine = () => {
+ const host = group.hostResource;
+ if (host) {
+ const hostSummary = runtimeSummary(host);
+ if (hostSummary !== '—') return hostSummary;
+ }
+ const summaries = [...new Set(group.rows.map((row) => runtimeSummary(row)))]
+ .filter((summary) => summary !== '—')
+ .sort((a, b) => a.localeCompare(b));
+ return summaries.length > 0 ? summaries.join(', ') : null;
+ };
+ const staleness = () => getResourceStaleness(group.hostResource);
return (
<TableRow class={getGroupedTableRowClass()} data-docker-host-group={group.host}>
<TableCell class={getGroupedTableRowCellClass()} colspan={visibleColumns().length}>
@@ -721,6 +744,20 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
<span class={GROUPED_TABLE_ROW_BADGE_CLASS}>
{group.rows.length} {group.rows.length === 1 ? 'container' : 'containers'}
</span>
+ <Show when={engine()}>
+ {(label) => <span class="shrink-0 text-[10px] text-muted">{label()}</span>}
+ </Show>
+ <Show when={staleness()}>
+ {(stale) => (
+ <span
+ class="shrink-0 text-[10px] font-medium text-amber-700 dark:text-amber-300"
+ title={`${stale().label}. Container states and metrics are the last values received.`}
+ data-docker-host-group-stale
+ >
+ {stale().label}
+ </span>
+ )}
+ </Show>
</div>
</TableCell>
</TableRow>
diff --git a/frontend-modern/src/features/docker/DockerHostsTable.tsx b/frontend-modern/src/features/docker/DockerHostsTable.tsx
index 3f472d25fa..cad5f8ad5e 100644
--- a/frontend-modern/src/features/docker/DockerHostsTable.tsx
+++ b/frontend-modern/src/features/docker/DockerHostsTable.tsx
@@ -1,3 +1,5 @@
+import WifiOffIcon from 'lucide-solid/icons/wifi-off';
+import { getResourceStaleness } from '@/features/platformPage/resourceStaleness';
import { Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { ResourceNameWithWebInterfaceLink } from '@/components/shared/WebInterfaceLink';
@@ -375,6 +377,11 @@ export const DockerHostsTable: Component<{
const hostAlertStyles = createMemo(() =>
getAlertStyles(host.id, activeAlerts, alertsEnabled(), name()),
);
+ // Metrics from a host that stopped reporting are its last
+ // values, not live readings; say so instead of showing them
+ // as current.
+ const staleness = createMemo(() => getResourceStaleness(host));
+ const staleMetricClass = () => (staleness() ? 'opacity-50' : '');
const hostAlertBg = () => {
const s = hostAlertStyles();
if (!s.hasUnacknowledgedAlert) return '';
@@ -437,7 +444,9 @@ export const DockerHostsTable: Component<{
>
{containerCount()}
</TableCell>
- <TableCell class={getPlatformTableCellClassForKind('metric-bar')}>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('metric-bar')} ${staleMetricClass()}`}
+ >
<ResponsiveMetricCell
class="w-full"
value={cpuPercent() ?? 0}
@@ -448,7 +457,9 @@ export const DockerHostsTable: Component<{
thresholds={cpuThresholds()}
/>
</TableCell>
- <TableCell class={getPlatformTableCellClassForKind('metric-bar')}>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('metric-bar')} ${staleMetricClass()}`}
+ >
<Show
when={canRenderMetrics() && hasMemoryMetric()}
fallback={<PlatformTableMetricFallback />}
@@ -462,7 +473,9 @@ export const DockerHostsTable: Component<{
/>
</Show>
</TableCell>
- <TableCell class={getPlatformTableCellClassForKind('metric-bar')}>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('metric-bar')} ${staleMetricClass()}`}
+ >
<Show
when={canRenderMetrics() && hasDiskMetric()}
fallback={<PlatformTableMetricFallback />}
@@ -478,7 +491,24 @@ export const DockerHostsTable: Component<{
<TableCell
class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content sm:hidden md:table-cell`}
>
- {formatPlatformTableUptimeValue(host.uptime ?? docker()?.uptimeSeconds)}
+ <Show
+ when={staleness()}
+ fallback={formatPlatformTableUptimeValue(
+ host.uptime ?? docker()?.uptimeSeconds,
+ )}
+ >
+ {(stale) => (
+ <span
+ class="inline-flex items-center justify-end gap-1 font-medium text-amber-700 dark:text-amber-300"
+ title={`${stale().label}. CPU, memory and disk show the last values received.`}
+ data-docker-host-stale
+ >
+ <WifiOffIcon class="h-3 w-3 shrink-0" aria-hidden="true" />
+ <span aria-hidden="true">{stale().age ?? '—'}</span>
+ <span class="sr-only">{stale().label}</span>
+ </span>
+ )}
+ </Show>
</TableCell>
<TableCell
class={`${getPlatformTableCellClassForKind('numeric-value')} platform-table-narrow-hidden hidden text-base-content min-[360px]:table-cell md:table-cell`}
diff --git a/frontend-modern/src/features/docker/__tests__/DockerContainersTable.sort.test.tsx b/frontend-modern/src/features/docker/__tests__/DockerContainersTable.sort.test.tsx
index d3e9b02aa2..01d1c777a2 100644
--- a/frontend-modern/src/features/docker/__tests__/DockerContainersTable.sort.test.tsx
+++ b/frontend-modern/src/features/docker/__tests__/DockerContainersTable.sort.test.tsx
@@ -131,6 +131,164 @@ afterEach(() => {
vi.clearAllMocks();
});
+describe('DockerContainersTable host groups', () => {
+ it('names the engine and a silent host once on the group header, not per row', () => {
+ const resources = FIXTURE.map((resource) => ({
+ ...resource,
+ docker: { ...resource.docker, runtime: 'docker', runtimeVersion: '27.5.1' },
+ })) as Resource[];
+ const staleHost = {
+ id: 'agent:host-a',
+ name: 'host-a',
+ displayName: 'host-a',
+ type: 'docker-host',
+ platformType: 'docker',
+ status: 'degraded',
+ health: { verdict: 'stale', reasons: [{ code: 'telemetry_stale', detail: '1h' }] },
+ docker: { hostname: 'host-a' },
+ } as unknown as Resource;
+ const { container } = render(() => (
+ <Router>
+ <Route
+ path="/"
+ component={
+ (() => (
+ <DockerContainersTable
+ resources={resources}
+ hosts={[staleHost]}
+ emptyIcon={<span />}
+ emptyTitle="No containers"
+ emptyDescription="No containers"
+ showToolbar={false}
+ />
+ )) as () => JSX.Element
+ }
+ />
+ </Router>
+ ));
+
+ const hostA = container.querySelector('tr[data-docker-host-group="host-a"]')!;
+ const hostB = container.querySelector('tr[data-docker-host-group="host-b"]')!;
+ expect(hostA).toHaveTextContent('docker 27.5.1');
+ expect(hostA.querySelector('[data-docker-host-group-stale]')).toHaveTextContent(
+ 'No report for 1h',
+ );
+ expect(hostB.querySelector('[data-docker-host-group-stale]')).toBeNull();
+ expect(screen.queryByRole('columnheader', { name: /^Host/ })).not.toBeInTheDocument();
+ expect(screen.queryByRole('columnheader', { name: /^Engine/ })).not.toBeInTheDocument();
+ });
+});
+
+describe('DockerContainersTable grouped sorting', () => {
+ it('ignores a saved engine sort while grouped, where the engine column is hidden', () => {
+ const rows = [
+ makeContainer({
+ id: 'alpha',
+ host: 'host-a',
+ docker: { agentId: 'agent-host-a', hostname: 'host-a', runtime: 'podman' },
+ }),
+ makeContainer({
+ id: 'zulu',
+ host: 'host-a',
+ status: 'stopped',
+ docker: {
+ agentId: 'agent-host-a',
+ hostname: 'host-a',
+ runtime: 'docker',
+ containerState: 'exited',
+ exitCode: 1,
+ },
+ }),
+ makeContainer({
+ id: 'mike',
+ host: 'host-a',
+ docker: { agentId: 'agent-host-a', hostname: 'host-a', runtime: 'docker' },
+ }),
+ makeContainer({ id: 'bravo', host: 'host-b' }),
+ ];
+ const renderRows = () =>
+ render(() => (
+ <Router>
+ <Route
+ path="/"
+ component={
+ (() => (
+ <DockerContainersTable
+ resources={rows}
+ emptyIcon={<span />}
+ emptyTitle="No containers"
+ emptyDescription="No containers"
+ showToolbar={false}
+ />
+ )) as () => JSX.Element
+ }
+ />
+ </Router>
+ ));
+
+ // A sort saved in flat mode on a column grouped mode hides must not
+ // silently reorder the grouped rows (podman would otherwise lead).
+ window.localStorage.setItem('dockerContainersSortKey', 'runtime');
+ window.localStorage.setItem('dockerContainersSortDirection', 'desc');
+ const { container } = renderRows();
+ expect(visibleRowOrder(container)).toEqual([
+ 'group:host-a',
+ 'zulu',
+ 'alpha',
+ 'mike',
+ 'group:host-b',
+ 'bravo',
+ ]);
+ });
+
+ it('names every engine a host group reports when the host has no engine metadata', () => {
+ const mixed = [
+ makeContainer({
+ id: 'one',
+ host: 'host-a',
+ docker: {
+ agentId: 'agent-host-a',
+ hostname: 'host-a',
+ runtime: 'docker',
+ runtimeVersion: '27.5.1',
+ },
+ }),
+ makeContainer({
+ id: 'two',
+ host: 'host-a',
+ docker: {
+ agentId: 'agent-host-a',
+ hostname: 'host-a',
+ runtime: 'podman',
+ runtimeVersion: '5.2.1',
+ },
+ }),
+ makeContainer({ id: 'three', host: 'host-b' }),
+ ];
+ const { container } = render(() => (
+ <Router>
+ <Route
+ path="/"
+ component={
+ (() => (
+ <DockerContainersTable
+ resources={mixed}
+ emptyIcon={<span />}
+ emptyTitle="No containers"
+ emptyDescription="No containers"
+ showToolbar={false}
+ />
+ )) as () => JSX.Element
+ }
+ />
+ </Router>
+ ));
+ expect(container.querySelector('tr[data-docker-host-group="host-a"]')).toHaveTextContent(
+ 'docker 27.5.1, podman 5.2.1',
+ );
+ });
+});
+
describe('DockerContainersTable user sorting', () => {
it('sorts within host groups without changing the group order', () => {
const { container } = renderTable();
diff --git a/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx b/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx
index 1cd93a0134..f3f231e4a4 100644
--- a/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx
+++ b/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx
@@ -162,6 +162,58 @@ describe('DockerHostsTable', () => {
expect(screen.getByTestId('stacked-disk-bar')).toHaveAttribute('data-disks', '2');
});
+ it('marks a host that stopped reporting instead of showing its last metrics as live', () => {
+ render(() => (
+ <DockerHostsTable
+ resources={[
+ makeDockerHost({
+ health: { verdict: 'stale', reasons: [{ code: 'telemetry_stale', detail: '1h' }] },
+ }),
+ makeDockerHost({ id: 'agent:docker-02', name: 'docker-02', displayName: 'docker-02' }),
+ ]}
+ emptyIcon={<span />}
+ emptyTitle="No Docker hosts"
+ emptyDescription="No hosts"
+ showToolbar={false}
+ />
+ ));
+
+ const stale = document.querySelectorAll('[data-docker-host-stale]');
+ expect(stale).toHaveLength(1);
+ expect(stale[0].querySelector('.sr-only')).toHaveTextContent('No report for 1h');
+ expect(stale[0]).toHaveTextContent('1h');
+ const staleRow = document.querySelector('[data-docker-host-row="agent:docker-01"]')!;
+ const liveRow = document.querySelector('[data-docker-host-row="agent:docker-02"]')!;
+ expect(staleRow.querySelectorAll('td.opacity-50')).toHaveLength(3);
+ expect(liveRow.querySelectorAll('td.opacity-50')).toHaveLength(0);
+ });
+
+ it('still says a host is silent when an alert outranks the stale verdict', () => {
+ render(() => (
+ <DockerHostsTable
+ resources={[
+ makeDockerHost({
+ health: {
+ verdict: 'critical',
+ reasons: [
+ { code: 'critical_alert', detail: 'docker-host-offline' },
+ { code: 'telemetry_stale', detail: '1h' },
+ ],
+ },
+ }),
+ ]}
+ emptyIcon={<span />}
+ emptyTitle="No Docker hosts"
+ emptyDescription="No hosts"
+ showToolbar={false}
+ />
+ ));
+
+ expect(document.querySelector('[data-docker-host-stale] .sr-only')).toHaveTextContent(
+ 'No report for 1h',
+ );
+ });
+
it('colors row metric bars from alert-configured thresholds, not display defaults', () => {
render(() => (
<DockerHostsTable
diff --git a/frontend-modern/src/features/docker/__tests__/DockerNativeTables.test.tsx b/frontend-modern/src/features/docker/__tests__/DockerNativeTables.test.tsx
index 15bb7087d2..fff230d60c 100644
--- a/frontend-modern/src/features/docker/__tests__/DockerNativeTables.test.tsx
+++ b/frontend-modern/src/features/docker/__tests__/DockerNativeTables.test.tsx
@@ -248,7 +248,8 @@ describe('Docker native tables', () => {
));
expect(screen.getByText('Container')).toBeInTheDocument();
- expect(screen.getByText('Engine')).toBeInTheDocument();
+ // Grouped by host, the engine and host move to the group header.
+ expect(screen.queryByText('Engine')).not.toBeInTheDocument();
expect(screen.getByText('CPU')).toBeInTheDocument();
expect(screen.getByText('Memory')).toBeInTheDocument();
expect(screen.getByText('Restarts')).toBeInTheDocument();
@@ -258,8 +259,8 @@ describe('Docker native tables', () => {
expect(screen.queryByText('State')).not.toBeInTheDocument();
expect(screen.getByText('edge-web')).toBeInTheDocument();
// Multi-host fleets group by host by default, so the host name renders
- // twice: once in the group header row and once in the host column.
- expect(screen.getAllByText('edge-01')).toHaveLength(2);
+ // once, in the group header row, instead of again on every container.
+ expect(screen.getAllByText('edge-01')).toHaveLength(1);
expect(screen.getByText('docker 27.5.1')).toBeInTheDocument();
expect(screen.getByText('podman 5.2.1')).toBeInTheDocument();
expect(screen.getByText('nginx:latest')).toBeInTheDocument();
@@ -320,7 +321,8 @@ describe('Docker native tables', () => {
));
expect(screen.queryByText('Engine')).not.toBeInTheDocument();
- expect(screen.queryByText('docker 27.5.1')).not.toBeInTheDocument();
+ // Each host group header still names its engine once.
+ expect(screen.getAllByText('docker 27.5.1')).toHaveLength(2);
});
it('applies the URL host scope to container rows', () => {
@@ -362,8 +364,8 @@ describe('Docker native tables', () => {
));
expect(screen.getByText('edge-cache')).toBeInTheDocument();
- // Scoped to edge-02: group header + host column both show the host name.
- expect(screen.getAllByText('edge-02')).toHaveLength(2);
+ // Scoped to edge-02: the group header names the host once.
+ expect(screen.getAllByText('edge-02')).toHaveLength(1);
expect(screen.queryByText('edge-web')).not.toBeInTheDocument();
expect(screen.queryByText('edge-01')).not.toBeInTheDocument();
});
diff --git a/frontend-modern/src/features/docker/__tests__/dockerContainerTableModel.test.ts b/frontend-modern/src/features/docker/__tests__/dockerContainerTableModel.test.ts
index 41f10a0869..eb8dd60f5a 100644
--- a/frontend-modern/src/features/docker/__tests__/dockerContainerTableModel.test.ts
+++ b/frontend-modern/src/features/docker/__tests__/dockerContainerTableModel.test.ts
@@ -7,6 +7,20 @@ import {
} from '../dockerContainerTableModel';
describe('dockerContainerTableModel', () => {
+ it('drops host and engine columns when rows are grouped under their host', () => {
+ const flat = getDockerContainerVisibleColumnsForLayout('wide', true, true, true).map(
+ (column) => column.id,
+ );
+ const grouped = getDockerContainerVisibleColumnsForLayout('wide', true, true, true, {
+ groupedByHost: true,
+ }).map((column) => column.id);
+ expect(flat).toEqual(expect.arrayContaining(['host', 'runtime']));
+ // The group header names the host and its engine once for every row.
+ expect(grouped).not.toContain('host');
+ expect(grouped).not.toContain('runtime');
+ expect(grouped).toEqual(flat.filter((id) => id !== 'host' && id !== 'runtime'));
+ });
+
it('keeps five readable container signals in ultra-narrow containers', () => {
const columns = getDockerContainerVisibleColumnsForLayout('narrow', true, true, true);
const ids = columns.map((column) => column.id);
diff --git a/frontend-modern/src/features/docker/dockerContainerTableModel.ts b/frontend-modern/src/features/docker/dockerContainerTableModel.ts
index 2961092c89..74a980d16b 100644
--- a/frontend-modern/src/features/docker/dockerContainerTableModel.ts
+++ b/frontend-modern/src/features/docker/dockerContainerTableModel.ts
@@ -175,9 +175,13 @@ export const getDockerContainerVisibleColumnsForLayout = (
includeRuntime: boolean,
includeRestarts: boolean,
includeState: boolean,
+ options: { groupedByHost?: boolean } = {},
): DockerContainerTableColumn[] => {
const layoutRank = DOCKER_CONTAINER_TABLE_LAYOUT_ORDER[layoutMode];
return DOCKER_CONTAINER_COLUMNS.filter((column) => {
+ // Grouped by host, every row in a group shares its host and engine; the
+ // group header carries both instead of repeating them on each row.
+ if (options.groupedByHost && (column.id === 'host' || column.id === 'runtime')) return false;
if (column.id === 'runtime' && !includeRuntime) return false;
if (column.id === 'restarts' && !includeRestarts) return false;
// Ultra-narrow rows still need five stable scan fields. Keep the explicit
diff --git a/frontend-modern/src/features/platformPage/resourceStaleness.ts b/frontend-modern/src/features/platformPage/resourceStaleness.ts
new file mode 100644
index 0000000000..1e9708f380
--- /dev/null
+++ b/frontend-modern/src/features/platformPage/resourceStaleness.ts
@@ -0,0 +1,23 @@
+import type { Resource } from '@/types/resource';
+
+export interface ResourceStaleness {
+ // Backend-formatted age of the last report, e.g. "9m" or "1h"; null when
+ // the backend did not say.
+ age: string | null;
+ label: string;
+}
+
+// The backend owns staleness: a resource whose sources stopped reporting
+// carries a `telemetry_stale` health reason with the age, either as the reason
+// for a `stale` verdict or behind an alert that outranks it. Tables use this
+// to stop presenting the last received metrics as live.
+export const getResourceStaleness = (
+ resource: Pick<Resource, 'health'> | undefined | null,
+): ResourceStaleness | null => {
+ const health = resource?.health;
+ if (!health) return null;
+ const reason = health.reasons?.find((entry) => entry.code === 'telemetry_stale');
+ if (!reason && health.verdict !== 'stale') return null;
+ const age = reason?.detail?.trim() || null;
+ return { age, label: age ? `No report for ${age}` : 'No recent report' };
+};
diff --git a/internal/unifiedresources/health.go b/internal/unifiedresources/health.go
index 48eeff0633..fabf9c7bd0 100644
--- a/internal/unifiedresources/health.go
+++ b/internal/unifiedresources/health.go
@@ -44,11 +44,25 @@ type ResourceHealthAlert struct {
// EvaluateResourceHealth returns one deterministic verdict. Precedence is
// significant: live alert evidence wins over stale telemetry, while a stopped
-// workload is neutral only when no warning or critical evidence exists.
+// workload is neutral only when no warning or critical evidence exists. The
+// first reason always explains the verdict. When a stronger verdict wins over
+// a stale source, the stale reason follows it, so a surface can still say the
+// resource stopped reporting instead of presenting its last readings as live.
func EvaluateResourceHealth(resource Resource, alerts []ResourceHealthAlert, now time.Time) ResourceHealth {
if now.IsZero() {
now = time.Now().UTC()
}
+ health := evaluateResourceHealthVerdict(resource, alerts, now)
+ if health.Verdict != HealthStale && health.Verdict != HealthOK && resourceHasStaleSource(resource) {
+ health.Reasons = append(health.Reasons, ResourceHealthReason{
+ Code: "telemetry_stale",
+ Detail: formatHealthAge(now.Sub(resource.LastSeen)),
+ })
+ }
+ return health
+}
+
+func evaluateResourceHealthVerdict(resource Resource, alerts []ResourceHealthAlert, now time.Time) ResourceHealth {
matchingAlerts := matchingResourceHealthAlerts(resource, alerts)
for _, alert := range matchingAlerts {
diff --git a/internal/unifiedresources/registry_test.go b/internal/unifiedresources/registry_test.go
index 9203721d56..6a721e846a 100644
--- a/internal/unifiedresources/registry_test.go
+++ b/internal/unifiedresources/registry_test.go
@@ -6907,3 +6907,43 @@ func TestAgentNodeScanIndexTracksAgentsIngestedWhileLive(t *testing.T) {
t.Fatalf("index bucket for an agent ingested while live = %+v, want its registry entry", candidates)
}
}
+
+func TestEvaluateResourceHealthKeepsStaleTelemetryBehindAWinningAlert(t *testing.T) {
+ now := time.Date(2026, 10, 5, 1, 0, 0, 0, time.UTC)
+ silent := Resource{
+ ID: "docker-host-1",
+ Type: ResourceTypeAgent,
+ Status: StatusOnline,
+ LastSeen: now.Add(-70 * time.Minute),
+ SourceStatus: map[DataSource]SourceStatus{
+ SourceDocker: {Status: "stale", LastSeen: now.Add(-70 * time.Minute)},
+ },
+ }
+
+ // The alert still explains the verdict first, and the silence follows it
+ // so tables can stop presenting the host's last readings as live.
+ health := EvaluateResourceHealth(silent, []ResourceHealthAlert{{ResourceID: "docker-host-1", Level: "critical", Type: "docker-host-offline"}}, now)
+ if health.Verdict != HealthCritical || len(health.Reasons) != 2 {
+ t.Fatalf("expected critical with two reasons, got %+v", health)
+ }
+ if health.Reasons[0].Code != "critical_alert" {
+ t.Fatalf("expected the alert to stay the first reason, got %+v", health.Reasons)
+ }
+ if health.Reasons[1] != (ResourceHealthReason{Code: "telemetry_stale", Detail: "1h"}) {
+ t.Fatalf("expected a trailing telemetry_stale reason with the age, got %+v", health.Reasons[1])
+ }
+
+ // Without an alert the stale verdict carries the single reason as before.
+ health = EvaluateResourceHealth(silent, nil, now)
+ if health.Verdict != HealthStale || len(health.Reasons) != 1 || health.Reasons[0].Code != "telemetry_stale" {
+ t.Fatalf("expected a lone stale reason, got %+v", health)
+ }
+
+ // A fresh source adds nothing behind an alert.
+ fresh := silent
+ fresh.SourceStatus = map[DataSource]SourceStatus{SourceDocker: {Status: "online", LastSeen: now}}
+ health = EvaluateResourceHealth(fresh, []ResourceHealthAlert{{ResourceID: "docker-host-1", Level: "warning", Type: "cpu"}}, now)
+ if len(health.Reasons) != 1 {
+ t.Fatalf("expected only the alert reason for a fresh source, got %+v", health.Reasons)
+ }
+}