India’s Leading Domain & Web Hosting Provider
Marketing analytics agency caps runaway BigQuery scans across 70 client projects
Mumbai agency with 70 client projects and 110 analysts on Google Cloud · Google Cloud Mumbai (asia-south1) · 7 weeks
As-is situation
Each client had its own Google Cloud project, billed back at cost plus a margin. Analysts ran ad hoc queries on BigQuery on-demand pricing, and data engineers ran Dataflow pipelines per client. In one month, a junior analyst's scheduled query joined two unpartitioned clickstream tables every 15 minutes, scanning 1.1 PB, and a streaming Dataflow job left running after a campaign ended. Together they added ₹19 lakh to a normal ₹28 lakh bill. The agency discovered it from the invoice and could not bill the client for its own mistake.
- One account-level budget for 70 projects, alerting a finance mailbox at 100% of actuals.
- No limits on bytes scanned per analyst or per project.
- Abandoned streaming jobs ran until someone noticed, with no usage alarms.
Approach, tools and architecture
NTSPL set budgets per client project from contracted monthly allowances, with forecast alerts at 80% and 100% published to Pub/Sub. A Cloud Run function enriched each alert with the top jobs and users from the billing export and INFORMATION_SCHEMA, then posted it to the client team's Slack channel. BigQuery custom quotas limited query bytes per user per day and per project per day. Cloud Monitoring alarms flagged Dataflow jobs with no input for six hours. A BigQuery ML ARIMA_PLUS model ran daily anomaly detection on each project's cost.
Implementation approach
Measured results
Operational improvements
- Client teams see their project's spend against allowance mid-month and can warn clients before overage.
- Quota hits now prompt analysts to partition tables, improving query habits across the agency.
Cost considerations
The enrichment function, alarms and daily model cost under ₹8,000 a month. Custom quotas occasionally blocked legitimate large backfills, handled by a temporary quota increase request approved by a team lead within an hour. No third-party tool was needed.
Return on investment
Avoiding a single repeat of the ₹19 lakh incident repays the setup many times. Mid-month visibility also let account managers raise contracted allowances for four clients, adding recurring revenue the agency had previously absorbed as overrun.