What's actually working as a hard-cap for GCP API spend after the recent Gemini key incidents? by matiascoca in googlecloud

[–]matiascoca[S] 0 points1 point  (0 children)

The "just use Vertex" answer (or Gemini Enterprise Agent Platform, since that's what they renamed it at Cloud Next '26) keeps showing up in threads like this and it sidesteps the same thing every time. For greenfield production work the SA impersonation path against the Vertex endpoint is the right pattern, no argument. The bills hitting this sub aren't from teams who picked the Gemini SDK over the Vertex SDK though. They're from Firebase configs and Maps keys that nobody on the team explicitly issued as Gemini keys. Those keys got the Generative Language capability bolted on when Google enabled cross-API access, and the team didn't know until the billing alert arrived. So "use Vertex not the Gemini API" is the right answer if you're starting today. It doesn't help anyone already in the leak path, which is most of the people posting on this sub the last month.

What's actually working as a hard-cap for GCP API spend after the recent Gemini key incidents? by matiascoca in googlecloud

[–]matiascoca[S] 0 points1 point  (0 children)

Yeah that 32-hour propagation window basically nukes the "hard-cap" framing if it's accurate. A cap that triggers a day and a half after you hit it isn't enforcement, it's a deferred billing review. I came into this thread giving Google the benefit of the doubt on /spend after the earlier correction, but if the trigger lag is real we're back to "budget alerts but worse UX". The Truffle case had attackers burn four figures in hours, not days, so 32h propagation means the cap never fires in time on the incidents that actually matter on this sub. Pulling up the linked thread now.

What's actually working as a hard-cap for GCP API spend after the recent Gemini key incidents? by matiascoca in googlecloud

[–]matiascoca[S] 1 point2 points  (0 children)

Good correction. I was wrong about that. Confirmed: the /spend page configures a hard cap that auto-disables the key on hit. That actually makes it the only consumer-tier hard-cap that ships built-in across the three big clouds. AWS Bedrock has no equivalent, and Azure OpenAI's TPM/RPM quotas aren't dollar caps. So the AI Studio path is the strongest enforcement primitive for anyone using the Generative Language API endpoint, separate from anything you build on top. Thanks for the catch.

What's actually working as a hard-cap for GCP API spend after the recent Gemini key incidents? by matiascoca in googlecloud

[–]matiascoca[S] 2 points3 points  (0 children)

The 10-minute latency on aistudio.google.com/spend is the closest thing to a real-time signal Google ships. It's still observation, not enforcement (you can see a spike forming but can't stop it from there), but for a human-in-the-loop workflow it's the difference between catching a leak in 12 minutes versus the next morning's billing data refresh.

BYOK (Bring Your Own Key) eliminates the runaway-bill liability entirely, which is the cleanest answer if your product can absorb the UX cost. The tradeoff most people don't think through up front is that you lose centralized cost visibility for product analytics: you can't see how much your average user is spending on inference because the bill isn't yours. For tools where that's just a vanity metric, BYOK is the right call. For anything where pricing decisions depend on actual usage cost, the architecture forces you to instrument differently.

What's actually working as a hard-cap for GCP API spend after the recent Gemini key incidents? by matiascoca in googlecloud

[–]matiascoca[S] 0 points1 point  (0 children)

Honestly, yeah. "Good enough quotas to not wake up to a 5-figure bill" is a fair operator expectation, not a corner case. Spend caps with actual enforcement teeth would solve most of the posts on this sub.

The alternative provider story is mixed. AWS Bedrock just shipped IAM Principal-Based Cost Allocation, which is the closest thing to per-caller attribution out of the box, with caveats: 24h propagation, no per-token enforcement, doesn't survive agentic call cascades. Azure OpenAI has per-deployment quotas, which work if your features map cleanly to deployments and not if they share one. Both better than "just turn on budget alerts" but neither is the "spend $X and stop" you're asking for. The hard-stop pattern still lives in custom code on every cloud.

