Course contents

SnowPro Core COF-C03 Study GuidePart 2: Warehouses and performanceResource Monitors & Budgets

Resource Monitors & Budgets

Resource Monitors & Budgets

Definition

A resource monitor is a credit budget with triggers. It watches credit consumption for one or more warehouses (or the whole account) against a quota over an interval (monthly by default) and fires actions at percentage thresholds: notify, suspend, or suspend immediately. Only ACCOUNTADMIN can create one, though other roles can be granted MONITOR or MODIFY on it.

The three actions

Get the difference between the two suspend flavors exactly right.

  • NOTIFY: sends an alert to account administrators. Nothing else happens. Running queries continue, new queries are still accepted.
  • SUSPEND (shown as "Suspend and Notify" in Snowsight): stops the warehouse from accepting new queries, but lets everything currently running finish. A graceful stop.
  • SUSPEND_IMMEDIATE: cancels every running statement and stops the warehouse on the spot. A hard stop, reserved for the emergency threshold.

So when a question asks what happens to executing queries at a "Notify & Suspend" threshold, the answer is: they are completed, not cancelled, not queued, not restarted.

One resource monitor on a 500-credit monthly quota, read left to right as consumption grows. Up to 80 percent, normal use and no action. At 80 percent, NOTIFY sends an alert and nothing stops. At 100 percent, SUSPEND lets running statements finish and refuses new ones. At 110 percent, SUSPEND_IMMEDIATE cancels running statements. Zones are not drawn to scale.0%80% · 400 cr100% · 500 cr110% · 550 crBELOW 80%Normal useno actionAT 80%NOTIFYalert sentnothing stopsAT 100%SUSPENDrunning ones finishnew ones refusedAT 110%SUSPEND_IMMEDIATErunning statementsare cancelledBetween 100% and 110%, statements still running keep consuming credits.
  1. 0%
  2. BELOW 80%Normal useno action

  3. 80% · 400 cr
  4. AT 80%NOTIFYalert sentnothing stops

  5. 100% · 500 cr
  6. AT 100%SUSPENDrunning ones finishnew ones refused

  7. 110% · 550 cr
  8. AT 110%SUSPEND_IMMEDIATErunning statementsare cancelled

Between 100% and 110%, statements still running keep consuming credits.

Figure 2.7 A resource monitor escalates as consumption grows: NOTIFY only sends alerts, SUSPEND lets running statements finish and refuses new ones, SUSPEND_IMMEDIATE cancels running statements. Resource monitors track warehouse credits only, never serverless or AI consumption.

The escalation only exists because SUSPEND leaks: queries already running at 100% keep burning credits until they finish, which is how consumption reaches 110% at all. The immediate trigger is the backstop for exactly that overrun.

CREATE RESOURCE MONITOR month_guard
  WITH CREDIT_QUOTA = 500
  FREQUENCY = MONTHLY
  START_TIMESTAMP = IMMEDIATELY
  TRIGGERS ON 80  PERCENT DO NOTIFY
           ON 100 PERCENT DO SUSPEND
           ON 110 PERCENT DO SUSPEND_IMMEDIATE;

ALTER WAREHOUSE etl_wh SET RESOURCE_MONITOR = month_guard;

Thresholds above 100% are legal and common: SUSPEND at 100 still lets in-flight queries burn credits past the quota, so a SUSPEND_IMMEDIATE backstop at 110 catches the overshoot.

Cardinality rules

One warehouse can be governed by at most one monitor. One monitor can govern many warehouses. An account can also have one account-level monitor, which watches the credits of all warehouses together. It doesn't replace warehouse-level monitors: both apply, and whichever reaches a suspend threshold first suspends the warehouses it covers. Each monitor takes up to five NOTIFY thresholds plus one SUSPEND and one SUSPEND_IMMEDIATE. Monitors control warehouse credits only; serverless features (Snowpipe, automatic clustering, materialized view refresh) and AI services are outside their reach.

Exam traps
  • "How many resource monitors can be applied to a single warehouse?" One. The reverse is up to 500 warehouses per monitor, and the exam swaps the direction to catch skimmers.
  • Creation requires ACCOUNTADMIN. SECURITYADMIN and SYSADMIN are distractors.
  • A monitor hitting its quota does not cancel queries unless the trigger is SUSPEND_IMMEDIATE.
Key takeaways
  • NOTIFY warns, SUSPEND drains then stops, SUSPEND_IMMEDIATE kills.
  • Warehouse→monitor is many-to-one. ACCOUNTADMIN creates.
  • Serverless credits escape resource monitors.

Budgets

In plain words: a budget is a spending alarm, not a circuit breaker. You create one, give it a monthly limit in credits, and attach what it should watch: the whole account, or a hand-picked group of objects. The power is in what it can see. A resource monitor only sees warehouse credits, but at IsmaFrost the real bill also includes Snowpipe ingesting all night, automatic clustering reorganizing the fact table, and materialized view maintenance, none of which runs on a warehouse Youness controls. A budget watches all of it in one place, forecasts where the month is heading, and emails when the projection crosses the limit. It has no built-in suspend action, which is also why it's safe to put on production pipelines: the alarm rings and nothing stops unless you attach a custom action (a stored procedure you write) that does something more.

