Cost Governance 2.0: Setting up Budgets
Move from reactive monitoring to proactive control. How to implement Snowflake Budgets and granular resource monitors for 2025.
Happy end of January! It’s that time of year when annual budgets are finalized, and finance teams start sending emails asking, “Why did our cloud spend spike on January 3rd?” (Answer: We were testing AI models, sorry!).
Cost governance in Snowflake has evolved. We used to rely solely on Resource Monitors, which are great but blunt instruments. In 2025, we have the Budgets feature, which provides a more intelligent, alert-driven approach. Let’s look at how to set up Cost Governance 2.0.
The Old Way: Resource Monitors#
Resource Monitors are still useful. They are the “kill switch”. You set a quota (e.g., 100 credits/month) on a warehouse, and if it hits 110%, the warehouse suspends immediately.
Pros: Hard limit. No surprise bills. Cons: Hard limit. Your ETL pipeline dies halfway through the night run because it hit 100.01%, and now the CEO’s dashboard is empty.
The New Way: Snowflake Budgets#
Budgets (available in Snowsight) works differently. It monitors credit usage of a group of objects (warehouses, databases, tasks) and uses ML to forecast if you are going to exceed your limit.
Instead of just killing the process, it notifies you before you run out of money.
Setting up a Custom Budget#
You can set up a budget for a specific project (e.g., “Marketing Analytics”).
-- 1. Create a Budget
USE SCHEMA SNOWFLAKE.LOCAL;
CREATE BUDGET marketing_budget
SPENDING_LIMIT = 500; -- Credits per month
-- 2. Add Resources to the Budget
CALL marketing_budget!ADD_RESOURCE(
SYSTEM$REFERENCE('WAREHOUSE', 'MARKETING_WH')
);
CALL marketing_budget!ADD_RESOURCE(
SYSTEM$REFERENCE('DATABASE', 'MARKETING_DB')
); -- Tracks storage + serverless tasks in this DBsqlReference vs. Account Budgets#
- Account Budget: Tracks the total spend of the entire Snowflake account. You should have this set up by default notifying the admin team.
- Custom Budgets: Assign specific warehouses to specific teams. This enables Chargeback models (or at least “Shameback” models where you can show a team they blew their budget).
Automated Action with Alerts#
What if you want to be proactive but not destructive? You can combine Alerts with your monitoring queries.
CREATE OR REPLACE ALERT huge_query_alert
WAREHOUSE = ADMIN_WH
SCHEDULE = '1 MINUTE'
IF(EXISTS(
SELECT query_id
FROM snowflake.account_usage.query_history
WHERE execution_time > 3600000 -- 1 hour
AND execution_status = 'RUNNING'
))
THEN
CALL SYSTEM$SEND_EMAIL(
'my_integration',
'admin@dataflakes.dev',
'Long Running Query Alert',
'A query has been running for over 1 hour.'
);sqlBest Practices Checklist for 2025#
- Enable the Account Budget: Set a realistic monthly forecast.
- Tag Resources: Use
ALTER WAREHOUSE ... SET TAG cost_center = 'Marketing'to make reporting easier. - Auto-Suspend Tuning: Ensure all warehouses are set to auto-suspend after 60 seconds (unless you have a specific reason otherwise/caching requirements).
- Statement Timeouts: Set
STATEMENT_TIMEOUT_IN_SECONDSto something reasonable (e.g., 2-4 hours) so a runaway Cartesian join doesn’t run for 24 hours.
Conclusion#
Cost governance isn’t about stopping people from using data; it’s about preventing waste. By moving from simple cut-offs to forecasted budgets, we can enable our teams to experiment with high-power compute (like AI) while ensuring we don’t accidentally bankrupt the department.