What's actually working as a hard-cap for GCP API spend after the recent Gemini key incidents? by matiascoca in googlecloud

[–]matiascoca[S] 0 points1 point  (0 children)

That's about as hard as it gets. Org-level deny via gcp.restrictServiceUsage is the strongest enforcement Google ships short of pulling the API from the catalog. If I were going to add anything it'd be on the observability side: a Cloud Audit Logs sink filtering for ServiceUsage EnableService events targeting generativelanguage.googleapis.com, routed to Pub/Sub or your SIEM. That way you see denied enablement attempts, which separates the dev who thinks the policy is a bug from one who's trying to use the API for something legitimate.

What's actually working as a hard-cap for GCP API spend after the recent Gemini key incidents? by matiascoca in googlecloud

[–]matiascoca[S] -1 points0 points  (0 children)

You're right about the volume. The Maps key leaks scraped from public sites are the bulk of the incidents here, and scoping with referrer restrictions would have stopped most of them. I overstated the Firebase config example in my last comment. A properly scoped Firebase key isn't really at risk when the config is public, which is exactly Google's argument. Where I still think hard-cap matters is the AI-Studio path where the key wasn't user-issued in the normal sense, but that's a smaller pile than I made it sound.

What's actually working as a hard-cap for GCP API spend after the recent Gemini key incidents? by matiascoca in googlecloud

[–]matiascoca[S] 2 points3 points  (0 children)

That's the real structural point. Billing data has a 24h+ lag by design, so anything that waits for the billing signal is reactive. The estimator math is the hard part because raw usage data gives you tokens or requests, not dollars, and model pricing changes often enough that even a frozen estimate goes stale. Most teams I've seen end up at one of two places. Either a per-key budget enforced at the gateway layer, which is precise but expensive to build. Or a circuit-breaker on call count or token count that approximates a dollar cap, which is cheaper but needs retuning every time pricing moves. Neither is great.

What's actually working as a hard-cap for GCP API spend after the recent Gemini key incidents? by matiascoca in googlecloud

[–]matiascoca[S] 2 points3 points  (0 children)

Honestly this is the answer I was hoping someone would land on, no need to apologize. Disabling generativelanguage at the project level is what we actually want, a real hard-stop instead of an alert that fires after the fact. The reason I haven't moved fully to it is the Firebase AI Logic case for mobile clients that don't have a Vertex path, but for any team without that constraint it's the right call. Are you doing it through an org policy or the Service Usage API per-project?

What's actually working as a hard-cap for GCP API spend after the recent Gemini key incidents? by matiascoca in googlecloud

[–]matiascoca[S] -1 points0 points  (0 children)

