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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Show alert history rows without repeating the resource
rcourtman685d0369e394
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.mdindex a79aea2f2a..552c227134 100644--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md@@ -1770,6 +1770,10 @@ new host-agent removal or installed re-enrolment qualification.The shared security-status route may expose the validated caller currentUsername to authenticated clients, including organisation-scoped local sessions. This presentation identity is not an agent credential, enrollment grant or command authority; agent download, enrollment and token-scope checks remain independent of this field.+`models.Alert` in `internal/models/models.go` gains an optional `Summary`+beside `Message`, presentation copy for alert rows; it carries no agent+identity, enrollment, token or command authority.+`internal/models/models.go` and `internal/monitoring/monitor.go` also carrymonitoring-owned Proxmox cluster node identity and membership-confirmationstate. Provider instances with equal cluster/member display names must notdiff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.mdindex 8b1187b81a..93db1538ba 100644--- a/docs/release-control/v6/internal/subsystems/alerts.md+++ b/docs/release-control/v6/internal/subsystems/alerts.md@@ -1761,6 +1761,19 @@ Investigate icon (accessible names and titles say what each opens; cards keepthe worded buttons), so the three actions need 100px instead of 177px, andStatus uses a compact 11px badge that needs 108px for "moved to agent"instead of 119px. Resource and Message take that width.+An alert may carry `Summary`, its message without the subject the row's+Resource cell already names ("Running 1 of 3 desired tasks" for "Docker+service 'web' is running 1 of 3 desired tasks", "Offline", "Powered off").+Builders set it beside `Message` where they name their own resource: Docker+service gap and update state, Docker host offline, Docker container state,+health, restart loop, OOM kill, memory limit and image update, node, PBS and+PMG offline, guest powered off, Pulse agent stopped reporting, storage+unavailable, connection state and external probe silence. Both canonical+lifecycle evaluators copy it into the alert they build, so it changes with+the message; a `MessageBuilder` clears it because a built message has no+matching summary. History rows lead with `Summary` and keep the full message+in their title; cards, notifications and detail views keep the message, and+history recorded before alerts carried a summary shows its message.Below a 50rem card, Resource and Message cells wrap inside a `line-clamp-2`wrapper (`data-alert-history-cell`) instead of ending in an ellipsis after oneline, so more of what happened reads without hover. A message or name longerdiff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex eb5f1c89ad..2105bc04c3 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -1067,6 +1067,11 @@ websocket) may also carry an optional `resolution` (`reason`,`successorResourceId`, `successorName`, and on state payloads the alertengine's `summary`), typed once as `AlertResolution` in`frontend-modern/src/types/api.ts`. Its absence means an ordinary recovery.+Separately, an alert payload may carry a top-level optional `summary`: the+message without the subject its resource name already gives ("Offline").+It is presentation copy for rows that show the resource, not a resolution+account; `message` stays the full sentence, and clients without a summary+show `message`.## Shared Boundariesdiff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex d88b3b3569..4e16d71dcd 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -6728,7 +6728,9 @@ windowing hook's single measured row assumes, and from a 50rem card bothcells return to a one-line clamp (`@min-[50rem]:line-clamp-1`): icon-onlyTimeline/Resource row actions (100px instead of 177px) and a compact Statusbadge (108px instead of 119px) give Resource and Message the width that one-line needs.+line needs. A table row asks `getAlertHistoryRowCopy` for the subject-free+copy, so Message leads with the alert's `summary` ("Offline") when it has+one and keeps the full sentence as its title; cards keep the sentence.Alert History investigation detail is also responsive by interaction model,not only by CSS. Desktop may keep Timeline and Resource incident detail inlinewith its table row, while the virtualized phone card list must open the shareddiff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.mdindex ba0ab40318..2a5d55b0c4 100644--- a/docs/release-control/v6/internal/subsystems/monitoring.md+++ b/docs/release-control/v6/internal/subsystems/monitoring.md@@ -4184,7 +4184,10 @@ service-history reads plus denial/recovery without fabricated samples.contract together. Monitoring may pass the current unified-resource snapshotinto the alert manager, but threshold selection, override identity, activealert state, and notification delivery remain alerts-owned. The monitoring- sync bridge must not introduce per-platform evaluator branches.+ sync bridge must not introduce per-platform evaluator branches. It copies+ the alert's `Summary` beside `Message` into `models.Alert`, as the mock+ fixture graph does for its active alerts, so state snapshots carry the+ subject-free copy the history table shows.20. Add or change PBS API transport, optional node identity collection, or PBSHTTP retry classification through `pkg/pbs/client.go`. HTTP status decisionsmust use the concrete client error status rather than rendered error or bodydiff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.mdindex 9876cf3c11..bd4e765986 100644--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md@@ -4032,7 +4032,9 @@ under the same graph lock and advance the fixture data version withoutrebuilding the estate. `internal/mock/alert_incidents_test.go` proves boundedresource results and defensive-copy isolation, while`internal/api/alerting/alerts_test.go` proves that mock transport does not need-the production incident store.+the production incident store. Converting the graph's active alerts to+`models.Alert` copies `Summary` beside `Message` as one more string field; it+adds no lookup, allocation per row beyond that string, or transport request.Synthetic linked-host machine identities and Docker machine/agent identitiesare derived from stable fixture host identity when constructing the graph.diff --git a/frontend-modern/browser-verification/379df89f5d6e7499.json b/frontend-modern/browser-verification/379df89f5d6e7499.jsonnew file mode 100644index 0000000000..8d3afbd414--- /dev/null+++ b/frontend-modern/browser-verification/379df89f5d6e7499.json@@ -0,0 +1,52 @@+{+ "version": 1,+ "base_sha": "af5b66dad87727b21e27d5d1bd6842b4c9fe9448",+ "verified_at": "2026-10-25T23:44:31Z",+ "result": "passed",+ "changed_paths": [+ "frontend-modern/src/features/alerts/AlertHistoryTableAlertRow.tsx",+ "frontend-modern/src/features/alerts/alertHistoryModel.ts",+ "frontend-modern/src/types/api.ts"+ ],+ "content_sha256": {+ "frontend-modern/src/features/alerts/AlertHistoryTableAlertRow.tsx": "55f2851bb35b84307c757c3ff25d5677d74c707205ca1e1b3572a2e4dc58bfa1",+ "frontend-modern/src/features/alerts/alertHistoryModel.ts": "fe7d4de436f7b65bd806a25f45fa676b90d6d53ecbd0129b0360a894f0b5876e",+ "frontend-modern/src/types/api.ts": "4c1fe0c17b19bfc5e03e4a23f82bff7a36c329cc8532e1beba51eda17ba60ecb"+ },+ "routes": [+ "/alerts/history"+ ],+ "viewports": [+ {+ "width": 1920,+ "height": 900+ },+ {+ "width": 1440,+ "height": 900+ },+ {+ "width": 1366,+ "height": 900+ },+ {+ "width": 1280,+ "height": 900+ },+ {+ "width": 390,+ "height": 844+ }+ ],+ "states": [+ "Embedded production build of this tree (Go engine and frontend) in mock mode on pulse-dev, headless Chromium, dark theme, Alert History on All time (~133 rows). Active and resolved alerts come through the real alert engine, the resolved read model and the monitoring state sync.",+ "Before (main with single-line history): Docker service rows read \"Docker service 'ops-postgres' i...\" at 1280px; Message cut 54-62 of ~132 rows at 1280px and 24-32 at 1440px across runs. After: 17 rows lead with their summary (\"Paused\", \"Health is unhealthy\", \"Running 1 of 4 desired tasks\", \"Offline\", \"Unavailable on node pve22\"), none of them cut, and no row still restates its resource; Message cut 37 of 133 at 1280px and 17 at 1440px. Every row stays 33px.",+ "The message cell title keeps the full sentence (\"Docker service 'ops-radarr' is running 1 of 2 desired tasks\"). Rows still cut: the PMG queue message (MessageBuilder, no summary), ZFS error counts, and \"Disk health check failed: FAILED\" with the Linux fallback font.",+ "Phone 390px card list is unchanged and keeps the full message."+ ],+ "interactions": [+ "Inspected the 1280px screenshot; counted cells whose text differs from the title (summaries) and measured text against the cell width with the rendered font.",+ "go build ./..., go vet and go test for internal/alerts, internal/models, internal/mock and the monitoring alert tests pass; the full frontend suite passed except one source-pinned guardrail, updated for the subject-free call, and the alerts and pages suites (88 files) then pass."+ ],+ "proof_scope": "Alert Summary presentation in Alert History rows; alert evaluation, messages, notifications, cards and stored history are unchanged."+}diff --git a/frontend-modern/src/features/alerts/AlertHistoryTableAlertRow.tsx b/frontend-modern/src/features/alerts/AlertHistoryTableAlertRow.tsxindex 2596c70512..3c45699b24 100644--- a/frontend-modern/src/features/alerts/AlertHistoryTableAlertRow.tsx+++ b/frontend-modern/src/features/alerts/AlertHistoryTableAlertRow.tsx@@ -42,7 +42,7 @@ export function AlertHistoryTableAlertRow(props: AlertHistoryTableAlertRowProps)// An open threshold alert's live reading turns stale when evaluations stop,// so it rechecks on the shared clock; the last breach moves to the hover.const now = useRelativeTimeNow();- const descriptionCopy = () => getAlertHistoryRowCopy(props.alert, now);+ const descriptionCopy = () => getAlertHistoryRowCopy(props.alert, now, { subjectFree: true });return (<>diff --git a/frontend-modern/src/features/alerts/__tests__/AlertHistoryTableAlertRow.test.tsx b/frontend-modern/src/features/alerts/__tests__/AlertHistoryTableAlertRow.test.tsxindex 14433f0bf1..68536743b7 100644--- a/frontend-modern/src/features/alerts/__tests__/AlertHistoryTableAlertRow.test.tsx+++ b/frontend-modern/src/features/alerts/__tests__/AlertHistoryTableAlertRow.test.tsx@@ -166,6 +166,22 @@ describe('AlertHistoryTableAlertRow', () => {// Worded Timeline and Resource buttons took 177px with Investigate; as 24px// icons beside it the actions need about 100px, which Message and Resource// take so a row reads on one line. Names and titles still say what each opens.+ it('leads the message cell with the summary and keeps the sentence in its title', () => {+ renderRow(+ historyItem({+ resourceName: 'web',+ description: "Docker service 'web' is running 2 of 4 desired tasks",+ summary: 'Running 2 of 4 desired tasks',+ }),+ );+ const message = screen.getByText('Running 2 of 4 desired tasks');+ expect(message.dataset.alertHistoryCell).toBe('message');+ expect(message).toHaveAttribute(+ 'title',+ "Docker service 'web' is running 2 of 4 desired tasks",+ );+ });+it('shows the row actions as named icon buttons on one line', () => {const { container } = renderRow(historyItem({}));const timeline = container.querySelector('[data-alert-history-action="timeline"]');diff --git a/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.test.ts b/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.test.tsindex 7f62e0a08c..839ca63cd1 100644--- a/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.test.ts+++ b/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.test.ts@@ -244,6 +244,33 @@ describe('alert history rows for held threshold alerts', () => {});});+ // A table row already names the resource, so it leads with the alert's+ // summary and keeps the full sentence as the title; cards keep the sentence.+ it('leads a table row with the subject-free summary and keeps the message on hover', () => {+ const closed = {+ ...heldAlert(),+ id: 'docker-service-health-svc-web',+ type: 'docker-service-health',+ resourceName: 'web',+ message: "Docker service 'web' is running 2 of 4 desired tasks",+ summary: 'Running 2 of 4 desired tasks',+ } as Alert;+ const [item] = build({}, [closed]);+ expect(item.summary).toBe('Running 2 of 4 desired tasks');+ expect(getAlertHistoryRowCopy(item, () => NOW, { subjectFree: true })).toEqual({+ text: 'Running 2 of 4 desired tasks',+ title: "Docker service 'web' is running 2 of 4 desired tasks",+ });+ expect(getAlertHistoryRowCopy(item, () => NOW).text).toBe(+ "Docker service 'web' is running 2 of 4 desired tasks",+ );+ // History recorded before alerts carried a summary keeps its message.+ const [legacy] = build({}, [{ ...closed, summary: undefined } as Alert]);+ expect(getAlertHistoryRowCopy(legacy, () => NOW, { subjectFree: true }).text).toBe(+ "Docker service 'web' is running 2 of 4 desired tasks",+ );+ });+it('gives Pulse system alerts no live reading', () => {const alert = {...heldAlert({ phase: 'latched', value: 78 }),diff --git a/frontend-modern/src/features/alerts/alertHistoryModel.ts b/frontend-modern/src/features/alerts/alertHistoryModel.tsindex cd58b23e42..5caa68f4ac 100644--- a/frontend-modern/src/features/alerts/alertHistoryModel.ts+++ b/frontend-modern/src/features/alerts/alertHistoryModel.ts@@ -30,6 +30,9 @@ export interface HistoryItem {title: string;rawAlertType?: string;description?: string;+ // The description without its subject ("Running 1 of 3 desired tasks"), for+ // a table row whose Resource cell already names it.+ summary?: string;// Set when the alert closed without recovering: what happened instead.closeDetail?: string;acknowledged?: boolean;@@ -243,6 +246,7 @@ export function buildAlertHistoryItems({title: alertTypeDisplayLabel(alert.type),rawAlertType: alert.type,description: alert.message,+ ...(alert.summary ? { summary: alert.summary } : {}),acknowledged: false,...(systemScoped ? {} : { liveAlert: alert }),});@@ -283,6 +287,7 @@ export function buildAlertHistoryItems({title: alertTypeDisplayLabel(alert.type),rawAlertType: alert.type,description: alert.message,+ ...(alert.summary ? { summary: alert.summary } : {}),...(closeDetail ? { closeDetail } : {}),acknowledged: alert.acknowledged,});@@ -297,13 +302,20 @@ export function buildAlertHistoryItems({// Closed rows, and open ones without a live status, keep the recorded message,// which search also reads. The clock is read only for open rows, so closed rows// do not re-render on every tick.+// A table row passes `subjectFree` because its Resource cell already names the+// resource: it leads with the alert's summary ("Offline") when the message has+// one, and keeps the full message as the title. Cards keep the full message.export function getAlertHistoryRowCopy(- item: Pick<HistoryItem, 'description' | 'liveAlert'>,+ item: Pick<HistoryItem, 'description' | 'liveAlert' | 'summary'>,now: () => number = Date.now,+ options: { subjectFree?: boolean } = {},): AlertHistoryRowCopy {const recorded = item.description ?? '';const presentation = item.liveAlert ? getMetricAlertPresentation(item.liveAlert, now()) : null;- if (!presentation) return { text: recorded, title: recorded };+ if (!presentation) {+ const summary = options.subjectFree ? item.summary?.trim() : undefined;+ return { text: summary || recorded, title: recorded };+ }return {text: presentation.summary,detail: presentation.detail,diff --git a/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts b/frontend-modern/src/pages/__tests__/Alerts.helpers.test.tsindex 1ece757029..04ea9ad7a8 100644--- a/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts+++ b/frontend-modern/src/pages/__tests__/Alerts.helpers.test.ts@@ -560,8 +560,11 @@ describe('tab path helpers', () => {expect(alertHistoryTableAlertRowSource).toContain('IncidentTimelinePanel');expect(alertHistoryTableAlertRowSource).toContain('AlertHistoryItemActions');// An open threshold alert's row leads with its live reading, not the- // breach message it opened with (#2068).- expect(alertHistoryTableAlertRowSource).toContain('getAlertHistoryRowCopy(props.alert, now)');+ // breach message it opened with (#2068); other rows lead with the alert's+ // subject-free summary because the Resource cell already names it.+ expect(alertHistoryTableAlertRowSource).toContain(+ 'getAlertHistoryRowCopy(props.alert, now, { subjectFree: true })',+ );expect(alertHistoryTableAlertRowSource).not.toContain('{props.alert.description}');expect(alertHistoryItemActionsSource).toContain('InvestigateAlertButton');expect(alertHistoryAdministrationCardSource).toContain(diff --git a/frontend-modern/src/types/api.ts b/frontend-modern/src/types/api.tsindex 52e7fbaafa..2c07e4991d 100644--- a/frontend-modern/src/types/api.ts+++ b/frontend-modern/src/types/api.ts@@ -1376,6 +1376,8 @@ export interface Alert {nodeDisplayName?: string;instance: string;message: string;+ /** The message without its subject, for rows that already name the resource. */+ summary?: string;value: number;threshold: number;startTime: string;diff --git a/internal/alerts/alerts_test.go b/internal/alerts/alerts_test.goindex 9de52c5154..2eefd16b0c 100644--- a/internal/alerts/alerts_test.go+++ b/internal/alerts/alerts_test.go@@ -1271,6 +1271,9 @@ func TestHandleHostOfflineNamesSilentAgentNotHostOutage(t *testing.T) {if want := "Pulse agent on 'delly' stopped reporting"; alert.Message != want {t.Fatalf("message = %q, want %q", alert.Message, want)}+ if want := "Pulse agent stopped reporting"; alert.Summary != want {+ t.Fatalf("summary = %q, want %q", alert.Summary, want)+ }if want := "delly (Host Agent)"; alert.ResourceName != want {t.Fatalf("resource name = %q, want %q", alert.ResourceName, want)}@@ -3140,6 +3143,14 @@ func TestDockerServiceReplicaAlerts(t *testing.T) {if missing, ok := alert.Metadata["missingTasks"].(int); !ok || missing != 2 {t.Fatalf("expected missingTasks metadata to be 2, got %v", alert.Metadata["missingTasks"])}+ // The message names the service for notifications; the summary is the+ // condition alone for rows whose Resource cell already names it.+ if want := "Docker service 'web' is running 2 of 4 desired tasks"; alert.Message != want {+ t.Fatalf("message = %q, want %q", alert.Message, want)+ }+ if want := "Running 2 of 4 desired tasks"; alert.Summary != want {+ t.Fatalf("summary = %q, want %q", alert.Summary, want)+ }// Resolve by restoring replicashost.Services[0].RunningTasks = 4@@ -3148,6 +3159,20 @@ func TestDockerServiceReplicaAlerts(t *testing.T) {if testHasActiveAlert(t, m, alertID) {t.Fatalf("expected service alert %s to be cleared when replicas restored", alertID)}+ // The resolved read model carries the summary to the history table.+ foundResolved := false+ for _, resolved := range m.GetRecentlyResolved() {+ if resolved.Alert.ResourceID != resourceID {+ continue+ }+ foundResolved = true+ if want := "Running 2 of 4 desired tasks"; resolved.Alert.Summary != want {+ t.Fatalf("resolved summary = %q, want %q", resolved.Alert.Summary, want)+ }+ }+ if !foundResolved {+ t.Fatalf("expected service alert %s in recently resolved", alertID)+ }}func TestDockerServiceAlertDoesNotRenotifyWhenUnchanged(t *testing.T) {@@ -3347,6 +3372,9 @@ func TestDockerServiceUpdateStateAlert(t *testing.T) {if state, ok := alert.Metadata["updateState"].(string); !ok || state != "rollback_failed" {t.Fatalf("expected updateState metadata to be rollback_failed, got %v", alert.Metadata["updateState"])}+ if want := "Update state: rollback_failed (Rollback failed)"; alert.Summary != want {+ t.Fatalf("summary = %q, want %q", alert.Summary, want)+ }}func TestDockerContainerStateUsesDockerDefaults(t *testing.T) {@@ -23078,3 +23106,17 @@ func TestZFSAlertsNameTheirStorage(t *testing.T) {}}}++func TestCapitalizeFirstMakesAStandaloneSummary(t *testing.T) {+ for in, want := range map[string]string{+ "": "",+ "paused": "Paused",+ "Exited (137)": "Exited (137)",+ "unreachable": "Unreachable",+ "élan": "Élan",+ } {+ if got := capitalizeFirst(in); got != want {+ t.Fatalf("capitalizeFirst(%q) = %q, want %q", in, got, want)+ }+ }+}diff --git a/internal/alerts/canonical_lifecycle.go b/internal/alerts/canonical_lifecycle.goindex f4a7c614f4..71ddebe860 100644--- a/internal/alerts/canonical_lifecycle.go+++ b/internal/alerts/canonical_lifecycle.go@@ -13,17 +13,19 @@ import ()type canonicalLifecycleAlertParams struct {- Spec alertspecs.ResourceAlertSpec- Evidence alertspecs.AlertEvidence- IntentSignal string- PolicyDisabledNoLock func() bool- AlertID string- AlertType string- ResourceID string- ResourceName string- Node string- Instance string- Message string+ Spec alertspecs.ResourceAlertSpec+ Evidence alertspecs.AlertEvidence+ IntentSignal string+ PolicyDisabledNoLock func() bool+ AlertID string+ AlertType string+ ResourceID string+ ResourceName string+ Node string+ Instance string+ Message string+ // Summary is Message without its subject; see Alert.Summary.+ Summary stringValue float64Threshold float64Correlation *AlertCorrelation@@ -38,16 +40,18 @@ type canonicalLifecycleAlertParams struct {}type canonicalStatefulAlertParams struct {- Spec alertspecs.ResourceAlertSpec- Evidence alertspecs.AlertEvidence- RecoveryConfirmations int- AlertID string- AlertType string- ResourceID string- ResourceName string- Node string- Instance string- Message string+ Spec alertspecs.ResourceAlertSpec+ Evidence alertspecs.AlertEvidence+ RecoveryConfirmations int+ AlertID string+ AlertType string+ ResourceID string+ ResourceName string+ Node string+ Instance string+ Message string+ // Summary is Message without its subject; see Alert.Summary.+ Summary stringValue float64Threshold float64StartTimeOverride time.Time@@ -468,6 +472,7 @@ func (m *Manager) evaluateCanonicalLifecycleAlert(params canonicalLifecycleAlertNode: params.Node,Instance: params.Instance,Message: params.Message,+ Summary: params.Summary,Value: params.Value,Threshold: params.Threshold,StartTime: incident.StartedAt,@@ -737,10 +742,13 @@ func (m *Manager) evaluateCanonicalStatefulAlert(params canonicalStatefulAlertParesult.Transition = transition(alertspecs.EvaluationTransitionSeverityChanged, alertspecs.AlertStateFiring, alertspecs.AlertStateFiring)}message := params.Message+ summary := params.Summaryvalue := params.Valuethreshold := params.Thresholdif params.MessageBuilder != nil {message, value, threshold = params.MessageBuilder(result)+ // A built message has no matching summary; rows show it whole.+ summary = ""}// The stateful family stamps occurrences at the observation (or the// caller's override, e.g. a backup timestamp), not the pending run@@ -758,6 +766,7 @@ func (m *Manager) evaluateCanonicalStatefulAlert(params canonicalStatefulAlertPaNode: params.Node,Instance: params.Instance,Message: message,+ Summary: summary,Value: value,Threshold: threshold,StartTime: startTime,diff --git a/internal/alerts/canonical_stateful_test.go b/internal/alerts/canonical_stateful_test.goindex d5e7118854..2588272c9c 100644--- a/internal/alerts/canonical_stateful_test.go+++ b/internal/alerts/canonical_stateful_test.go@@ -759,3 +759,57 @@ func TestRestoredBackupRevalidationPreservesQuietHoursReplay(t *testing.T) {t.Fatal("revalidated backup did not enter normal quiet-hours delivery")}}++// Summary is the message without its subject. It travels with the message+// through both canonical evaluators, and a built message clears it because no+// summary matches text composed at evaluation time.+func TestCanonicalEvaluatorsCarrySummaryWithMessage(t *testing.T) {+ m := newTestManager(t)+ spec, err := buildCanonicalConnectivitySpec("node-1", "Node 1", unifiedresources.ResourceType("node"), AlertLevelCritical, 1, false)+ if err != nil {+ t.Fatalf("build connectivity spec: %v", err)+ }+ if _, ok := m.evaluateCanonicalLifecycleAlert(canonicalLifecycleAlertParams{+ Spec: spec,+ Evidence: alertspecs.AlertEvidence{ObservedAt: time.Now(), Connectivity: &alertspecs.ConnectivityEvidence{Signal: "status", Connected: false}},+ AlertID: canonicalConnectivityStateID("node-1"),+ AlertType: "connectivity",+ ResourceID: "node-1",+ ResourceName: "Node 1",+ Message: "Node 'Node 1' is offline",+ Summary: "Offline",+ }); !ok {+ t.Fatal("expected canonical lifecycle evaluation")+ }+ alert := testRequireActiveAlert(t, m, canonicalConnectivityStateID("node-1"))+ if alert.Message != "Node 'Node 1' is offline" || alert.Summary != "Offline" {+ t.Fatalf("lifecycle alert message/summary = %q / %q", alert.Message, alert.Summary)+ }++ gapSpec, err := buildCanonicalServiceGapSpec("svc-1", "web", unifiedresources.ResourceTypeDockerService, "web", 10, 50, false)+ if err != nil {+ t.Fatalf("build service gap spec: %v", err)+ }+ if _, ok := m.evaluateCanonicalStatefulAlert(canonicalStatefulAlertParams{+ Spec: gapSpec,+ Evidence: alertspecs.AlertEvidence{+ ObservedAt: time.Now(),+ ServiceGap: &alertspecs.ServiceGapEvidence{Service: "web", Desired: 4, Running: 1},+ },+ AlertID: "docker-service-health-svc-1",+ AlertType: "docker-service-health",+ ResourceID: "svc-1",+ ResourceName: "web",+ Message: "Docker service 'web' is running 1 of 4 desired tasks",+ Summary: "Running 1 of 4 desired tasks",+ MessageBuilder: func(alertspecs.EvaluationResult) (string, float64, float64) {+ return "built message", 75, 50+ },+ }); !ok {+ t.Fatal("expected canonical stateful evaluation")+ }+ built := testRequireActiveAlert(t, m, "docker-service-health-svc-1")+ if built.Message != "built message" || built.Summary != "" {+ t.Fatalf("built alert message/summary = %q / %q, want built message and no summary", built.Message, built.Summary)+ }+}diff --git a/internal/alerts/connection.go b/internal/alerts/connection.goindex 8772531d51..4d3fc7ccc7 100644--- a/internal/alerts/connection.go+++ b/internal/alerts/connection.go@@ -248,6 +248,7 @@ func (m *Manager) CheckConnection(snap ConnectionSnapshot) {reason := strings.TrimSpace(snap.StateReason)message := fmt.Sprintf("Connection '%s' is %s", snap.Name, snap.State)+ summary := capitalizeFirst(string(snap.State))if reason != "" {message = fmt.Sprintf("%s: %s", message, reason)}@@ -306,6 +307,7 @@ func (m *Manager) CheckConnection(snap ConnectionSnapshot) {ResourceName: snap.Name,Instance: snap.Name,Message: message,+ Summary: summary,Correlation: correlation,Metadata: metadata,AddToRecent: true,diff --git a/internal/alerts/docker.go b/internal/alerts/docker.goindex df2d1f0512..723f67e2a9 100644--- a/internal/alerts/docker.go+++ b/internal/alerts/docker.go@@ -603,8 +603,10 @@ func (m *Manager) evaluateDockerService(host models.DockerHost, service models.D}message := fmt.Sprintf("Docker service '%s' update state: %s", serviceName, service.UpdateStatus.State)+ summary := fmt.Sprintf("Update state: %s", service.UpdateStatus.State)if updateMessage != "" {message = fmt.Sprintf("%s (%s)", message, updateMessage)+ summary = fmt.Sprintf("%s (%s)", summary, updateMessage)}_, _ = m.evaluateCanonicalStatefulAlert(canonicalStatefulAlertParams{@@ -617,6 +619,7 @@ func (m *Manager) evaluateDockerService(host models.DockerHost, service models.DNode: nodeName,Instance: instanceName,Message: message,+ Summary: summary,Value: percentMissing,Threshold: 0,Metadata: metadata,@@ -647,6 +650,7 @@ func (m *Manager) evaluateDockerService(host models.DockerHost, service models.D}message := fmt.Sprintf("Docker service '%s' is running %d of %d desired tasks", serviceName, service.RunningTasks, service.DesiredTasks)+ summary := fmt.Sprintf("Running %d of %d desired tasks", service.RunningTasks, service.DesiredTasks)_, _ = m.evaluateCanonicalStatefulAlert(canonicalStatefulAlertParams{Spec: spec,Evidence: alertspecs.AlertEvidence{@@ -664,6 +668,7 @@ func (m *Manager) evaluateDockerService(host models.DockerHost, service models.DNode: nodeName,Instance: instanceName,Message: message,+ Summary: summary,Value: percentMissing,Threshold: thresholdValue,Metadata: metadata,@@ -774,6 +779,7 @@ func (m *Manager) HandleDockerHostOffline(host models.DockerHost) {Node: nodeName,Instance: instanceName,Message: fmt.Sprintf("Docker host '%s' is offline", host.DisplayName),+ Summary: "Offline",Metadata: map[string]interface{}{"resourceType": "docker-host","hostId": host.ID,@@ -878,6 +884,7 @@ func (m *Manager) checkDockerContainerState(host models.DockerHost, container moNode: nodeName,Instance: instanceName,Message: fmt.Sprintf("Docker container '%s' is %s", containerName, strings.TrimSpace(container.Status)),+ Summary: capitalizeFirst(strings.TrimSpace(container.Status)),Metadata: dockerContainerAlertMetadata(host, container, containerName),AddToRecent: true,AddToHistory: true,@@ -981,6 +988,7 @@ func (m *Manager) checkDockerContainerHealth(host models.DockerHost, container mNode: nodeName,Instance: instanceName,Message: fmt.Sprintf("Docker container '%s' health is %s", containerName, container.Health),+ Summary: fmt.Sprintf("Health is %s", container.Health),Metadata: metadata,AddToRecent: true,AddToHistory: true,@@ -1087,6 +1095,7 @@ func (m *Manager) checkDockerContainerRestartLoop(host models.DockerHost, contaiNode: nodeName,Instance: instanceName,Message: fmt.Sprintf("Docker container '%s' has restarted %d times in the last %d minutes (restart loop detected)", containerName, recentCount, timeWindow/60),+ Summary: fmt.Sprintf("Restarted %d times in the last %d minutes (restart loop detected)", recentCount, timeWindow/60),Metadata: metadata,AddToRecent: true,AddToHistory: true,@@ -1143,6 +1152,7 @@ func (m *Manager) checkDockerContainerOOMKill(host models.DockerHost, containerNode: nodeName,Instance: instanceName,Message: fmt.Sprintf("Docker container '%s' was killed due to out of memory (OOM)", containerName),+ Summary: "Killed due to out of memory (OOM)",Metadata: metadata,AddToRecent: true,AddToHistory: true,@@ -1223,6 +1233,7 @@ func (m *Manager) checkDockerContainerMemoryLimit(host models.DockerHost, contaiNode: nodeName,Instance: instanceName,Message: fmt.Sprintf("Docker container '%s' is using %.1f%% of its memory limit (%d MB / %d MB)", containerName, limitPercent, container.MemoryUsage/(1024*1024), container.MemoryLimit/(1024*1024)),+ Summary: fmt.Sprintf("Using %.1f%% of its memory limit (%d MB / %d MB)", limitPercent, container.MemoryUsage/(1024*1024), container.MemoryLimit/(1024*1024)),Metadata: metadata,AddToRecent: true,AddToHistory: true,@@ -1515,6 +1526,7 @@ func (m *Manager) checkDockerContainerImageUpdate(host models.DockerHost, contaiNode: nodeName,Instance: instanceName,Message: fmt.Sprintf("Docker container '%s' has an image update available for %d hours", containerName, pendingHours),+ Summary: fmt.Sprintf("Image update available for %d hours", pendingHours),StartTimeOverride: firstSeen,Metadata: metadata,AddToRecent: true,diff --git a/internal/alerts/external_probe.go b/internal/alerts/external_probe.goindex d334212ea4..82aaf80e74 100644--- a/internal/alerts/external_probe.go+++ b/internal/alerts/external_probe.go@@ -162,6 +162,7 @@ func (m *Manager) checkExternalProbe(snapshot ExternalProbeSnapshot) {ResourceName: name,Instance: name,Message: message,+ Summary: "Stopped reporting availability results",Metadata: map[string]interface{}{"resourceType": string(unifiedresources.ResourceTypeAgent),"hostId": snapshot.AgentID,diff --git a/internal/alerts/guest.go b/internal/alerts/guest.goindex dacc37dcbc..f34beaa7cc 100644--- a/internal/alerts/guest.go+++ b/internal/alerts/guest.go@@ -545,6 +545,7 @@ func (m *Manager) checkGuestPoweredOffWithThresholdsAndIntentAndTags(guestID, naNode: node,Instance: instanceName,Message: fmt.Sprintf("%s '%s' is powered off", guestType, name),+ Summary: "Powered off",Metadata: metadata,AddToRecent: true,AddToHistory: true,diff --git a/internal/alerts/host.go b/internal/alerts/host.goindex 17f8094bc5..266435da81 100644--- a/internal/alerts/host.go+++ b/internal/alerts/host.go@@ -985,6 +985,7 @@ func (m *Manager) HandleHostOfflineWithCorrelation(host models.Host, correlation// be up (a linked Proxmox node keeps reporting through its API), so// the message names the missing reports, not a host outage.Message: fmt.Sprintf("Pulse agent on '%s' stopped reporting", hostBaseName(host)),+ Summary: "Pulse agent stopped reporting",Correlation: correlation,Metadata: map[string]interface{}{"resourceType": "agent",diff --git a/internal/alerts/model.go b/internal/alerts/model.goindex ba5cebaff5..0b12baaaa4 100644--- a/internal/alerts/model.go+++ b/internal/alerts/model.go@@ -3,6 +3,8 @@ package alertsimport ("strings""time"+ "unicode"+ "unicode/utf8""github.com/rcourtman/pulse-go-rewrite/internal/models""github.com/rcourtman/pulse-go-rewrite/internal/operationaltrust"@@ -117,18 +119,23 @@ func cloneAlertCorrelation(correlation *AlertCorrelation) *AlertCorrelation {// Alert represents an active alerttype Alert struct {- ID string `json:"id"`- Type string `json:"type"` // cpu, memory, disk, etc.- Level AlertLevel `json:"level"`- ResourceID string `json:"resourceId"` // guest or node ID- CanonicalSpecID string `json:"canonicalSpecId,omitempty"`- CanonicalKind string `json:"canonicalKind,omitempty"`- CanonicalState string `json:"canonicalState,omitempty"`- ResourceName string `json:"resourceName"`- Node string `json:"node"`- NodeDisplayName string `json:"nodeDisplayName,omitempty"`- Instance string `json:"instance"`- Message string `json:"message"`+ ID string `json:"id"`+ Type string `json:"type"` // cpu, memory, disk, etc.+ Level AlertLevel `json:"level"`+ ResourceID string `json:"resourceId"` // guest or node ID+ CanonicalSpecID string `json:"canonicalSpecId,omitempty"`+ CanonicalKind string `json:"canonicalKind,omitempty"`+ CanonicalState string `json:"canonicalState,omitempty"`+ ResourceName string `json:"resourceName"`+ Node string `json:"node"`+ NodeDisplayName string `json:"nodeDisplayName,omitempty"`+ Instance string `json:"instance"`+ Message string `json:"message"`+ // Summary is the condition without its subject ("Running 1 of 3 desired+ // tasks", "Offline") for rows that already name the resource. Empty when+ // the message has no separate subject; Message stays the full sentence for+ // notifications and detail views.+ Summary string `json:"summary,omitempty"`Value float64 `json:"value"`Threshold float64 `json:"threshold"`StartTime time.Time `json:"startTime"`@@ -276,3 +283,13 @@ type ResolvedAlert struct {*AlertResolvedTime time.Time `json:"resolvedTime"`}++// capitalizeFirst upper-cases a condition's first letter so it can stand alone+// as an alert Summary ("paused" reads "Paused"; "Exited (137)" is unchanged).+func capitalizeFirst(s string) string {+ if s == "" {+ return s+ }+ r, size := utf8.DecodeRuneInString(s)+ return string(unicode.ToUpper(r)) + s[size:]+}diff --git a/internal/alerts/node.go b/internal/alerts/node.goindex d187fd2da7..0f84693fa7 100644--- a/internal/alerts/node.go+++ b/internal/alerts/node.go@@ -278,6 +278,7 @@ func (m *Manager) checkNodeOffline(node models.Node) {Node: node.Name,Instance: node.Instance,Message: fmt.Sprintf("Node '%s' is offline", node.Name),+ Summary: "Offline",Correlation: correlation,Metadata: map[string]interface{}{"resourceType": "node",diff --git a/internal/alerts/pbs.go b/internal/alerts/pbs.goindex ab8e30d985..ff92a16987 100644--- a/internal/alerts/pbs.go+++ b/internal/alerts/pbs.go@@ -179,6 +179,7 @@ func (m *Manager) checkPBSOfflineWithThresholds(pbs models.PBSInstance, thresholNode: pbs.Host,Instance: pbs.Name,Message: fmt.Sprintf("PBS instance %s is offline", pbs.Name),+ Summary: "Offline",Metadata: map[string]interface{}{"resourceType": "pbs","status": pbs.Status,diff --git a/internal/alerts/pmg.go b/internal/alerts/pmg.goindex 49bbadb7cb..84e5ca1c72 100644--- a/internal/alerts/pmg.go+++ b/internal/alerts/pmg.go@@ -164,6 +164,7 @@ func (m *Manager) checkPMGOffline(pmg models.PMGInstance) {Node: pmg.Host,Instance: pmg.Name,Message: fmt.Sprintf("PMG instance %s is offline", pmg.Name),+ Summary: "Offline",Metadata: map[string]interface{}{"resourceType": "pmg","status": pmg.Status,diff --git a/internal/alerts/read_model.go b/internal/alerts/read_model.goindex d45f09e84b..a5ecac89ae 100644--- a/internal/alerts/read_model.go+++ b/internal/alerts/read_model.go@@ -314,6 +314,7 @@ func (m *Manager) GetRecentlyResolved() []models.ResolvedAlert {NodeDisplayName: nodeDisplayName,Instance: exported.Instance,Message: exported.Message,+ Summary: exported.Summary,Value: exported.Value,Threshold: exported.Threshold,StartTime: exported.StartTime,diff --git a/internal/alerts/storage.go b/internal/alerts/storage.goindex 6945a57cf5..ffd2a851b1 100644--- a/internal/alerts/storage.go+++ b/internal/alerts/storage.go@@ -471,6 +471,7 @@ func (m *Manager) checkStorageOffline(storage models.Storage) {Node: storage.Node,Instance: storage.Instance,Message: fmt.Sprintf("Storage %s on node %s is unavailable", storage.Name, storage.Node),+ Summary: fmt.Sprintf("Unavailable on node %s", storage.Node),Metadata: map[string]interface{}{"resourceType": "storage","status": storage.Status,diff --git a/internal/mock/fixture_graph.go b/internal/mock/fixture_graph.goindex 1f621d7689..1c97dd3470 100644--- a/internal/mock/fixture_graph.go+++ b/internal/mock/fixture_graph.go@@ -155,6 +155,7 @@ func (g *FixtureGraph) UpdateAlertSnapshots(active []alerts.Alert, resolved []moNode: alert.Node,Instance: alert.Instance,Message: alert.Message,+ Summary: alert.Summary,Value: alert.Value,Threshold: alert.Threshold,StartTime: alert.StartTime,diff --git a/internal/mock/integration_coverage_test.go b/internal/mock/integration_coverage_test.goindex 78d86354a5..689e2c2ab1 100644--- a/internal/mock/integration_coverage_test.go+++ b/internal/mock/integration_coverage_test.go@@ -459,6 +459,7 @@ func TestUpdateAlertSnapshotsAndHistoryAccessors(t *testing.T) {Node: "node-a",Instance: "pve-a",Message: "CPU critical",+ Summary: "Critical",Value: 97,Threshold: 90,StartTime: start,@@ -485,6 +486,10 @@ func TestUpdateAlertSnapshotsAndHistoryAccessors(t *testing.T) {dataMu.RUnlock()t.Fatalf("expected level conversion to string, got %q", snapshot.Level)}+ if snapshot.Summary != "Critical" {+ dataMu.RUnlock()+ t.Fatalf("active alert summary = %q, want the engine summary", snapshot.Summary)+ }if snapshot.ResourceID != "vm-100" || snapshot.Instance != "pve-a" || !snapshot.Acknowledged {dataMu.RUnlock()t.Fatalf("unexpected converted active alert snapshot: %+v", snapshot)diff --git a/internal/models/metrics_types_test.go b/internal/models/metrics_types_test.goindex a381fc6b03..ca0ec1a2c1 100644--- a/internal/models/metrics_types_test.go+++ b/internal/models/metrics_types_test.go@@ -594,3 +594,22 @@ func TestMetricAlertStatusBreachTimeWireAndClone(t *testing.T) {})}}++// Summary is optional presentation copy: present when the alert's message has+// a separate subject, omitted otherwise so older clients keep reading message.+func TestAlertSummaryIsOptionalJSON(t *testing.T) {+ withSummary, err := json.Marshal(Alert{ID: "a", Message: "Node 'pve1' is offline", Summary: "Offline"})+ if err != nil {+ t.Fatal(err)+ }+ if !strings.Contains(string(withSummary), `"summary":"Offline"`) {+ t.Fatalf("summary missing from %s", withSummary)+ }+ without, err := json.Marshal(Alert{ID: "b", Message: "CPU at 95%"})+ if err != nil {+ t.Fatal(err)+ }+ if strings.Contains(string(without), `"summary"`) {+ t.Fatalf("empty summary serialized in %s", without)+ }+}diff --git a/internal/models/models.go b/internal/models/models.goindex 0fc76815d7..9352cf9adb 100644--- a/internal/models/models.go+++ b/internal/models/models.go@@ -175,22 +175,25 @@ var (// Alert represents an active alert (simplified for State)type Alert struct {- ID string `json:"id"`- Type string `json:"type"`- Level string `json:"level"`- ResourceID string `json:"resourceId"`- ResourceName string `json:"resourceName"`- Node string `json:"node"`- NodeDisplayName string `json:"nodeDisplayName,omitempty"`- Instance string `json:"instance"`- Message string `json:"message"`- Value float64 `json:"value"`- Threshold float64 `json:"threshold"`- StartTime time.Time `json:"startTime"`- LastSeen *time.Time `json:"lastSeen,omitempty"`- Acknowledged bool `json:"acknowledged"`- AckTime *time.Time `json:"ackTime,omitempty"`- AckUser string `json:"ackUser,omitempty"`+ ID string `json:"id"`+ Type string `json:"type"`+ Level string `json:"level"`+ ResourceID string `json:"resourceId"`+ ResourceName string `json:"resourceName"`+ Node string `json:"node"`+ NodeDisplayName string `json:"nodeDisplayName,omitempty"`+ Instance string `json:"instance"`+ Message string `json:"message"`+ // Summary is Message without its subject, for rows that already name the+ // resource; empty when the message has no separate subject.+ Summary string `json:"summary,omitempty"`+ Value float64 `json:"value"`+ Threshold float64 `json:"threshold"`+ StartTime time.Time `json:"startTime"`+ LastSeen *time.Time `json:"lastSeen,omitempty"`+ Acknowledged bool `json:"acknowledged"`+ AckTime *time.Time `json:"ackTime,omitempty"`+ AckUser string `json:"ackUser,omitempty"`// MetricStatus is the live evaluation behind an open threshold alert.MetricStatus *MetricAlertStatus `json:"metricStatus,omitempty"`// Metadata carries alert-engine annotations (notably resourceType) so thediff --git a/internal/monitoring/monitor_alert_handling_test.go b/internal/monitoring/monitor_alert_handling_test.goindex d49bfc1b7f..6f68e3b4e1 100644--- a/internal/monitoring/monitor_alert_handling_test.go+++ b/internal/monitoring/monitor_alert_handling_test.go@@ -1922,3 +1922,31 @@ func TestProxmoxDiskAlertTimelineFollowsRecordedHardware(t *testing.T) {require.NoError(t, err)require.Empty(t, page.Incidents)}++// The state snapshot the frontend reads carries the alert's subject-free+// summary beside its full message.+func TestActiveAlertsSnapshotCarriesSubjectFreeSummary(t *testing.T) {+ manager := alerts.NewManagerWithDataDir(t.TempDir())+ t.Cleanup(manager.Stop)+ config := manager.GetConfig()+ config.Enabled = true+ config.ActivationState = alerts.ActivationPending+ config.TimeThresholds = map[string]int{}+ config.SuppressionWindow = 0+ manager.UpdateConfig(config)+ host := models.DockerHost{ID: "summary-host", Hostname: "summary-host", LastSeen: time.Now(), Containers: []models.DockerContainer{+ {ID: strings.Repeat("b", 64), Name: "worker", State: "running", Health: "unhealthy"},+ }}+ manager.CheckDockerHost(host)+ monitor := &Monitor{alertManager: manager}+ found := false+ for _, alert := range monitor.activeAlertsSnapshot() {+ if alert.Type != "docker-container-health" {+ continue+ }+ found = true+ require.Equal(t, "Docker container 'worker' health is unhealthy", alert.Message)+ require.Equal(t, "Health is unhealthy", alert.Summary)+ }+ require.True(t, found, "expected the container health alert in the state snapshot")+}diff --git a/internal/monitoring/monitor_alert_sync.go b/internal/monitoring/monitor_alert_sync.goindex eb55d9aa5d..7971ca78a8 100644--- a/internal/monitoring/monitor_alert_sync.go+++ b/internal/monitoring/monitor_alert_sync.go@@ -65,6 +65,7 @@ func (m *Monitor) activeAlertsSnapshot() []models.Alert {NodeDisplayName: alert.NodeDisplayName,Instance: alert.Instance,Message: alert.Message,+ Summary: alert.Summary,Value: alert.Value,Threshold: alert.Threshold,StartTime: alert.StartTime,