Skip to content

docs(cost): add GCP billing setup guide for mc-cost-optimizer 0.6.5 - #89

Merged
MZC-CSC merged 1 commit into
developfrom
docs/admincli-cost-gcp-billing
Sep 28, 2026
Merged

MZC-CSC merged 1 commit into
developfrom
docs/admincli-cost-gcp-billing

Conversation

@dogfootman

@dogfootman dogfootman commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Documents how to enable GCP billing collection in mc-cost-optimizer.

Changes

  • docs/cost-optimizer-gcp-billing.md (new)
    • Prerequisites
      • Standard usage cost export to BigQuery, and table naming (gcp_billing_export_v1_<BILLING_ACCOUNT_ID>)
      • Admin SA registered at OpenBao secret/csp/gcp, with its required roles
    • /api/gcp/setup flow: status → auto-provision → dataset → billing-confirmed → restart the collector
    • Verification (log lines, manual /admin/billing/collect, SQL), troubleshooting, and the legacy (≤0.6.0) env method
  • conf/docker/.env.setup
    • Added a ## Cost-GCP-Collector section with comments
    • Removed MC_COST_OPTIMIZER_GCP_BQ_DATASET / MC_COST_OPTIMIZER_GCP_BQ_TABLE, which 0.6.5 ignores (dataset/table now come from OpenBao secret/cost/gcp or auto-discovery)
  • conf/docker/docker-compose.yaml: removed the matching gcp.dataset / gcp.table env lines from mc-cost-optimizer-gcp-collector
  • README.md: linked the guide and added the Azure/NCP/GCP collector ports (18093/18094/28095) to the firewall table

Verification

Ran on a local stack with mc-costopti-api and mc-costopti-gcpcollector at 0.6.5:

  • Before setup: the collector fell back to csp/gcp and auto-discovered the billing table. With Standard and Detailed exports in the same dataset, it picked the Detailed table. Manual collection: COMPLETED.
  • Setup flow:
    • auto-provision first failed at SA key generation with 403 iam.serviceAccountKeys.create.
    • After granting the admin SA roles/iam.serviceAccountKeyAdmin, all steps returned OK.
    • dataset (existing) → billing-confirmed → stage COMPLETE.
  • After setup: the collector read the new values only after a restart. The log then showed cost/gcp (운영 SA), and manual collection completed.
  • Pinning the Standard table: worked with bao kv patch secret/cost/gcp table=... followed by a collector restart. BE /status showed the new table only after a BE restart.
  • docker compose config -q passes with .env.setup. README links resolve.

- docs/cost-optimizer-gcp-billing.md: BigQuery billing export prerequisites,
  OpenBao csp/gcp admin SA and required roles, /api/gcp/setup flow
  (auto-provision -> dataset -> billing-confirmed), collector restart,
  verification and troubleshooting, legacy (<=0.6.0) env method
- .env.setup: add Cost-GCP-Collector section comments; drop
  MC_COST_OPTIMIZER_GCP_BQ_DATASET/TABLE (ignored since 0.6.5)
- docker-compose.yaml: drop gcp.dataset/gcp.table env from gcp-collector
- README.md: link the guide; add Azure/NCP/GCP collector ports
@MZC-CSC
MZC-CSC merged commit af44e0c into develop Sep 28, 2026
1 check passed
@dogfootman
dogfootman deleted the docs/admincli-cost-gcp-billing branch September 28, 2026 04:17
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.

3 participants