Skip to content

feat(web-console): cost dashboard with platform and My cost views - #1207

Merged
rh-amarin merged 4 commits into
mainfrom
feat/cost-dashboard
Dec 1, 2026
Merged

rh-amarin merged 4 commits into
mainfrom
feat/cost-dashboard

Conversation

@rh-amarin

@rh-amarin rh-amarin commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Angel · project thread

🤖 Generated with Claude Code

https://claude.ai/code/session_01M7N31pRitPRxdU68huDHfF

Summary

Adds the cost dashboard at /dashboard/cost (specs/web-console/cost-dashboard.spec.md v0.4.0).

  • BFF routes. Admin: /api/metrics/cost/summary, /api/metrics/cost/breakdown, /api/metrics/cost/gateways. Any signed-in user: /api/metrics/cost/me/summary, /api/metrics/cost/me/gateways.
  • Pricing. The BFF prices reserved quantities with a deployment rate card. Costs are attributed to each gateway's billing owner.
  • New env vars. COST_RATE_CARD_FILE, COST_PROMETHEUS_URL (with COST_PROMETHEUS_TOKEN_FILE and COST_PROMETHEUS_CA_FILE), and COST_CLUSTERS.
  • UI package. CostDashboardPage in @openshift-online/hypershell-operational-dashboard-ui, on the shared widget grid. It has a platform view and a My cost view.
  • Docs. New cost sections in packages/operational-dashboard-ui/DATA_SOURCES.md.
  • Spec IDs. Registers the WEB-COST prefix in specs/ids.md.

Needs design approval

The ui-build-gate parity check passed for both views. The mockups changed, so they need Angel's design approval:

  1. New My cost mockup.
  2. The platform mockup gains Most expensive gateways, By billing owner, an Unused gateways line, and an About section.

Depends on

The gitops recording-rules PR: https://github.com/openshift-online/hypershell-gitops/pull/3089

Tests

  • BFF: 347 passing (pnpm --filter @openshift-online/hypershell-web-console-bff check).
  • Operational dashboard package: 122 passing (check).
  • Web console: 288 passing (vitest), typecheck clean.
  • Pre-commit and pre-push policy hooks passed.

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

HyperShell environment destroyed

This ephemeral OpenShift environment has been destroyed. Comment /pr-extend to redeploy it.

@codecov-appsre

codecov-appsre Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@           Coverage Diff           @@
##             main    #1207   +/-   ##
=======================================
  Coverage   47.10%   47.10%           
=======================================
  Files         475      475           
  Lines       38639    38639           
=======================================
  Hits        18200    18200           
  Misses      18302    18302           
  Partials     2137     2137           
Flag Coverage Δ
sdk-generator 63.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f6c2fa...63881ce. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mergify

mergify Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

This pull request is merged.

@rh-amarin
rh-amarin added this pull request to the merge queue Nov 30, 2026
@rh-amarin
rh-amarin removed this pull request from the merge queue due to a manual request Nov 30, 2026
@rh-amarin
rh-amarin added this pull request to the merge queue Dec 1, 2026
@rh-amarin
rh-amarin removed this pull request from the merge queue due to a manual request Dec 1, 2026
Adds /dashboard/cost (specs/web-console/cost-dashboard.spec.md v0.4.0): BFF cost routes priced with a deployment rate card (COST_RATE_CARD_FILE), billing-owner attribution, the platform and My cost views on the shared widget grid, mockups, and DATA_SOURCES docs.

Assisted-by: Claude
Claude-Session: https://claude.ai/code/session_01M7N31pRitPRxdU68huDHfF
The cost dashboard showed "cost model not configured" on every deployment
because nothing set COST_RATE_CARD_FILE.

- deploy/base: add a default rate card (IBM Cloud Red Hat OpenShift on VPC,
  us-east, November 2026 list prices: gen2 vCPU plus the OpenShift license,
  and memory) as the hypershell-cost-rate-card ConfigMap, mount it into the
  console and set COST_RATE_CARD_FILE. Overlays replace the ConfigMap.
- deploy/kind: add a Kind-only PrometheusRule that records the four
  hypershell:* cost inputs from local kube-state-metrics with a fixed
  cluster="kind" label, and set the Prometheus ruleSelector so it loads.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
… rules

The kube-state-metrics ServiceMonitor does not honor labels, so every
kube_pod_container_resource_requests series carried namespace=hypershell-system
(the exporter's own) and the pod's namespace as exported_namespace. The
namespace request rules summed the whole cluster into hypershell-system and
gateway namespaces got no cost.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
…nent

The base application package shipped the hypershell-cost-rate-card
ConfigMap, which the namespace-restricted application Argo CD package does
not allow. Move the rate card, its mount, and COST_RATE_CARD_FILE into
deploy/gitops-base/components/cost-rate-card, next to
openshift-dashboard-metrics.

- The base console now starts with the cost model not configured.
- The Kind and OpenShift dev overlays include the component, so local dev and
  e2e keep their prices.
- deploy/gitops/applications and deploy/hub do not include it; sites opt in
  from their gitops overlay.
- Add the component to the release bundle manifest paths so gitops overlays
  can reference it.
- Document the opt-in in the spec (0.4.1), the gitops README, and the
  component README.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M7N31pRitPRxdU68huDHfF
@rh-amarin
rh-amarin force-pushed the feat/cost-dashboard branch 2 times, most recently from 63881ce to 35163d6 Compare December 1, 2026 11:06
@rh-amarin
rh-amarin added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 6435137 Dec 1, 2026
39 checks passed
@rh-amarin
rh-amarin deleted the feat/cost-dashboard branch December 1, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant