Snowflake Budgets and Cost Anomalies: Catch Spend Early
Set up Snowflake account and custom budgets, tag-based limits, threshold actions and cost anomaly alerts so a runaway pipeline shows up in days, not invoices.
By Dinesh ChandraSenior Data and AI Engineer · SnowPro certified- 1.Resource monitors only see warehouses. Budgets also cover serverless spend such as auto-clustering, Snowpipe, serverless tasks and QAS.
- 2.A budget limit alerts; it does not stop spend. Attach a custom action if you want something to happen at a threshold.
- 3.Build custom budgets on object tags, so new warehouses and pipes join the right budget when they are tagged.
- 4.Cost anomaly detection is GA and needs about 30 days of history. Route the emails to someone who will open them.
- 5.Budgets refresh within about 6.5 hours by default. The one-hour low-latency tier multiplies the budget's own compute cost by 12.
Table of contents
- The problem
- The common wrong approach
- The approach that works
- Step 1: check the account parameters budgets depend on
- Step 2: activate the account budget
- Step 3: send notifications somewhere real
- Step 4: create custom budgets on tags
- Step 5: attach an action at a threshold
- Step 6: turn on anomaly alerts
- Step 7: find the cause of a flagged day
- Edge cases and changes
- Trade-offs
- Pitfalls
- FAQ
- Do budgets replace resource monitors?
- Do budgets cost credits?
- Which services can a custom budget track?
- Why did a big spike not trigger an anomaly?
- Can a budget call Slack or Teams directly?
- What this means for your pipelines
Most Snowflake cost surprises are found the same way: someone opens the monthly invoice, sees a number that is too big, and starts a spreadsheet. By then the runaway task has been running for three weeks.
Snowflake now gives you two tools to find that task in days instead. Budgets forecast your monthly spend and notify you when the forecast crosses a limit. Cost anomaly detection compares each day’s consumption with an expected range and flags the days that fall outside it. Both work without a third-party tool, and both cover serverless features that a resource monitor never sees.
This post sets up an account budget, a tag-based custom budget per team, an automatic action at 90% of actual spend, and anomaly alerts. It pairs with the cost optimization guide, which covers how to spend less; this one covers how to notice sooner.
The problem
Credits leak from places nobody watches. A Dynamic Table with a one-minute lag, automatic clustering on a table that is rewritten every hour, a Snowpipe pointed at a bucket that started receiving millions of tiny files, a serverless task retrying all weekend. None of these run on the warehouse your resource monitor guards.
You need something that sees all service types, forecasts the month, and tells a named person early enough to act.
The common wrong approach
The usual setup is one resource monitor on the account with a credit quota and a suspend trigger, plus a monthly look at the bill.
Resource monitors are useful: they can suspend warehouses, and they are still the right hard stop for warehouse compute. But they track warehouses only. Serverless features bill outside them. And a quota that suspends every warehouse at 100% is a production outage that you scheduled yourself.
The other common mistake is building a cost dashboard and no alert. Dashboards are read when someone is already worried.
The approach that works
Step 1: check the account parameters budgets depend on
Budgets require AUTOCOMMIT unset or TRUE, and TIMESTAMP_INPUT_FORMAT
and DATE_INPUT_FORMAT unset or AUTO, at the account level. Session
settings do not matter here.
show parameters like 'AUTOCOMMIT' in account;
show parameters like 'TIMESTAMP_INPUT_FORMAT' in account;
show parameters like 'DATE_INPUT_FORMAT' in account;
Step 2: activate the account budget
The account budget watches all credit usage in the account. Give a
dedicated role the BUDGET_ADMIN application role rather than running
everything as ACCOUNTADMIN:
use role accountadmin;
create role if not exists account_budget_admin;
grant application role snowflake.budget_admin to role account_budget_admin;
grant imported privileges on database snowflake to role account_budget_admin;
call snowflake.local.account_root_budget!activate();
call snowflake.local.account_root_budget!set_spending_limit(1000);
The limit is in credits per calendar month (UTC). Set it from last month’s actuals plus planned growth, not from the contract value; the Snowflake cost calculator helps when you are estimating a new workload. Activating mid-month backfills the account budget from the first of the month.
Step 3: send notifications somewhere real
Email recipients must be verified users in the account. Create an email
notification integration, let the SNOWFLAKE application use it, and
attach it:
create notification integration budgets_email_int
type = email
enabled = true
allowed_recipients = ('finops@example.com', 'data-platform@example.com');
grant usage on integration budgets_email_int to application snowflake;
call snowflake.local.account_root_budget!set_email_notifications(
'budgets_email_int',
'finops@example.com, data-platform@example.com'
);
Budgets can also notify a cloud queue (Amazon SNS, Azure Event Grid,
Google Cloud Pub/Sub) or a webhook for Slack, Microsoft Teams or
PagerDuty through ADD_NOTIFICATION_INTEGRATION. A Teams channel that
the on-call engineer watches beats an inbox nobody owns.
Step 4: create custom budgets on tags
Custom budgets watch a group of objects. Group them by tag so ownership follows the tag, not a list someone has to maintain:
create tag if not exists cost_mgmt_db.tags.cost_center
allowed_values 'data_platform', 'analytics', 'finance';
alter warehouse etl_wh set tag cost_mgmt_db.tags.cost_center = 'data_platform';
alter warehouse transform_wh set tag cost_mgmt_db.tags.cost_center = 'data_platform';
Grant a budget owner the rights to create budgets in a schema, then create the budget and attach the tag value:
create role if not exists budget_owner;
grant usage on database budgets_db to role budget_owner;
grant usage on schema budgets_db.budgets to role budget_owner;
grant database role snowflake.budget_creator to role budget_owner;
grant create snowflake.core.budget on schema budgets_db.budgets to role budget_owner;
grant applybudget on tag cost_mgmt_db.tags.cost_center to role budget_owner;
use role budget_owner;
use schema budgets_db.budgets;
create snowflake.core.budget data_platform_budget();
call data_platform_budget!set_spending_limit(400);
call data_platform_budget!add_resource_tag(
select system$reference('TAG', 'cost_mgmt_db.tags.cost_center', 'SESSION', 'applybudget'),
'data_platform'
);
call data_platform_budget!set_email_notifications(
'budgets_email_int',
'data-platform@example.com'
);
Resources added by tag are backfilled for the current month; resources
added one by one with ADD_RESOURCE are not, so tag-based budgets also
forecast better in their first month. An account can hold up to 100
custom budgets.
Step 5: attach an action at a threshold
A budget only alerts. If you want something to happen, register a stored procedure as a custom action. It must run with owner’s rights, finish within 30 minutes, and be safe to run twice, because Snowflake retries a failed action once.
create or replace procedure ops_db.finops.suspend_warehouse(wh_name string)
returns string
language sql
execute as owner
as
$$
begin
let stmt string := 'alter warehouse if exists ' || wh_name || ' suspend';
execute immediate :stmt;
return 'suspended ' || wh_name;
exception
when other then
return 'not suspended: ' || sqlerrm;
end;
$$;
grant usage on database ops_db to application snowflake;
grant usage on schema ops_db.finops to application snowflake;
grant usage on procedure ops_db.finops.suspend_warehouse(string) to application snowflake;
call budgets_db.budgets.data_platform_budget!add_custom_action(
system$reference('PROCEDURE', 'ops_db.finops.suspend_warehouse(string)'),
array_construct('ADHOC_WH'),
'ACTUAL',
90
);
The exception handler makes it idempotent: suspending an already
suspended warehouse returns a message instead of failing. Point actions
at sandbox and ad hoc warehouses, not at the pipeline that feeds the
board report. Re-grant USAGE on the procedure to the application every
time you replace it. A budget holds up to 10 custom actions; actions on
projected spend run at most once a day, and actions on actual spend at
most once a month.
Step 6: turn on anomaly alerts
Cost anomaly detection is always on at the account and organization level. Tell it who to email:
call snowflake.local.anomaly_insights!set_account_notification_emails(
'finops@example.com, data-platform@example.com'
);
Each call replaces the list, and unverified addresses are ignored. To review flagged days in credits:
call snowflake.local.anomaly_insights!get_account_anomalies_in_credits(
'2026-10-01', '2026-11-12'
);
Or read the Account Usage view, which lags by up to 8 hours:
select
date,
actual_value,
forecasted_value,
upper_bound,
lower_bound
from snowflake.account_usage.anomalies_daily
where is_anomaly
order by date desc;
Step 7: find the cause of a flagged day
An anomaly tells you which day, not which object. Break the day down by service type, then by warehouse:
select
service_type,
sum(credits_used) as credits
from snowflake.account_usage.metering_daily_history
where usage_date = '2026-11-10'
group by service_type
order by credits desc;
select
warehouse_name,
sum(credits_used) as credits
from snowflake.account_usage.warehouse_metering_history
where start_time >= '2026-11-10'::timestamp_ltz
and start_time < '2026-11-11'::timestamp_ltz
group by warehouse_name
order by credits desc;
For the custom budget, GET_SPENDING_HISTORY returns spend by date and
service type:
call budgets_db.budgets.data_platform_budget!get_spending_history(
time_lower_bound => dateadd('days', -7, current_timestamp()),
time_upper_bound => current_timestamp()
);
Edge cases and changes
- Refresh lag. Budgets refresh within up to 6.5 hours by default. The low-latency tier (one hour) multiplies the budget’s own compute by 12; the docs’ example is a budget using 1 credit a month that would use 12. Use it on the one budget that guards something volatile.
- History requirement. Anomaly detection needs at least 30 days of consumption, and it does not flag changes when the last seven days totaled under 10 credits. New accounts get no anomalies for a month.
- Organization view. Organization-level anomalies aggregate all accounts, so a spike in one account and a dip in another can cancel out. Check account-level results too.
- Anomaly monitors are preview. Custom anomaly scopes built from tags and service types (up to 20 per account, email only) are in preview. Notification integrations for account and organization anomalies became GA in mid-2026.
- Replication and hybrid tables. Budget instances are not replicated, and hybrid tables are not supported for budget monitoring.
Trade-offs
Budgets are forecasts, not brakes. They give early notice across every service type, but the hard stop is still a resource monitor on the warehouses or an action you write yourself. Custom actions are powerful and easy to misuse; a procedure that suspends a production warehouse at 90% is an outage you approved in advance.
Anomaly detection needs no thresholds, which is its strength and its limit. It learns your normal, so a slow upward creep looks normal after a few weeks. Budgets catch the creep; anomalies catch the spike. Run both.
Pitfalls
- Treating the limit as a cap. Fix: add a custom action or a resource monitor where spend must actually stop.
- Untagged objects. Fix: tag warehouses, pipes and tasks at
creation and audit untagged objects weekly in
TAG_REFERENCES. - Unverified email addresses. Fix: verify each recipient first; the setup fails or silently skips unverified addresses.
- Account parameters set years ago for an old tool. Fix: check
AUTOCOMMITand the two input-format parameters before activating budgets. - Alerts to a personal inbox. Fix: send to a team list or a webhook into the on-call channel.
FAQ
Do budgets replace resource monitors?
No. Budgets forecast and alert across all service types. Resource monitors enforce credit quotas on warehouses and can suspend them. Use budgets for visibility and resource monitors as the hard stop for warehouse compute.
Do budgets cost credits?
Yes. The background monitoring uses compute, which the docs call the budget’s own compute cost. The low-latency tier costs 12 times the default tier, so keep the default refresh unless you need hourly checks.
Which services can a custom budget track?
Supported services include warehouses, automatic clustering, Snowpipe, Snowpipe Streaming, serverless tasks, Query Acceleration and replication, each mapped to an object type such as warehouse, table, pipe or task. Telemetry ingestion is supported only by tag on event tables.
Why did a big spike not trigger an anomaly?
Either the account has less than 30 days of history, the previous seven days were under 10 credits, or you were looking at the organization view, where another account’s dip offset it. Check the account-level results.
Can a budget call Slack or Teams directly?
Yes, through a webhook notification integration added with
ADD_NOTIFICATION_INTEGRATION. Email, cloud queues and webhooks are all
supported for budgets.
What this means for your pipelines
Every pipeline should land in a budget by tag on the day it is created. Put the tag in the same Terraform or migration script as the warehouse, pipe or task, so a new workload cannot run untracked. Route budget and anomaly notifications to the channel your on-call engineer watches, and keep resource monitors for the warehouses that must never exceed a quota.
Then review weekly: one query for flagged anomaly days, one call to
GET_SPENDING_HISTORY per team budget. A five-minute habit catches the
serverless task that would otherwise run until the invoice arrives.
Sources: Budgets overview, Account budget, Custom budgets, Budget notifications, Custom actions for budgets, GET_SPENDING_HISTORY, Cost anomalies, GET_ACCOUNT_ANOMALIES_IN_CREDITS, SET_ACCOUNT_NOTIFICATION_EMAILS, ANOMALIES_DAILY view, 2025 feature updates (cost anomalies GA), 10.26 release notes.
Senior Data & AI Engineer · SnowPro Core & Gen AI Certified
4+ years building production data platforms on Snowflake, Databricks, AWS, and Azure. I write from hands-on experience with Medallion architectures, dbt, Airflow, PySpark, and Snowflake Cortex AI. Every tutorial on this blog reflects real pipeline decisions, not documentation rewrites.
Read more about the author →