From 7336ec2d878231cdeb8ac3f24b435dc0f22a99bd Mon Sep 17 00:00:00 2001 From: rcourtman Date: Mon, 9 Feb 2026 22:33:24 +0000 Subject: [PATCH] fix(metrics): normalize docker resource type in metrics history API (#1229) Frontend sends resourceType="docker" but the SQLite store uses "dockerContainer". The /api/metrics-store/history handler now normalizes the alias so queries return the correct historical data instead of falling back to a single live data point. --- internal/api/router.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/api/router.go b/internal/api/router.go index 5dfc8873f..07d7dc2b7 100644 --- a/internal/api/router.go +++ b/internal/api/router.go @@ -5568,6 +5568,12 @@ func (r *Router) handleMetricsHistory(w http.ResponseWriter, req *http.Request) return } + // Normalize resource types so frontend aliases match the SQLite store keys. + switch resourceType { + case "docker": + resourceType = "dockerContainer" + } + // Parse time range var duration time.Duration var stepSecs int64 = 0 // Default to no downsampling (use tier resolution)