Skip to content

Conversation

@ludamad
Copy link
Collaborator

@ludamad ludamad commented Feb 2, 2026

Add a new dashboard to rkapp that displays billing breakdown by namespace with historical data support. Includes interactive graphs for visualizing billing metrics over time, enabling better cost tracking and analysis across namespaces.

- Add fetch-billing.py that queries the egress_consumption BigQuery
  dataset (GKE resource consumption metering) for CPU, memory, egress,
  and storage usage per namespace, applies GCP pricing, and writes
  daily JSON files to disk
- Make dashboard and backend fully data-driven: categories (cpu,
  memory, egress, storage, etc.) are discovered from the data instead
  of being hardcoded
- Add google-cloud-bigquery to requirements.txt
- Update sample data generator to use real category names
Replace the resource-metering-based cost estimation with queries
against the actual Cloud Billing Export BigQuery table
(gcp_billing_export_resource_v1_*).  This gives real dollar costs
with no estimation needed.

- Auto-discovers the billing export table across all datasets
- Joins on k8s-namespace label (from GKE cost allocation)
- Categorises SKUs into compute_spot, compute_ondemand, storage,
  network, other based on SKU description
- Net cost includes credits (SUD, CUD, etc.)
- Dashboard capitalize() now handles underscore-separated categories
- Sample data generator updated to match real categories
Rewrites fetch-billing.py to query the gke_cluster_resource_consumption
table in BigQuery (egress_consumption dataset) instead of the Cloud
Billing Export table which is not enabled in this project.

Applies exact SKU prices from the GCP Cloud Billing Catalog API for all
8 SKU types across T2D, N2, and N2D machine families (both spot and
on-demand). Tested against live data: 61 days, 67 namespaces, $3.3k
total compute cost.
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​google-cloud-bigquery@​3.40.099100100100100

View full report

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.

2 participants