Symptom
providers/gcp/services/computeengine/client.go:804 stamps rec.PaymentOption = "upfront" on every Compute Engine CUD recommendation it emits. Peer GCP services (cloudsql, memorystore, cloudstorage) consistently stamp "monthly". After PR #709's NormalizePaymentOption is in place, the normalizer coerces this to "monthly" with a WARN log — which means a WARN fires on every single GCP Compute Engine recommendation emitted by a healthy collector.
Root cause
GCP CUDs are billed monthly across the commitment term. There is no "upfront" billing tier in GCP. The buildCommitmentRequests function at providers/gcp/services/computeengine/client.go:350-373 confirms this — it takes only a Plan (TWELVE_MONTH / THIRTY_SIX_MONTH) and never reads PaymentOption.
The "upfront" literal at line 804 is leftover from when the codebase modelled all providers with AWS-style tokens. Other GCP services were fixed (or always correctly stamped "monthly"); this one was missed.
Fix
One-line change at providers/gcp/services/computeengine/client.go:804:
- rec.PaymentOption = "upfront"
+ rec.PaymentOption = "monthly"
After this lands, the NormalizePaymentOption WARN log goes silent on the GCP Compute Engine path (no more all-upfront → monthly with WARN per rec), and the stamping is consistent across all GCP service emitters.
Tests
- Update any test in
providers/gcp/services/computeengine/client_test.go that asserts the stamped value (change expected "upfront" to "monthly").
- Spot-check downstream consumers (
internal/purchase/execution.go, internal/recommendations/*) to confirm they don't have a GCP-Compute-Engine-specific branch that depends on "upfront" — if they do, that's a separate bug surfaced by this fix.
Why this matters
- Log hygiene: WARN-per-rec on a healthy pipeline pollutes ops dashboards and trains operators to ignore the WARN level.
- Consistency: 4 GCP services should stamp the same canonical token. Drift here is technical debt.
- Forward-compat: any future GCP service added by mirroring computeengine will inherit the bug; mirroring cloudsql/memorystore/cloudstorage won't.
Related
Symptom
providers/gcp/services/computeengine/client.go:804stampsrec.PaymentOption = "upfront"on every Compute Engine CUD recommendation it emits. Peer GCP services (cloudsql,memorystore,cloudstorage) consistently stamp"monthly". After PR #709'sNormalizePaymentOptionis in place, the normalizer coerces this to"monthly"with a WARN log — which means a WARN fires on every single GCP Compute Engine recommendation emitted by a healthy collector.Root cause
GCP CUDs are billed monthly across the commitment term. There is no "upfront" billing tier in GCP. The
buildCommitmentRequestsfunction atproviders/gcp/services/computeengine/client.go:350-373confirms this — it takes only aPlan(TWELVE_MONTH / THIRTY_SIX_MONTH) and never readsPaymentOption.The
"upfront"literal at line 804 is leftover from when the codebase modelled all providers with AWS-style tokens. Other GCP services were fixed (or always correctly stamped"monthly"); this one was missed.Fix
One-line change at
providers/gcp/services/computeengine/client.go:804:After this lands, the
NormalizePaymentOptionWARN log goes silent on the GCP Compute Engine path (no moreall-upfront → monthly with WARNper rec), and the stamping is consistent across all GCP service emitters.Tests
providers/gcp/services/computeengine/client_test.gothat asserts the stamped value (change expected"upfront"to"monthly").internal/purchase/execution.go,internal/recommendations/*) to confirm they don't have a GCP-Compute-Engine-specific branch that depends on"upfront"— if they do, that's a separate bug surfaced by this fix.Why this matters
Related
fix(config): accept provider-canonical payment options in plan validator) — added the normalizer that masks this bug today.providers/gcp/services/{cloudsql,memorystore,cloudstorage}/client.go— peer services with the correct"monthly"stamp.