mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-21 05:30:35 +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:
parent
79016ec1b0
commit
7336ec2d87
1 changed files with 6 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue