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.
This commit is contained in:
rcourtman
2026-02-09 22:33:24 +00:00
parent 79016ec1b0
commit 7336ec2d87
+6
View File
@@ -5568,6 +5568,12 @@ func (r *Router) handleMetricsHistory(w http.ResponseWriter, req *http.Request)
return return
} }
// Normalize resource types so frontend aliases match the SQLite store keys.
switch resourceType {
case "docker":
resourceType = "dockerContainer"
}
// Parse time range // Parse time range
var duration time.Duration var duration time.Duration
var stepSecs int64 = 0 // Default to no downsampling (use tier resolution) var stepSecs int64 = 0 // Default to no downsampling (use tier resolution)