Both currentResourceUtilizationForTeam and resourceUtilizationTrendForTeam would fail because of the following query would return no rows:
SELECT
SUM(usage)::double precision AS usage,
SUM(request)::double precision AS request,
timestamp
FROM
resource_utilization_metrics
WHERE
team_slug = @team_slug
AND resource_type = @resource_type
AND timestamp = @timestamp
AND request > usage
GROUP BY
timestamp;
The problem is likely AND request > usage which was added to solve nais/console-backend#40
I made a workaround in 0a5cd996c3d58ebb6eb2f90fe15612d64c83d167 which returns empty data when there's no rows.
Earlier today, for a team which used more than requested of cpu/memory, the following query would result in an error:
Both
currentResourceUtilizationForTeam
andresourceUtilizationTrendForTeam
would fail because of the following query would return no rows:The problem is likely
AND request > usage
which was added to solve nais/console-backend#40I made a workaround in 0a5cd996c3d58ebb6eb2f90fe15612d64c83d167 which returns empty data when there's no rows.