Add automatically attributed historical workload metrics dashboards - #1734
Conversation
PR Summary by QodoAdd workload request and resource pressure dashboards
AI Description
Diagram
High-Level Assessment
Files changed (26)
|
Code Review by Qodo
1.
|
479a73c to
30faff4
Compare
70b6f94 to
43d2448
Compare
43d2448 to
f1a8e50
Compare
f1a8e50 to
8d76e2c
Compare
8d76e2c to
ecfbe20
Compare
85225b7 to
633a691
Compare
633a691 to
bb71926
Compare
|
ⓘ Your Qodo trial ends soon. Ask your workspace admin to set up billing to keep reviews running after the trial. Manage billing |
b955dd2 to
cf9141a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cf9141a. Configure here.
cf9141a to
49c45c3
Compare

Fixes #1722.
Summary
Add curated request and resource dashboards to the existing Metrics tab for Deployments, StatefulSets and DaemonSets. Radar reads existing Prometheus-compatible data; it does not install collectors or require application changes.
The main charts describe the workload over the selected time range, including previous replicas where metrics and ownership were retained. CPU and memory show workload totals alongside the maximum Pod; throttling shows period-weighted workload percentage and the worst Pod. HTTP charts show request rate, 5xx percentage, p50/p95 latency and reporting Pods. A separate current-Pod table supports comparison without defining historical membership.
The shared range control persists a validated
metricsRangein the URL, preserving unrelated workload, Applications and tab parameters. Range changes replace history; opening the full dashboard from a resource drawer preserves the drawer’s time range. Request-source selection stays local to the workload. The container-aware layout uses three columns at 1200px of content, two at 760px and one below. The app-shell minimum width still limits phone layouts; chart expansion and laptop-density refinement are follow-ups. Non-HTTP workers keep resource charts without an empty RED grid. Missing, idle, partial, stale, ambiguous and failed observations remain distinct. Workload chart lines break at omitted evaluation intervals, and tooltips do not borrow values from across those gaps; existing sparse charts retain their sampling behavior.Disconnected standalone views offer discovery retry and the existing Metrics settings; embedded views direct users to their operator. The connected dashboard leads with charts: per-family historical scope, reporting counts, and concise request/error/latency/throttling definitions remain contextual. About these metrics opens a keyboard-accessible Metrics sources & coverage dialog with grouped current-Pod matching evidence, separate historical-ownership and operator-assertion context, a short interpretation guide, and optional troubleshooting. Matching progress/failure remains distinct from usable historical data. When no HTTP source can be selected, contextual details retain the source-specific matching reasons. The bounded dialog preserves dashboard position and keeps its header/footer accessible while the body scrolls. Actual partial, stale, failed and identity-unverified states remain visible beside charts; identical coverage warnings are shared only across matching populated chart groups. Current-template request/limit values align with the CPU and memory comparison columns and are explicitly qualified as template settings, not actual post-injection allocations or utilization percentages.
Membership, attribution and query design
upvector; automatic endpoint discovery skips empty candidates. Safe diagnostics distinguish authorization, invalid API responses, Prometheus query/storage errors, HTTP proxy errors and transport failures.See chart prerequisites, discovery, semantics and coverage.
Documentation and local configuration
The canonical workload metrics guide starts with chart usage, prerequisites and source semantics, followed by troubleshooting and the detailed compatibility reference. It documents the workload HTTP endpoint's inputs, independent panel states, historical versus current-Pod membership, transitional responses and authorization errors. Operator guidance distinguishes standalone CLI, Desktop, in-cluster OSS and Radar Cloud; shared-installation viewers are directed to their operator's Helm/GitOps configuration. Three content-only screenshots show the six-chart overview, current-Pod comparison and sources/coverage dialog. Screenshots replay a recorded real demo response with deliberate errors; they illustrate the UI rather than certify another backend run.
Companion radar-docs PR #100 maps the OSS guide and its referenced images into a dedicated Metrics page, adds navigation and contextual Applications/Traffic/Prometheus links, and keeps the importer authoritative. It must remain draft until this source is merged and the importer is rerun against OSS main.
Local Prometheus URL, headers and tenant settings are Radar-wide, not per-cluster connection profiles. Switching Kubernetes context retains the manually configured endpoint/headers while the new workload charts recheck identity and discard scope assertions. Changing only the URL also retains saved headers. Configuration docs explain these limits and distinguish them from the existing Argo CD/Kubecost credential bindings. Per-cluster profiles and their credential migration are a separate follow-up; older name-matched charts do not gain the new attribution guarantees.
Live compatibility evidence
These are tested versions/configurations, not a blanket stock-default or percentage-of-users claim.
Cloud workloads were not rolled or scaled for history validation. The tested VictoriaMetrics chart drops cAdvisor
idand KSMuidby default; successful automatic attribution preserves those labels. The unlabeled official Istio sample still requires an explicit scope assertion. Default OTLP-to-Alloy conversion without application Pod attributes is not supported by the HTTP adapter. Gateway-level Mimir checks verify rejection of missing/wrong credentials and a missing tenant.Repeatable lab and verification
The isolated kind demo reuses the existing Beyla fixture, adds cAdvisor/KSM and isolated Istio sidecars, and generates finite traffic without changing the global current context.
bash scripts/workload-metrics-demo.sh up bash scripts/workload-metrics-demo.sh traffic make build bash scripts/workload-metrics-demo.sh check bash scripts/workload-metrics-demo.sh historyThe history check rotates only its HTTP fixtures, verifies old Pods disappear, scales to zero, compares fixed historical timestamps numerically and restores original replicas. The checker cleans up its own Radar and port-forward processes. Operational evidence and credentials remain private.
Boundaries and risk
History describes the logical cluster/namespace/kind/name workload, not immutable Kubernetes object lifetime. Retention gaps, missing ownership and staleness around deletion/rate windows remain visible; Radar cannot reconstruct samples never collected. Raw ownership is live-tested; recorded ownership and 128-Pod totals are engine-tested, not a large live deployment.
Ingress observers, native-only histograms, ambient waypoints, gRPC and queue semantics remain follow-ups. Legacy network/filesystem/restart/basic resource charts remain name-based. Unknown HA conventions need upstream deduplication. Large-scale query cost, real HA, Radar Cloud transport and managed-service authentication are not live-certified.
Primary risks are incorrect membership, duplicate totals and expensive joins. Scoped ownership, population guards, fixed-timestamp rollout tests and query bounds mitigate them. No production deployment or distribution publication is included.
Note
High Risk
Large new metrics surface with PromQL joins, cross-cluster attribution, and scope overrides—incorrect membership or totals would mislead operators during incidents.
Overview
Adds Workload Metrics for Deployments, StatefulSets, and DaemonSets: a new
GET /prometheus/workload/{kind}/{namespace}/{name}API and Metrics-tab experience combining HTTP request rate, 5xx, latency (Beyla or Istio), CPU, memory, throttling, workload history across rollouts, and current-Pod comparison.The backend introduces
pkg/promworkload query builders plus Prometheus client logic for automatic Pod/cluster attribution (UID, KSM partition, bounded evidence probes) and historical membership via kube-state-metrics ownership joins. Operators can override scope with--prometheus-single-cluster, repeatable--prometheus-cluster-label, and a narrowed--beyla-job-selector(CLI, Helmtraffic.*, not persisted in local config); assertions clear on connection or endpoint changes. Discovery now tracks logical backend identity, uses safer manual-endpoint probes, and improves failure messaging.Docs,
docs/workload-metrics.md, Makefile/CI demo hooks, Helm schema/tests, and extensive unit/live tests accompany the change; test cleanup waits for the auth recovery worker duringResetTestState.Reviewed by Cursor Bugbot for commit 49c45c3. Bugbot is set up for automated code reviews on this repo. Configure here.