From b6ff47fea89411ad4783da52b32269d123662c95 Mon Sep 17 00:00:00 2001 From: Michael Chus Date: Sat, 28 Feb 2026 15:16:04 +0300 Subject: [PATCH] collector/redfish: skip deep DIMM subresources and remove memory from critical warmup --- internal/collector/redfish.go | 10 +++++++++- internal/collector/redfish_test.go | 12 ++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/internal/collector/redfish.go b/internal/collector/redfish.go index 27c5da3..78c2607 100644 --- a/internal/collector/redfish.go +++ b/internal/collector/redfish.go @@ -969,7 +969,6 @@ func redfishCriticalEndpoints(systemPaths, chassisPaths, managerPaths []string) add(joinPath(p, "/Oem/Public/ThermalConfig")) add(joinPath(p, "/ThermalConfig")) add(joinPath(p, "/Processors")) - add(joinPath(p, "/Memory")) add(joinPath(p, "/Storage")) add(joinPath(p, "/SimpleStorage")) add(joinPath(p, "/PCIeDevices")) @@ -1157,6 +1156,15 @@ func shouldCrawlPath(path string) bool { if path == "" { return false } + normalized := normalizeRedfishPath(path) + if strings.Contains(normalized, "/Memory/") { + after := strings.SplitN(normalized, "/Memory/", 2) + if len(after) == 2 && strings.Count(after[1], "/") >= 1 { + // Keep direct DIMM resources (/Memory/) but skip nested subresources + // like /Memory//Assembly and /Memory//MemoryMetrics. + return false + } + } heavyParts := []string{ "/JsonSchemas", "/LogServices/", diff --git a/internal/collector/redfish_test.go b/internal/collector/redfish_test.go index 5ee923f..649075f 100644 --- a/internal/collector/redfish_test.go +++ b/internal/collector/redfish_test.go @@ -768,3 +768,15 @@ func TestReplayCollectGPUs_DropsModelOnlyPlaceholderWhenConcreteDiscoveredLater( t.Fatalf("expected concrete PCIe GPU to remain, got slot=%q", got[0].Slot) } } + +func TestShouldCrawlPath_MemorySubresourcesAreSkipped(t *testing.T) { + if !shouldCrawlPath("/redfish/v1/Systems/1/Memory/CPU0_C0D0") { + t.Fatalf("expected direct DIMM resource to be crawlable") + } + if shouldCrawlPath("/redfish/v1/Systems/1/Memory/CPU0_C0D0/Assembly") { + t.Fatalf("expected DIMM assembly subresource to be skipped") + } + if shouldCrawlPath("/redfish/v1/Systems/1/Memory/CPU0_C0D0/MemoryMetrics") { + t.Fatalf("expected DIMM metrics subresource to be skipped") + } +}