Skip to content

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

Merged
MZC-CSC merged 2 commits into
m-cmp:mainfrom
MZC-CSC:develop
Sep 28, 2026
Merged

MZC-CSC merged 2 commits into
m-cmp:mainfrom
MZC-CSC:develop

Conversation

@MZC-CSC

@MZC-CSC MZC-CSC commented Sep 28, 2026

Copy link
Copy Markdown
Member

Summary

Documents how to enable GCP billing collection in mc-cost-optimizer.
This PR also removes GCP env settings that the 0.6.5 images no longer read.

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 in OpenBao secret/csp/gcp and the roles it needs
    • /api/gcp/setup flow: status → auto-provision → dataset → billing-confirmed → collector restart
    • 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

Tested on a local stack with mc-costopti-api / mc-costopti-gcpcollector 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 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 picked up 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, and the README links resolve.

yh-noh and others added 2 commits September 28, 2026 02:26
- 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
docs(cost): add GCP billing setup guide for mc-cost-optimizer 0.6.5
@MZC-CSC
MZC-CSC merged commit 69b7768 into m-cmp:main Sep 28, 2026
1 check passed
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