mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-11 22:12:23 +00:00
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:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user