🌱 Add bounded self-metrics for GPU utilization worker - #23243
🌱 Add bounded self-metrics for GPU utilization worker#23243kubestellar-hive[bot] wants to merge 1 commit into
Conversation
|
Important Held for human sign-off on the direction, not on the code. This PR's only tracked rationale is #23242, which the hive filed itself — issue #23242 was filed by kubestellar-hive[bot] and no human has acknowledged it. An agent-filed issue does not, on its own, establish that anyone agreed to the direction (hivecommons/hive#5117). The change may well be right; nothing here is a review of it. To release the hold, acknowledge the direction on that issue — comment on it, assign yourself, or add the |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellarconsole canceled.
|
|
👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!
This is an automated message. |
Fixes #23242 The GPU utilization background worker (pkg/api/gpu_utilization_worker.go) polls active reservations, queries pods/GPU nodes per cluster, optionally scrapes the DCGM exporter, and sends threshold alerts — entirely outside the HTTP request path, so it was invisible to console_http_requests_total and console_http_request_duration_seconds. Failures were logged via slog only, with no scraped/aggregated signal. Adds five bounded Prometheus metrics: - console_gpu_util_scrape_cycles_total (counter) - console_gpu_util_scrape_duration_seconds (histogram) - console_gpu_util_reservation_collect_total{outcome} (counter, fixed outcome set: success/pods_error/nodes_error/snapshot_error) - console_gpu_util_dcgm_scrape_errors_total (counter) - console_gpu_util_alert_send_errors_total (counter) No new label is derived from reservation ID, cluster name, or any other unbounded value. Extends the existing Grafana self-metrics dashboard with two panels for these metrics and adds a unit test asserting all five series surface on /metrics with the expected label values. Signed-off-by: kubestellar-hive[bot] <223556219+Copilot@users.noreply.github.com>
7624ad9 to
e49e6bd
Compare
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Fixes #23242
What
Adds bounded Prometheus metrics for the GPU utilization background worker (
pkg/api/gpu_utilization_worker.go), which polls active GPU reservations, queries pods/GPU nodes per cluster, optionally scrapes DCGM, and sends threshold alerts — entirely outside the HTTP request path, so it had no signal on/metricsbeyondslogerror logs.New metrics (
pkg/api/metrics/metrics.go)console_gpu_util_scrape_cycles_total(counter) — completed poll cyclesconsole_gpu_util_scrape_duration_seconds(histogram) — poll cycle durationconsole_gpu_util_reservation_collect_total{outcome}(counter) — fixed outcome set:success/pods_error/nodes_error/snapshot_errorconsole_gpu_util_dcgm_scrape_errors_total(counter)console_gpu_util_alert_send_errors_total(counter)No label is derived from reservation ID, cluster name, or any other unbounded value — the
outcomelabel only ever takes one of the four fixed constants.Other changes
deploy/grafana/console-self-metrics-dashboard.json): poll-cycle rate/p95 duration, and collection outcomes/DCGM/alert error rates.pkg/api/metrics/metrics_test.go) asserting all five series surface on/metricswith expected label values.Backend status
No observability backend is confirmed for this repo (per prior audit #23055). This PR only adds in-process Prometheus client metrics exposed on the existing
/metricsendpoint — no exporter or external data flow is introduced.Testing
go build ./...— passesgo test ./pkg/api/... ./pkg/api/metrics/...— passes (including newTestGPUUtilRecordFunctions)gofmt -l— cleanjson.load— hive: agent=telemetry backend=copilot model=claude-sonnet-4-6