Skip to Content
InfraGCP billing

GCP billing — baseline, improvements, forecast

Financial snapshot for Oter (LifeCommanderKMP) and Negodex on Google Cloud. Ops details and rollback steps live in gcp-cost-cuts.md.

Scope

ProjectIDWhat runs there
Oteroter-490318Ktor API (oter), Next.js web (oter-web), Cloud SQL oter-db, Artifact Registry
NegodexnegodexNest API (api), admin/web frontends; no Cloud SQL after 2026-05-25 (uses Oter’s instance)

Billing may appear on one GCP billing account (combined invoice) or per project depending on how the account is linked. Use Billing → Reports → Group by: Project to split Oter vs Negodex when validating savings.


1. Previous billing (baseline)

Measurement period

FieldValue
Period2026-04-07 → 2026-04-30 (~23 days)
Currency reportedCOP (Colombian peso)
FX used below~4,100 COP/USD (derived from line items; use your invoice for exact rates)

Line items (as reported)

SKUCOP (23 days)~USD (23 days)~USD / month (× 30/23)Primary driver
Cloud SQL144,875~$35~$46Postgres always-on (oter-db; possibly includes shared-account SQL if Negodex billed here)
Cloud Logging131,398~$32~$42Ingestion + storage; server at DEBUG, 30-day retention, no exclusions
Cloud Run32,044~$8~$10Scale-to-zero services; Oter API at 2 vCPU / 1 GiB
Artifact Registry258~$0.06~$0.08Negligible
Total (these SKUs)308,575~$75~$98

What drove each cost (before cuts)

Cloud SQL (~46 USD/mo projected)

  • Instance oter-db: tier db-custom-1-3840, Postgres 18, 10 GB disk, backups enabled.
  • Separate instance negodex-pg in project negodex (same tier) added ~$50–60/mo if billed on the same account or on Negodex’s project — not always visible in a single-project export.

Cloud Logging (~42 USD/mo projected)

  • Largest avoidable cost. Root causes:
    • logback.xml defaulted to DEBUG; Flyway, Postgres driver, and Ktor also at DEBUG.
    • Cloud Run deploy did not set LOG_LEVEL=INFO.
    • _Default bucket: 30-day retention.
    • No sink exclusions for health checks or DEBUG severity.

Cloud Run (~10 USD/mo projected)

  • Already efficient (scale to zero on web). Oter API oversized at 2 CPU / 1 GiB.
  • Windmill was never deployed on GCP (no spend; repo workflow would have cost ~$210/mo if deployed — see automation-options.md).

Artifact Registry

  • Storage only; no material cost.

Baseline scenarios

ScenarioEstimated total / month
A — April numbers = entire billing account (both apps, one SQL line item)~$98
B — April = oter-490318 only; Negodex SQL billed separately~$98 (Oter) + ~$50–60 (Negodex SQL)$148–158

Confirm which scenario applies in Billing → Reports → Group by: Project for April.


2. Improvements applied (2026-05-25)

#ChangeEst. monthly savingsRiskStatus
1Logging: LOG_LEVEL=WARN, logback WARN defaults, live oter updated$25–35LowDone
2Logging (GCP): retention 1d; exclusions (health, DEBUG, INFO/NOTICE, Cloud Run below ERROR) on oter-490318 + negodex→ ~$0 (free tier)Low — less visibilityDone
3Oter API: Cloud Run 1 vCPU / 512 MiB (was 2 / 1 GiB)$2–4Low — monitor cold startsDone
4Negodex SQL: myecommercedb on oter-db; deleted negodex-pg$50–60Medium — PG16→18 migration; smoke-test appDone
5Artifact Registry: cleanup policy (keep 5 tags; delete untagged >30d)~$0 (prevents growth)LowDone
6Windmill: repo removed; never on GCP$0 today; ~$210 avoided if deployedDone (repo)

Technical summary

Oter (oter-490318)

  • Logging and CPU/RAM: workflow + live revision oter-00033-jb2.
  • Redeploy via Publish Server Release after merge so the Docker image includes hardened logback.xml.
  • oter-db still db-custom-1-3840; backups already 7 retained / 7-day transaction logs.

