feat(grafana): add gpu workload history deep-link endpoint (#824)#596
Open
SekiXu wants to merge 2 commits into
Open
feat(grafana): add gpu workload history deep-link endpoint (#824)#596SekiXu wants to merge 2 commits into
SekiXu wants to merge 2 commits into
Conversation
Add GET /grafana/gpuWorkloadHistory/:hostname returning the device dashboard deep-links for a physical node's GPU Utilization (panel 50) and VRAM (panel 51), filtered by var-GPU_HOST (not var-HOST). enabled reflects node existence via nodes.IsExist; GetNodeGpusMap is avoided because it is local-only and reports the wrong node for remote ones. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Seki Xu <seki.xu@bigstack.co>
…cs (#824)
Points to the openapi commit that documents
GET .../grafana/gpuWorkloadHistory/{hostname}, so the generated api
docs include the new endpoint.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Seki Xu <seki.xu@bigstack.co>
5ca75cd to
8863be5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Feature — new backend API endpoint (Grafana deep-link for GPU workload history).
Which issue(s) this PR fixes?
Backend track of #824 and #825 (cross-track User Stories; this PR is the backend portion only — not closing the stories).
What this PR does?
Adds
GET /api/v1/datacenters/{dataCenter}/grafana/gpuWorkloadHistory/{hostname}, returning the Device dashboard (UIDi-device) deep-links for a physical node's GPU Utilization (panel 50) and VRAM (panel 51), so the Frontend can add a "View Workload History" button on the physical GPU table.Response:
{ "gpuUtilizationUrl": "https://<vip>/grafana/d/i-device/device?orgId=1&var-GPU_HOST=<host>&from=now-3h&to=now&viewPanel=50", "vramUrl": "https://<vip>/grafana/d/i-device/device?orgId=1&var-GPU_HOST=<host>&from=now-3h&to=now&viewPanel=51", "enabled": true }Changes (additive, zero breaking change):
definition/v1/grafana: newGpuWorkloadHistorystruct (two URLs +enabled).handlers/grafana/links.go:genGpuUtilizationHistoryLink/genGpuVramHistoryLink(reuse existing link-gen style +base.DataCenterVip).handlers/grafana/handlers.go:forwardGpuWorkloadHistoryLinks+ route.Design notes:
var-GPU_HOST(hidden$GPU_HOST), notvar-HOST—var-HOSTresolves toipmi_sensor.hostname→ blank panels.enabled = nodes.IsExist(hostname)(cluster-wide).GetNodeGpusMapis intentionally avoided: it runshex_sdklocally and reports the wrong node for remote hostnames.GET /grafana/*is in the API auth-free allowlist), consistent with the other Grafana link endpoints.var-GPU_HOSTmust stay stable.Test results (optional)
1). make sure the api docs have been updated
✅ Added
/grafana/gpuWorkloadHistory/{hostname}to the OpenAPI spec(cube-cos-openapi#103), and bumped the submodule pointer in this PR.
2). make sure the api works properly
sky150and smoke-verified:gpuUtilizationUrl(viewPanel=50) +vramUrl(viewPanel=51) +enabled:trueenabled:falsegpu.host.host=Node.Hostname=sky150🤖 Generated with Claude Code