Resource monitors watch warehouse credit consumption and can suspend warehouses. Budgets are broader: a budget sets a monthly spending limit in credits on an account or on a custom group of objects (warehouses, but also serverless features like Snowpipe, automatic clustering, materialized view maintenance and serverless tasks; a task that names a warehouse bills on that warehouse), and sends notifications when spend is projected to exceed the limit. Budgets have no built-in suspend action; they notify (email, cloud queue or webhook) and can call a stored procedure as a custom action. That's the exam distinction:

Resource monitorBudget
WatchesWarehouse (and account) credit usageAny supported objects, including serverless spend
Can suspend computeYes (Suspend / Suspend Immediately)No built-in action; notifies, and can run a custom stored procedure
CycleConfigurable frequency and start dateCalendar month
Serverless costsNot coveredCovered
What each cost control can see and do. On the left, three sources of spend: warehouses, serverless features and AI services. Warehouse credits are tracked by both a resource monitor and a budget. Serverless and AI spend are tracked only by the budget, and are invisible to resource monitors. A resource monitor can notify, suspend after running statements finish, or suspend immediately. A budget notifies by email, cloud queue or webhook and can call a stored procedure as a custom action.WHAT SPENDSWHAT WATCHESWHAT IT CAN DOCOMPUTEWarehousesBI_WH, ELT_WH…FEATURESServerlessSnowpipe, clustering,MV, SOS, QAS, tasksAIAI servicesCortex functions…CONTROLResource monitorwarehouses onlyCONTROLBudgetmonthly · accountor custom groupMONITOR ACTIONSNotify or suspendSUSPEND: running ones finishSUSPEND_IMMEDIATE: cancelBUDGET ACTIONSNotify, no suspendemail, cloud queue, webhookor a stored procedureyou write (custom action)serverless and AI spendare invisible to monitors What each cost control can see and do. On the left, three sources of spend: warehouses, serverless features and AI services. Warehouse credits are tracked by both a resource monitor and a budget. Serverless and AI spend are tracked only by the budget, and are invisible to resource monitors. A resource monitor can notify, suspend after running statements finish, or suspend immediately. A budget notifies by email, cloud queue or webhook and can call a stored procedure as a custom action.WHAT SPENDSCOMPUTEWarehousesBI_WH, ELT_WH…FEATURESServerlessSnowpipe, clustering,MV, SOS, QAS, tasksAIAI servicesCortex functions…WHAT WATCHESCONTROLResource monitorwarehouses onlyserverless and AI spendare invisible to monitorsCONTROLBudgetmonthly · accountor custom groupWHAT IT CAN DOMONITOR ACTIONSNotify or suspendSUSPEND: running ones finishSUSPEND_IMMEDIATE: cancelBUDGET ACTIONSNotify, no suspendemail, cloud queue, webhookor a stored procedureyou write (custom action)
Figure 2.8 Resource monitors see only warehouses; budgets see all spend but can't suspend anything. Follow each source to the controls that track it, then to what each control can do. A budget has no built-in suspend action, but notifies and can call a stored procedure you write as a custom action.

The syntax is the giveaway that budgets aren't resource monitors: a budget is an instance of a Snowflake class, so you create it like an object and configure it by calling methods on it with !.

-- Create a custom budget (a schema-level object)
CREATE SNOWFLAKE.CORE.BUDGET marketing_budget();

-- Set the monthly limit, in credits
CALL marketing_budget!SET_SPENDING_LIMIT(500);

-- Attach what it watches: warehouses, pipes, tables with serverless features
CALL marketing_budget!ADD_RESOURCE(
  SELECT SYSTEM$REFERENCE('WAREHOUSE', 'ETL_WH', 'SESSION', 'applybudget'));
CALL marketing_budget!ADD_RESOURCE(
  SELECT SYSTEM$REFERENCE('PIPE', 'raw.events_pipe', 'SESSION', 'applybudget'));

The account-level budget (the one watching everything) isn't created this way at all: it ships with the account and just gets activated once, in Snowsight under Admin → Cost Management. Compare all of this with the plain CREATE RESOURCE MONITOR ... WITH CREDIT_QUOTA = ... TRIGGERS ... above and the two objects stop being confusable.

Exam trap

"How do you control Snowpipe or automatic clustering spend?" A resource monitor is the wrong answer: those are serverless costs, and resource monitors only govern warehouses. Budgets monitor them. There's no built-in hard stop for serverless spend: a budget notifies (email, cloud queue or webhook) and can run up to 10 custom actions, each a stored procedure you write, triggered when projected or actual spend crosses a percentage of the limit. The procedure decides what to change.