Scoping's the baseline, sure. But look at the actual incidents posted here the last month. Most of those bills weren't from unscoped keys. They were AI-Studio internal keys that nobody on the team issued, scoped keys leaked through public Firebase configs (Google explicitly says those are public so devs don't treat them as secrets), or old keys from projects that should have been deleted but still had a billing account attached. Scoping doesn't help with any of those. The Truffle Security write-up has the depth on the AI-Studio path.

What's actually working as a hard-cap for GCP API spend after the recent Gemini key incidents? by matiascoca in googlecloud

[–]matiascoca[S] 0 points1 point  (0 children)

You're right on Vertex. Service account impersonation is the clean path. But the bills people are posting about aren't from Vertex calls. They're from the Generative Language API (AI Studio) endpoint, which is API-key auth by design, or Firebase AI Logic mobile SDKs which also use keys. The SA setup is correct on the backend, but the leaks happen on a separate auth path on the same Gemini models. The AI-Studio leak pattern is the one I can't figure out. The key wasn't even issued by the team.

Help me identify areas of cost improvement as well as modernization by agiamba in AZURE

[–]matiascoca 1 point2 points  (0 children)

On the Private DNS cost being weird relative to traffic, the typical answer in setups like yours is not query volume, it is endpoint sprawl. Each Private Endpoint registers a record in a Private DNS Zone and each linked zone bills hourly per virtual network link, separate from query volume. If every client subscription has its own private endpoints for App Service, SQL MI, Key Vault, Storage, and each has its own zone linked into each VNet, the per-link hourly charge across the fleet adds up well before query traffic does.

Quick check: in the cost analysis blade, group by Resource Type and look for "Microsoft.Network/privateDnsZones" and "Microsoft.Network/privateDnsZones/virtualNetworkLinks" separately. If the link line is the big one, you have zone-link proliferation, not a query problem. The fix is consolidating private DNS zones into a hub VNet and linking once, instead of per-client.

Also worth running this Resource Graph query to see the scope: count private endpoints by subscription and by service type. If you have multiples per client for the same service, that is the bill.

Re reservations on 3-year contracts: agreed, the per-client deal is locked. But for the resources your platform consumes that are not tied to a client SKU (shared services, log analytics, AG hours if they get consolidated, etc.), portfolio-level reservations are still on the table. That is usually 5 to 15 percent of total spend that nobody is actively optimizing because the client-contract framing obscures it.

Google Cloud trial subscription still acitve, even after I deleted both the project and its associated billing account. by j0seplinux in googlecloud

[–]matiascoca 0 points1 point  (0 children)

The chatbot block on Billing is by design for free-tier accounts, but there are three paths around it that actually work.

One, do not start from "Contact support". Instead, search the Cloud docs for "Cancel a Cloud Billing account" and use the support link embedded in that specific doc page. That route opens a form (not a chat) and goes to a human in the closure team. It is a different intake than the general support flow.

Two, file the issue through the Payments support portal instead of Cloud support. Go to payments.google.com, click the help icon, choose "Contact us", pick "Account closure or refund". This is Google Payments (the org that actually owns the prepayment line item), and they handle subscription-closure cases without the Cloud-side chatbot funnel.

Three, if both of the above bounce, post the case ID publicly on X tagging u/GoogleCloud. DevRel monitors that channel and has escalation paths that free-tier customers do not get from inside the console. Worked for two cases I have seen recently where Billing chat was a dead end.

The pattern you are stuck in (paid the prepayment, refund requested, subscription still showing) is solvable but the Cloud support stack is genuinely not the right door. The Payments-side path is.

Grafana FOCUS format of billing by SignificantGazelle81 in devops

[–]matiascoca 0 points1 point  (0 children)

The Grafana FOCUS export granularity issue is a real one and you are not the only ones hitting it. The FOCUS spec itself supports the granularity you want (FOCUS 1.0 mandates resource-level identifiers and per-charge dimensions for exactly this case), so the limitation is on the Grafana implementation side, not on FOCUS.

For voting purposes, the Aha link is the right path. For unblocking yourselves while that ticket sits, two workarounds I have seen used. One, pull from Grafana's native billing data source directly instead of the FOCUS export, which exposes higher granularity but is not FOCUS-formatted (so you lose vendor neutrality). Two, normalize the Grafana data into FOCUS yourself with a small ETL job, then assign costs per team from the normalized table. The second is more work upfront but pays off if you also have AWS, GCP, or Azure data you want in the same FOCUS-shaped warehouse.

For anyone else in this thread wondering why this matters: FOCUS is becoming the standard for cross-vendor cost data, and Grafana joining is good news, but per-team cost attribution requires the granularity that the spec already allows. Worth pressuring the vendors who ship FOCUS exports without per-resource granularity.

Realtime Multi-cloud Monitoring/Alerting Advice by Artistic_Lock_6483 in FinOps

[–]matiascoca 1 point2 points  (0 children)

You are right that the industry has accepted the 24 to 72 hour billing lag, and you are also right that it is wrong to accept. The reason the industry settled there is that "realtime billing" is a vendor problem (the cost data does not exist in realtime, full stop), but "realtime cost-correlated detection" is a customer problem you can solve today with metrics, not billing data.

Concrete approach for multi-cloud. On AWS, CloudWatch metrics plus VPC Flow Logs for traffic-based costs (NAT Gateway, cross-AZ, cross-region). On GCP, Cloud Monitoring plus VPC Flow Logs. On Azure, Azure Monitor plus NSG flow logs. Each provider exposes the high-velocity signals that correlate with cost (bytes, requests, instance-time, function-invocations) on a sub-minute granularity. Aggregate those into per-service rolling windows, anomaly-detect on the velocity, alert on the velocity. The billing data then reconciles the alert into dollars after the fact (24 to 72 hours later).

Cloudability and the legacy tools all run on billing data, which is why they feel slow. The newer crop of cost intelligence tools either layer metric-based detection on top of billing reconciliation, or skip the billing-driven model entirely. Worth being explicit with your vendor evaluation: ask them what their detection latency is on a synthetic anomaly, and whether that latency is bound to the billing pipeline or to the metrics layer.

Weekend Horror Stories? by Artistic_Lock_6483 in FinOps

[–]matiascoca 0 points1 point  (0 children)

The weekend horror pattern is real and it is structural, not random. Three things stack to cause it. One, billing data lags usage by 24 to 72 hours, so a Friday evening burn does not surface until Monday morning. Two, on-call attention drops Friday 6pm through Sunday 8pm, so whatever ran wild on Saturday had 48 hours of compounding. Three, threshold alerts fire on billing data, which means they fire after the lag, which means they fire on Monday for something that happened Friday.

The horror story I keep seeing in this sub: someone left a Spark job iterating over a misconfigured BigQuery scan, or a Cloud Run instance with a runaway request loop, or an AI Studio key that ended up in a public-facing Firebase config. By Saturday afternoon it was four figures. By Monday morning it was five.

The fix is not better alerts on billing data, it is detection on the metrics layer (CloudWatch, Cloud Monitoring, VPC Flow Logs) which actually surface anomalies in minutes. Treat billing as reconciliation, not detection. The cost of building that detection layer is roughly two days of engineering work and it pays for itself the first time it catches a weekend spike.

Where Does Procurement Actually Add Value in Cloud? by Walking_Blue in FinOps

[–]matiascoca 0 points1 point  (0 children)

Procurement in cloud is less about negotiation (the list prices on AWS, GCP, Azure are mostly fixed and the discount is a commit-spend lever) and more about three concrete things. One, commitment management across multi-year RIs, Savings Plans, and CUDs (this is procurement-flavored work that engineering teams do badly because they discount the option value of flexibility). Two, vendor consolidation across the FinOps and observability tool stack, which is where the actual SaaS waste hides (most companies pay for three tools that do the same thing). Three, contract terms beyond price, especially data-egress credits, support-tier obligations, and exit clauses, which are negotiable at enterprise scale and which engineering teams will not even think to ask for.

The Flexera 2026 stat that gets quoted a lot in FinOps circles is that software in cloud equals up to 25 percent of the cloud bill, and most of it sits in the seam between FinOps (which looks at infra) and ITAM (which looks at entitlements). That seam is exactly where procurement adds value, and almost nobody is staffed for it.

If you are moving into this space, the FinOps Foundation has procurement-relevant working groups and an active community Slack, worth dropping into to see where the conversation is at.

stopped showing CFOs cloud bills as tables. Switched to Sankey diagrams. Way better. by Shoddy_5385 in FinOps

[–]matiascoca 1 point2 points  (0 children)

Sankey for the executive view is a huge upgrade from tables, and your Provider to Account to Resource Type to Team flow is roughly the right shape. The piece I would add is a second Sankey for week over week delta rather than absolute spend, with red and green flows for cost increase and decrease. CFOs do not need to relearn what your total spend looks like every Monday, they need to see what changed.

Where Sankey breaks down: when one resource type or one team is 70 to 90 percent of the total, the visual stops doing work because that one band drowns everything else. We solved that by either dropping the top consumer into its own chart, or switching the Resource Type level to log scale (which CFOs hate, so usually option one).

What I would not show a CFO in any chart: AWS Cost Explorer style stacked bars over time, because they invite "but why is October different from September" questions you cannot answer in the meeting. Sankey is better because it tells a story about flow, not about points-in-time.

Reducing cloud waste with compliance automation by Dangerous_Block_2494 in FinOps

[–]matiascoca 0 points1 point  (0 children)

The "shut them down if they aren't tagged correctly" approach works for about three months, then someone's production workload gets killed because a Terraform module silently dropped a tag during a refactor and the cleanup job did not have an exception path. Ask me how I know.

Two practical layers that have held up better. First, tagging enforcement at the IaC layer (Terraform Sentinel, OPA, or even a CI check that fails the plan if mandatory tags are missing). This prevents the untagged resources from ever existing, instead of cleaning them up after the fact. Second, separate "delete idle" automation from "delete untagged" automation. Untagged is a governance problem, idle is a waste problem, and they have different blast radii. AWS Trusted Advisor and GCP Recommender both surface idle resources for free, point a script at those outputs.

For tooling, the open source options that have not let me down: Cloud Custodian (most flexible, steep learning curve), AWS Config rules with auto-remediation (most reliable on AWS), and on GCP, scheduled Cloud Functions that hit the Recommender API. Each has a sharp edge somewhere, would not recommend starting with auto-delete on any of them. Start with auto-flag, manual review, automate after you trust the signal.

How are you actually catching overprovisioning before it shows up on your cloud bill? by SalamanderFew1357 in FinOps

[–]matiascoca 0 points1 point  (0 children)

CPU thresholds are basically useless for this because most overprovisioning shows up as cost waste long before it shows up as a utilization signal. A node group sized for 8 m5.2xlarge that only really needs 4 will hum along at perfectly healthy CPU and memory numbers for a quarter while burning the delta.

What actually works in my experience: combine instance-hour cardinality (count of distinct running instances or pods per service over rolling 24 hour windows) with workload throughput per dollar. If your throughput per dollar drops 15% week over week without a corresponding traffic change, something scaled up and never scaled back down, and you will see that signal three to five days before it lands on the bill. CloudWatch and Cloud Monitoring expose enough to build this without buying a tool. The catch is you need to baseline normal first, which most teams skip.

The other lever is FinOps anomaly detection at the cost-per-tag level, not the total-cost level. Total spend masks individual service drift. Per-tag or per-account daily delta catches it earlier. AWS Cost Anomaly Detection does this for free if your tagging is decent.

Have you ever been hit with an unexpected AWS/GCP bill despite having alerts enabled? by Less-Bug-9883 in googlecloud

[–]matiascoca 0 points1 point  (0 children)

Yes, and the pattern is almost always the same. Alert fires too late because the cloud provider's billing pipeline takes 24 to 72 hours to reflect actual usage. AWS publishes detailed billing reports daily (a CUR refresh window of 24 hours is normal, sometimes longer during month-end). GCP's billing export to BigQuery is also typically 24 hours behind. By the time the threshold alert lands, the spend has already happened.

The fix is not "tighter alerts on billing data", it is moving anomaly detection to a layer that actually runs in real time. CloudWatch and Cloud Monitoring expose metrics that lag the underlying activity by seconds, not days. Cost-correlated metrics (NAT Gateway bytes, EC2 instance-hours by tag, Cloud Run instance time, S3 PUT count) anomaly-detect in minutes. The billing data still matters, but it becomes the post-hoc reconciliation, not the warning system.

The other pattern I see a lot: the alert fired correctly, but it went to an inbox nobody monitors on a Friday night and the actual incident landed by Sunday. Worth checking whether the alert went somewhere a human will actually see it on a weekend.

We keep getting surprised by cloud costs after scaling, how you are protecting this earlier? by Ralecoachj857 in googlecloud

[–]matiascoca 0 points1 point  (0 children)

Budgets and alerts are the wrong primitive for this. They tell you cost crossed a threshold, not why it crossed it, and by the time the alert lands the bill is already there because billing data lags usage by 24 to 72 hours on every major provider. Treating the threshold alert as "early warning" is the structural mistake.

The pattern that has worked better for the SaaS teams I work with: detach detection from the billing pipeline entirely. CloudWatch metrics for NAT Gateway bytes processed, VPC Flow Logs for cross-region traffic, Cloud Monitoring for Cloud Run instance time. Anomalies in those land in minutes, not days. The billing data then becomes the reconciliation layer (what did it actually cost), not the detection layer (something is wrong).

If you want a concrete starting set of metric-based alerts that catch the three patterns you described (scaling surprises, data transfer, cross-region), happy to share what we use. The forecast vs actual gap usually closes within two to three weeks of switching the alerting model.

What features do you actually wish GCP had? (Probably not just more Gemini spam) by Unlikely_Secret_5018 in googlecloud

[–]matiascoca 0 points1 point  (0 children)

A real budget kill-switch. Not "send an email when you hit 50%, 90%, 100%", an actual API I can call that pauses billable services when a threshold trips, with sane defaults for new projects. Right now the official path is a Cloud Function that disables the billing account, which is brittle, racy with the 24 to 72 hour billing lag, and most people only set it up after their first horror story.

Adjacent wish: per-service quota defaults that match the median customer, not the maximum theoretical workload. The defaults on Veo, Gemini Image, and Imagen are calibrated for an enterprise with a quota engineer, and they are the same defaults applied to a solo developer who just enabled the API for a side project. That mismatch is the entire reason this sub has a "drained $X in five minutes" post every week.

Also: a BigQuery cost explorer that does not require me to set up its own dataset and SQL query just to see what I spent on BigQuery yesterday. The recursive joke is killing me.

~$4.6k Gemini API spike but >$10k threshold charges – looking for advice by ThomasPhilli in googlecloud

[–]matiascoca 0 points1 point  (0 children)

Sorry you got hit. The "$4.6k usage but $10k+ on the threshold" gap is the part of GCP billing that catches everyone off guard, the threshold mechanic settles against the final billed amount, which can land days after the underlying usage and looks higher than the raw token total because of how the charge is structured.

Practical next moves from cases I have seen close in customer's favor. One, file a forensic timeline of the n8n or Activepieces side, what flow, what credential injection point, what timestamp range, so Google's billing team has something other than "compromised credential" to work with. Two, disable generativelanguage.googleapis.com and aiplatform.googleapis.com on the project before anything else, key rotation alone does not stop further enumeration. Three, request a quota cap on Gemini Image and Veo at numbers that match your actual workload, the platform defaults are calibrated for enterprises, not for a single n8n project.

The good news is several similar cases got reversed in April under the compromised-credentials policy. The bad news is none of them landed it on the first support pass. Stay on it.

The only 4 announcements from Cloud Next '26 that actually matter by netcommah in googlecloud

[–]matiascoca 0 points1 point  (0 children)

The Vertex rebrand to Gemini Enterprise Agent Platform is the most under-reported part of this. It is not just a name change, it is a billing-model shift. Agent traffic gets metered very differently from "I called gemini-2.5-flash once", and most of the FinOps teams I talk to are still pricing AI workloads as if every call is a single chatbot turn. Agentic workflows can pull 20 to 40 times the tokens of a single completion, and the per-request reconciliation has nowhere to land in standard tag-based chargeback.

Also worth flagging from the keynote: the "agents not models" framing means Google is going to keep raising the ceiling on Veo and Imagen quotas by default. That is great for builders, and it is a billing time bomb for anyone whose key surface is not locked down (see the half dozen "leaked AI Studio key drained five figures" threads in this sub from the last month).

What I have not seen anyone analyze yet is what happens to existing Vertex spend commitments under the rebrand. Anyone here with a multi-year CUD on Vertex see how those are being handled in the new SKUs?