GCP Cloud SQL Committed Use Discount Opportunity
What does ZopNight detect here?
Production Cloud SQL instances with at least 60 days of CPU and memory history, uptime at or above 0.70, and utilization of 30% or more qualify for a committed-use discount recommendation. The discount fraction derives only from provider tier rates, with break-even priced at 730 hours per month.
Signal and threshold
| Field | Value |
|---|---|
| Rule IDs | RC-146 |
| Category | discount |
| Severity | low |
| Metric | none — pure configuration read |
| Source | cloudsql_cud.go |
Where it applies
Proving an instance is production
- resource.Name: production pattern (prod, production, live, prd) OR resource.Metadata labels.env/labels.environment/labels.stage/labels.tier == a production value (isProdEnvLabel, reading the nested Metadata[“labels”] object the discoverer’s genericEnrichGCPLabels writes). The name-only gate previously never evaluated a genuinely production instance whose name lacked a prod-like substring; resource.Tags is intentionally not consulted, because the GCP discoverer never populates Tags with customer labels for Cloud SQL, only derived hygiene flags.
- MetricsAware (EvalContextRule): CloudSQLCPUUtilization + CloudSQLMemoryUtilization over ≥60 days (CommitmentMinHistoryDays). These are exactly the producer-written Cloud SQL names, not the EC2 CPUUtilization/MemoryUtilization the shared ruletypes.CommitmentEligible gate hardcodes, which a Cloud SQL UID never carries (which is why the rule was previously dead). RC-146 runs its own cloudSQLCommitmentEligible gate keyed on these names.
- TierRatesAware: per-UID tier rates (the only saving basis; absent → abstain)
A discount fraction from tier rates only
concrete-or-abstain (cost-driven discount, commitment mechanism). Commitment-discipline gate first (≥60d history, uptime ≥ CommitmentUptimeEnter 0.70, measured CPU/mem ≥ CommitmentMinUtilPct 30%, fail-closed on every unknown). fraction = model.DeriveCommitmentFraction(tierRates, 0), derived solely from provider-authoritative tier rates (the prior hardcoded 0.40 fallback is removed); fraction <= 0 => abstain. Break-even (CommitmentBreakEven) prices the CUD at 730h/mo vs on-demand on measured running hours: savings = netSavings when it recommends, falls back to the hysteretic uptime gate + cost × fraction when break-even inputs are unavailable. The rule abstains when not prod, no/zero cost, not commitment-eligible, no tier rates, fraction ≤ 0, or break-even says do-not-recommend.
Confirming a full year of runtime
- Confirm the instance will run for at least 1 year
CPU and memory over a 60-day lookback
CloudSQLCPUUtilization, CloudSQLMemoryUtilization (≥60-day lookback)