mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-04 05:07:30 +00:00
8fff04eac5
The deterministic capacity forecast queried utilization history using the canonical resource ID (storage-<hash>), but the monitoring layer records metrics under the metrics-target/source ID (MetricsTarget.ResourceID). For most storage sources these two IDs diverge, so the forecast query always found nothing and the feature stayed dormant even for pools with full ingestion history (Proxmox, TrueNAS, PBS, agent-backed storage). This splits the two ID roles in the precompute path: a new metricsID field on patrolStoragePoolRow / patrolPrecomputeStorageSource carries the metrics-target ID (resolved from SourceID() in the readState branch, or MetricsTarget.ResourceID in the unified-resource branch) for history queries, while the canonical id is still used for stamp-matching findings. Adds a test proving the forecast fires when history exists only under the metrics-target ID and that the resulting forecast resourceID stays canonical so StampCapacityForecasts can still match it. Contract (ai-runtime): the forecast must query history under the metrics-target ID (StoragePoolView.SourceID()), not the canonical ID; the forecast's own resourceID stays canonical for stamp-matching. Refs lane: protection-posture-attention-queue