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.

Expose workload CPU window inheritance

pulse-triage[bot]386041e46a76
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md
index 8a483f9a85..4aa66de1fa 100644
--- a/docs/release-control/v6/internal/subsystems/alerts.md
+++ b/docs/release-control/v6/internal/subsystems/alerts.md
@@ -212,8 +212,12 @@ their existing platform thresholds and disable policy.
Rolling metric evaluation is alert policy over monitoring-owned history, not a
second incident family. `metricEvaluationWindows` stores seconds by canonical
resource type and metric, with an explicit zero meaning current-value
-evaluation and platform-specific entries inheriting the `all` rule. CPU seeds a
-five-minute default; only CPU and burst-prone disk/network rate metrics may use
+evaluation. The Thresholds surface exposes both the global `all` rule and the
+canonical `guest` workload fallback; concrete workloads inherit through the
+same runtime chain (`vm` and `app-container` through `guest`, host-like agents
+through `node`, then `all`) and must label the effective parent duration rather
+than always presenting the global value. CPU seeds a five-minute default; only
+CPU and burst-prone disk/network rate metrics may use
rolling averages, while memory, capacity, and temperature remain instantaneous
evidence boundaries. A window requires at least three samples, at least 80%
temporal coverage, and no gap larger than the bounded cadence allowance. Weak,
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index a1b1bcfab2..f4626a5bde 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -511,8 +511,12 @@ absorb those persistence or validation rules into shared form/table chrome
The alerts-owned threshold surface also owns rolling metric evaluation
configuration. `ThresholdsTab` presents the understandable policy (current
value or a named rolling duration) rather than a query language, with one
-global CPU rule and sparse platform overrides that visibly inherit it. The
-configuration snapshot and payload models must round-trip explicit zero and
+global CPU rule, a canonical all-workload fallback, and sparse platform
+overrides that visibly inherit the effective parent. The select options and
+inherit labels must mirror the runtime hierarchy: VMs and application
+containers inherit `guest`, agent-backed systems inherit `node`, and every
+chain terminates at `all`. The configuration snapshot and payload models must
+round-trip explicit zero and
resource-specific maps without flattening inheritance. Copy must explain that
incomplete history holds incident state instead of firing or recovering, and
the control must remain usable at desktop and narrow viewports through shared
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index 2233b130dd..6770a44aa2 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,32 +1,27 @@
{
"version": 1,
- "base_sha": "4b9abd4eca5a1399a2386814d98eeadded198e45",
- "verified_at": "2026-08-27T20:10:44Z",
+ "base_sha": "1878245cdb1cde95f626cbe8cc95fa1e76c93155",
+ "verified_at": "2026-08-27T20:55:57Z",
"result": "passed",
"changed_paths": [
- "frontend-modern/src/components/Discovery/DiscoveryTab.tsx",
- "frontend-modern/src/components/Infrastructure/ResourceActionHistory.tsx",
- "frontend-modern/src/features/proxmox/ProxmoxMailGatewayDrawer.tsx"
+ "frontend-modern/src/features/alerts/tabs/ThresholdsTab.tsx"
],
"content_sha256": {
- "frontend-modern/src/components/Discovery/DiscoveryTab.tsx": "50839ded7dc62cbc3a9fb11fc5fc575acd1997ec9a4b0d7331fba22f0afb0ab4",
- "frontend-modern/src/components/Infrastructure/ResourceActionHistory.tsx": "241e5f93f444b3838b80c05f6b4f78c4788931c760d01dc63f54ee5d4ee5270a",
- "frontend-modern/src/features/proxmox/ProxmoxMailGatewayDrawer.tsx": "26faeb83e422b1d928385ce836e86a701ce544aa936b8de5bb38caee845bcb4d"
+ "frontend-modern/src/features/alerts/tabs/ThresholdsTab.tsx": "0f77405c3ece3b1d507e48ca0b7057a076fead8c1503a2c94cc4161594585c6c"
},
- "routes": ["/proxmox/mail", "/standalone/machines", "/docker/overview", "/actions"],
+ "routes": ["/alerts/thresholds/proxmox"],
"viewports": [
- { "width": 1920, "height": 800 },
+ { "width": 1920, "height": 900 },
{ "width": 390, "height": 844 }
],
"states": [
- "mail-gateway-eu expanded with inbound disposition statistics visible",
- "Apollo-114 and auth-service-01 management drawers inspected for Discovery and action-audit availability",
- "Actions open and history views inspected for seeded action records"
+ "default CPU evaluation windows with the all-workload fallback visible",
+ "all-workload override set to 15 minutes with VM and application-container inheritance visible",
+ "narrow platform-overrides disclosure expanded with the same inheritance state"
],
"interactions": [
- "expanded mail-gateway-eu and confirmed Greylist, RBL, and average-process values remain adjacent to their labels on desktop",
- "confirmed the three inbound statistic rows span the mobile card cleanly at 390px without overlap",
- "repeated the PMG desktop check after the mobile span correction",
- "inspected machine and Docker host drawers plus Actions history; the demo does not seed resource-level Discovery facts or action-audit drawer rows, so those responsive states are covered by rendered component tests"
+ "set All workloads to a 15 minute average and confirmed Virtual machines and Application containers changed to Inherit (15 minutes)",
+ "expanded Platform overrides at 390px and confirmed the workload controls remain readable without horizontal overflow",
+ "discarded the unsaved mock-runtime change after verification and confirmed the browser console contained no errors"
]
}
diff --git a/frontend-modern/src/features/alerts/__tests__/ThresholdsTab.test.tsx b/frontend-modern/src/features/alerts/__tests__/ThresholdsTab.test.tsx
index 37d13814be..05a3847c84 100644
--- a/frontend-modern/src/features/alerts/__tests__/ThresholdsTab.test.tsx
+++ b/frontend-modern/src/features/alerts/__tests__/ThresholdsTab.test.tsx
@@ -1,4 +1,4 @@
-import { render, cleanup, waitFor } from '@solidjs/testing-library';
+import { render, cleanup, fireEvent, screen, waitFor } from '@solidjs/testing-library';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { ThresholdsTab } from '../tabs/ThresholdsTab';
@@ -341,4 +341,38 @@ describe('ThresholdsTab', () => {
});
});
});
+
+ it('configures the canonical workload fallback and shows effective inheritance', () => {
+ const props = buildProps();
+ const setMetricEvaluationWindows = vi.fn();
+ const setHasUnsavedChanges = vi.fn();
+ props.metricEvaluationWindows = () => ({
+ all: { cpu: 300 },
+ guest: { cpu: 900 },
+ });
+ props.setMetricEvaluationWindows = setMetricEvaluationWindows;
+ props.setHasUnsavedChanges = setHasUnsavedChanges;
+
+ render(() => <ThresholdsTab {...props} />);
+
+ const workloadWindow = screen.getAllByLabelText(
+ 'All workloads CPU evaluation window',
+ )[0] as HTMLSelectElement;
+ const virtualMachineWindow = screen.getAllByLabelText(
+ 'Virtual machines CPU evaluation window',
+ )[0] as HTMLSelectElement;
+ expect(workloadWindow.value).toBe('900');
+ expect(virtualMachineWindow.options[0].textContent).toBe('Inherit (15 minutes)');
+
+ fireEvent.input(workloadWindow, { target: { value: '60' } });
+
+ const update = setMetricEvaluationWindows.mock.calls[0][0] as (
+ previous: Record<string, Record<string, number>>,
+ ) => Record<string, Record<string, number>>;
+ expect(update({ all: { cpu: 300 }, guest: { cpu: 900 } })).toEqual({
+ all: { cpu: 300 },
+ guest: { cpu: 60 },
+ });
+ expect(setHasUnsavedChanges).toHaveBeenCalledWith(true);
+ });
});
diff --git a/frontend-modern/src/features/alerts/tabs/ThresholdsTab.tsx b/frontend-modern/src/features/alerts/tabs/ThresholdsTab.tsx
index 9bc16c364d..f04436c909 100644
--- a/frontend-modern/src/features/alerts/tabs/ThresholdsTab.tsx
+++ b/frontend-modern/src/features/alerts/tabs/ThresholdsTab.tsx
@@ -1,4 +1,4 @@
-import { createMemo, createSignal, For, Show } from 'solid-js';
+import { createSignal, For, Show } from 'solid-js';
import { Card } from '@/components/shared/Card';
import { ThresholdsTable } from '@/components/Alerts/ThresholdsTable';
import {
@@ -24,22 +24,42 @@ export function ThresholdsTab(props: ThresholdsTabProps) {
};
const evaluationProfiles = [
- { key: 'all', label: 'All resources' },
- { key: 'vm', label: 'Virtual machines' },
- { key: 'app-container', label: 'Application containers' },
- { key: 'node', label: 'Infrastructure nodes' },
- { key: 'agent', label: 'Pulse agents' },
- { key: 'k8s-node', label: 'Kubernetes nodes' },
- { key: 'truenas-system', label: 'TrueNAS systems' },
- { key: 'vmware-host', label: 'VMware hosts' },
- { key: 'pbs', label: 'Proxmox Backup Servers' },
+ { key: 'all', label: 'All resources', inheritsFrom: [] },
+ { key: 'guest', label: 'All workloads', inheritsFrom: ['all'] },
+ { key: 'vm', label: 'Virtual machines', inheritsFrom: ['guest', 'all'] },
+ {
+ key: 'app-container',
+ label: 'Application containers',
+ inheritsFrom: ['guest', 'all'],
+ },
+ { key: 'node', label: 'Infrastructure nodes', inheritsFrom: ['all'] },
+ { key: 'agent', label: 'Pulse agents', inheritsFrom: ['node', 'all'] },
+ { key: 'k8s-node', label: 'Kubernetes nodes', inheritsFrom: ['node', 'all'] },
+ {
+ key: 'truenas-system',
+ label: 'TrueNAS systems',
+ inheritsFrom: ['agent', 'node', 'all'],
+ },
+ {
+ key: 'vmware-host',
+ label: 'VMware hosts',
+ inheritsFrom: ['agent', 'node', 'all'],
+ },
+ { key: 'pbs', label: 'Proxmox Backup Servers', inheritsFrom: ['node', 'all'] },
] as const;
- const globalCPUWindow = createMemo(() => props.metricEvaluationWindows?.().all?.cpu ?? 300);
const evaluationLabel = (seconds: number) => {
if (seconds === 0) return 'Current value';
if (seconds < 60) return `${seconds} seconds`;
return `${seconds / 60} minute${seconds === 60 ? '' : 's'}`;
};
+ const inheritedCPUWindow = (profile: (typeof evaluationProfiles)[number]) => {
+ const windows = props.metricEvaluationWindows?.() ?? {};
+ for (const parent of profile.inheritsFrom) {
+ const configured = windows[parent]?.cpu;
+ if (configured !== undefined) return configured;
+ }
+ return 300;
+ };
const updateCPUWindow = (profile: string, rawValue: string) => {
if (!props.setMetricEvaluationWindows) return;
props.setMetricEvaluationWindows((previous) => {
@@ -76,7 +96,9 @@ export function ThresholdsTab(props: ThresholdsTabProps) {
onInput={(event) => updateCPUWindow(profile.key, event.currentTarget.value)}
>
<Show when={profile.key !== 'all'}>
- <option value="inherit">Inherit ({evaluationLabel(globalCPUWindow())})</option>
+ <option value="inherit">
+ Inherit ({evaluationLabel(inheritedCPUWindow(profile))})
+ </option>
</Show>
<option value="0">Current value</option>
<option value="60">1 minute average</option>
diff --git a/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts b/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts
index 62d53ed297..825e1f35fe 100644
--- a/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts
+++ b/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts
@@ -850,6 +850,8 @@ describe('default schedule helpers', () => {
expect(createDefaultEscalation()).toEqual({
enabled: false,
levels: [],
+ repeatCritical: false,
+ repeatEvery: 30,
});
});
});
diff --git a/internal/unifiedresources/code_standards_test.go b/internal/unifiedresources/code_standards_test.go
index 2507a25ad1..dbd3915aba 100644
--- a/internal/unifiedresources/code_standards_test.go
+++ b/internal/unifiedresources/code_standards_test.go
@@ -867,7 +867,7 @@ func TestCephPoolsProjectThroughCanonicalStoragePath(t *testing.T) {
"m.checkCephPoolStorage(cluster)",
"models.CephPoolStorage(cluster)",
`m.metricsStore.Write("storage", storage.ID, "usage", storage.Usage, timestamp)`,
- "m.alertManager.CheckStorage(storage)",
+ "m.alertManager.CheckStorageWithCapacityTrend(storage, m.storageCapacityTrend(storage, timestamp))",
},
}