Negodex (negodex)

  • DB host secret → /cloudsql/oter-490318:us-east1:oter-db.
  • api Cloud Run attached to shared instance; api-runtime@negodex granted roles/cloudsql.client on oter-490318.
  • negodex-pg instance deleted after successful restore and Nest startup.

Not changed yet (deferred)

  • Downgrade oter-db machine tier (wait 48h stable dual-app load).
  • Drop legacy database oter on oter-db if confirmed unused.

Full runbook: gcp-cost-cuts.md.


3. Expected billing (forecast)

Estimates are ranges until one full billing cycle (7–30 days) after 2026-05-25. Traffic and cross-project billing grouping affect actuals.

By SKU (monthly USD)

SKUBefore (scenario A)Before (scenario B)After (expected)Notes
Cloud SQL~$46~$96–106~$46–52One instance (oter-db) for both apps; slight load increase vs Oter-only
Cloud Logging~$42~$42~$0–3WARN app logs + ingest exclusions; aim for under 50 GiB/mo free
Cloud Run~$10~$10–15~$7–9Oter API smaller; Negodex unchanged
Artifact Registry~$0~$0~$0Cleanup policy
Total~$98~$148–158~$22–38 (A) or ~$57–67 (B)

Scenario A — April total was ~$98 (combined view)

USD / month
Previous~$98
Expected~$22–38
Savings~$60–76 (~61–78%)

Largest drivers: logging cut + removal of second SQL instance (if it was already inside the same $46 SQL line, savings show up as lower SQL growth or a second project dropping off — verify in console).

Scenario B — Negodex SQL was extra (~$50–60/mo)

USD / month
Previous (Oter + Negodex)~$148–158
Expected~$63–73
Savings~$75–95 (~50–60%)

COP reference (at ~4,100 COP/USD)

COP / month (approx.)
Previous (scenario A)~402,000
Expected (scenario A)~115,000–185,000
Previous (scenario B)~607,000–648,000
Expected (scenario B)~258,000–299,000

4. How to verify actuals

  1. Open GCP Billing Reports.
  2. Set range: first full month after 2026-05-25.
  3. Group by: SKU — compare Cloud Logging, Cloud SQL, Cloud Run to tables above.
  4. Group by: Project — confirm negodex has no Cloud SQL line item; SQL spend should sit under oter-490318.
  5. Optional: export CSV and archive next to this doc (e.g. docs/infra/billing-exports/YYYY-MM.csv).

Success criteria

SKUTarget vs April baseline
Cloud Logging>90% decrease (ideally $0 within free tier)
Cloud SQL~50% decrease if two instances before; flat ~$46–52 if one shared instance already in baseline
Cloud Run~10–30% decrease on Oter project

5. Near-zero Cloud Logging (2026-05-25 update)

GCP bills $0 for the first 50 GiB/month of log ingestion (then ~$0.50/GiB). To get close to $0:

LayerWhat we did
ApplicationLOG_LEVEL=WARN — no routine INFO/DEBUG to stdout
Ingest exclusionsDo not store Cloud Run logs below ERROR; drop INFO/NOTICE/DEBUG and health probes
Retention1 day on _Default (less storage cost if you ever exceed free tier)

Trade-off: Logs Explorer shows mostly errors for Cloud Run. For a short investigation:

gcloud run services update oter --region=us-east1 --project=oter-490318 --update-env-vars=LOG_LEVEL=INFO # when done: gcloud run services update oter --region=us-east1 --project=oter-490318 --update-env-vars=LOG_LEVEL=WARN

Negodex: same sink rules on project negodex; lower Nest logger level in the Negodex repo if INFO lines remain high.


6. Future levers (not in current forecast)

LeverPotential savingsWhen
Downgrade oter-db tier after 48h stable$0–15/moAfter Negodex + Oter verified
Drop unused DB oterDisk/admin onlyAfter backup + confirm unused
Negodex web minScale=1 → 0 if acceptable$1–3/moProduct decision (cold start on web)
Deploy Windmill on Cloud Run worker pools+$210/moDo not without automation-options.md

← Infrastructure docs · ← Docs index