Working with Resource Monitors¶
To help control costs and avoid unexpected credit usage caused by running warehouses, Snowflake provides resource monitors. A virtual warehouse consumes Snowflake credits while it runs.
A resource monitor can be used to monitor credit usage by virtual warehouses and the cloud services needed to support those warehouses. If desired, the warehouse can be suspended when it reaches a credit limit.
The number of credits consumed depends on the size of the warehouse and how long it runs.
Limits can be set for a specified interval or date range. When these limits are reached and/or are approaching, the resource monitor can trigger various actions, such as sending alert notifications and/or suspending user-managed warehouses.
Resource monitors can only be created by account administrators (i.e. users with the ACCOUNTADMIN role); however, account administrators can choose to enable users with other roles to view and modify resource monitors using SQL.
Overview¶
Resource Monitor Properties¶
A resource monitor is a first-class object in Snowflake, consisting of the following properties.
Credit Quota¶
Credit quota specifies the number of Snowflake credits allocated to the monitor for the specified frequency interval. Any number can be specified.
In addition, Snowflake tracks the used credits/quota within the specified frequency interval by all warehouses assigned to the monitor. At the specified interval, this number resets back to 0
.
Credit quota accounts for credits consumed by both user-managed virtual warehouses and virtual warehouses used by cloud services.
For example, your resource monitor limit is set at 1000 credits, if your warehouse consumes 700 credits, and cloud services consume 300 credits within a specified interval or date range, an alert will be triggered.
Note
Resource monitor limits do not take into account the daily 10% adjustment for cloud services. Snowflake uses all credit consumption by the cloud services layer to calculate whether a limit has been reached, even if that consumption is never billed. For more information about how cloud services credits and adjustments are calculated, see Understanding Billing for Cloud Services Usage.
For instructions on how to view your cloud services credit usage, see Exploring Compute Cost.
Monitor Level¶
This property specifies whether the resource monitor is used to monitor the credit usage for your entire Account (i.e. all warehouses in the account) or a specific set of individual warehouses.
If this property is not set, the resource monitor doesn’t monitor any credit usage. It simply remains dormant.
Schedule¶
The default schedule for a resource monitor specifies that it starts monitoring credit usage immediately and the used credits reset back to 0
at the beginning
of each calendar month (i.e. the start of the standard Snowflake billing cycle).
However, you can optionally customize the schedule for a resource monitor using the following properties:
- Frequency
The interval at which the used credits reset relative to the specified start date.
Supported values:
Daily
Weekly
Monthly
Yearly
Never (used credits never reset; assigned warehouses continue using credits until the credit quota is reached)
- Start
Date and time (i.e. timestamp) when the resource monitor starts monitoring the assigned warehouses.
Supported values:
Immediately (i.e. current timestamp)
Later (i.e. any future timestamp)
In addition, Snowflake uses this date to determine when to reset the used credits, based on the specified frequency. Note, however, that regardless of the time specified in the start date and time, resource monitors reset at 12:00 AM UTC. For example, if the start is 15-July-2019 (Monday) at 8:00 AM:
Frequency = Monthly: Used credits reset at 12:00 AM UTC on the 15th of each following month.
Frequency = Weekly: Used credits reset at 12:00 AM UTC on each following Monday.
Note that, if you specify the last day of a month as the start date, Snowflake resets the used credits on the last day of all following months, regardless of the number of days in the month. For example, if you set the start date to January 31, Snowflake subsequently resets the used credits for the resource monitor on February 28 (or February 29 in a leap year), March 31, April 30, and so on.
- End
Date and time (i.e. timestamp) when Snowflake suspends the warehouses associated with the resource monitor, regardless of whether the used credits reached any of the thresholds defined for the resource monitor’s actions (see next section in this topic).
Supported values: Any future timestamp.
Note that this property is not commonly used.
Important
If you choose to customize the schedule for a resource monitor, the frequency is relative to the specified start date, which is different than the default schedule.
Also, if you specify a frequency, you must also specify a start date and time, and vice versa (i.e. you cannot set one without setting the other).
Actions¶
Also referred to as triggers, each action specifies a threshold, as a percentage of the credit quota for the resource monitor, and the action to perform when
the threshold is reached within the specified interval. Note that actions support thresholds greater than 100
.
Resource monitors support the following actions:
- Notify & Suspend
Send a notification (to all account administrators with notifications enabled) and suspend all assigned warehouses after all statements being executed by the warehouse(s) have completed.
- Notify & Suspend Immediately
Send a notification (to all account administrators with notifications enabled) and suspend all assigned warehouses immediately, which cancels any statements being executed by the warehouses at the time.
- Notify
Perform no action, but send an alert notification (to all account administrators with notifications enabled).
Each resource monitor can have the following actions:
One Suspend action.
One Suspend Immediate action.
Up to five Notify actions.
Note
A resource monitor must have at least one action defined; if no actions have been defined, nothing happens when the used credits reach the threshold.
Assignment of Resource Monitors¶
A single monitor can be set at the account level to control credit usage for all warehouses in your account.
In addition, a monitor can be assigned to one or more warehouses, thereby controlling the credit usage for each assigned warehouse. Note, however, that a warehouse can be assigned to only a single resource monitor below the account level.
The following diagram illustrates a scenario in which one resource monitor is set at the account level and individual warehouses are assigned to two other resource monitors:

Based on this diagram:
The credit quota for the entire account is 5000 for the interval (month, week, etc.), as controlled by Resource Monitor 1; if this quota is reached within the interval, the actions defined for the resource monitor (Suspend, Suspend Immediate, etc. ) are enforced for all five warehouses.
Warehouse 3 can consume a maximum of 1000 credits within the interval.
Warehouse 4 and 5 can consume a maximum combined total of 2500 credits within the interval.
Note that the actual credits consumed by Warehouses 3, 4, and 5 may be less than their quotas if the quota for the account is reached first.
Important
An account-level resource monitor does not override resource monitor assignment for individual warehouses. If either the account resource monitor or the warehouse resource monitor reaches its defined threshold and a suspend action has been defined, the warehouse is suspended.
An account-level resource monitor does not control credit usage by the Snowflake-provided Compute resources for serverless features (for example, Snowpipe, automatic reclustering, and materialized views). For a full list of features, see Serverless Features.
A warehouse-level resource monitor can monitor, but cannot suspend, credit usage by Cloud Services. After a virtual warehouse is suspended, subsequent queries run against that warehouse can still result in additional cloud services costs. For more details about credit usage for cloud services, see Cloud Service Credit Usage.
Warehouse Suspension and Resumption¶
The used credits for a resource monitor reflects the sum of credits consumed by all assigned warehouses within the specified interval, along with the cloud services used to support those warehouses during the same interval. If a monitor has a Suspend or Suspend Immediately action defined and its used credits reach the threshold for the action, any warehouses assigned to the monitor are suspended and cannot be resumed until one of the following conditions is met:
The next interval, if any, starts, as dictated by the start date for the monitor.
The credit quota for the monitor is increased.
The credit threshold for the suspend action is increased.
The warehouses are no longer assigned to the monitor.
The monitor is dropped.
Tip
Resource monitors are not intended for strictly controlling consumption on an hourly basis; they are intended for tracking and controlling credit consumption per interval (day, week, month, etc.). Also, they are not intended for setting precise limits on credit usage (i.e. down to the level of individual credits). For example, when credit quota thresholds are reached for a resource monitor, the assigned warehouses may take some time to suspend, even when the action is Suspend Immediate, thereby consuming additional credits.
If you wish to strictly enforce your quotas, we recommend the following:
Utilize buffers in the quota thresholds for actions (e.g. set a threshold to 90% instead of 100%).
This will help ensure that your credit usage doesn’t exceed the quota.
To more strictly control credit usage for individual warehouses, assign only a single warehouse to each resource monitor.
When multiple warehouses are assigned to the same resource monitor, they share the same quota thresholds, which may result in credit usage for one warehouse impacting the other assigned warehouses.
Resource Monitor Notifications¶
When a resource monitor reaches the threshold for an action, it generates one of the following notifications, based on the action performed:
The assigned warehouses will be suspended after all running queries complete.
All running queries in the assigned warehouses will be canceled and the warehouses suspended immediately.
A threshold has been reached, but no action has been performed.
The notification is sent to all account administrators who have enabled receipt of notifications and non-administrator users in the notification list.
Important
Notifications can be received by account administrators through the Classic Console and/or email; however, by default, notifications are not enabled:
To receive notifications, each account administrator must explicitly enable notifications through their preferences in the Classic Console. See Enabling Receipt of Notifications for Account Administrators.
In addition, if an account administrator chooses to receive email notifications, they must provide a valid email address (and verify the address) before they will receive any emails.
Notifications for non-administrator users are only available through email.
DDL for Resource Monitors¶
Snowflake provides the following DDL commands for creating and using/managing resource monitors:
In addition, the following DDL commands can be used to assign a resource monitor to a warehouse and view whether a warehouse is assigned to a monitor:
Access Control Privileges for Resource Monitors¶
By default, resource monitors can only be created by account administrators and, therefore, can only be viewed and maintained by them.
However, roles that have been granted the following privileges on specific resource monitors can view and modify the resource monitor as needed using SQL:
MONITOR
MODIFY
For more details, see Access Control Privileges and GRANT <privileges>.
Note that only account administrators can view and manage resource monitors via the Classic Console.
Enabling Receipt of Notifications for Account Administrators¶
As an account administrator, you must enable notifications for yourself in the Classic Console before you can receive any notifications generated by resource monitors.
Before you can enable email notifications, you must verify your email address. See Verifying Your Email Address in the Classic Console.
To enable notifications in the Classic Console:
Use the ACCOUNTADMIN system role. If you aren’t, in the drop-down menu next to your name in the upper-right corner, select Switch role » ACCOUNTADMIN.
In the same drop-down menu, select Preferences » Notifications.
Select one of the options.
Creating Resource Monitors¶
Resource monitors can be created through either the web interface or SQL; however, only account administrators (i.e. users with the ACCOUNTADMIN role) can create resource monitors.
Important
You must assign at least one warehouse to a resource monitor or set the monitor at the account level for it to begin monitoring/tracking credit usage:
In the web interface, you are required to do this at creation time.
In SQL, you must create the resource monitor first, then assign one or more warehouses to it by executing ALTER WAREHOUSE as a separate, additional step.
Also, to receive notifications when resource monitor actions are triggered, you must enable notifications.
Creating a Resource Monitor with a Default Schedule¶
To create a resource monitor that uses the default schedule (i.e. starts monitoring immediately and resets on the first day of each calendar month):
- Classic Console
Use the ACCOUNTADMIN system role.
Click on Account
» Resource Monitors » Create Resource Monitor.
Enter a name and quota.
Specify whether the resource monitor will be used for monitoring your account or individual warehouses.
Enter a threshold for at least one of the suspend actions. You can also specify up to five notify actions that simply send alerts without suspending any warehouses.
- SQL
In SQL, this task is performed in two steps:
Execute a CREATE RESOURCE MONITOR command, but do not specify any scheduling properties.
Execute an ALTER WAREHOUSE command to assign warehouses to the resource monitor or an ALTER ACCOUNT command to set the resource monitor for the account.
For example:
To create a monitor that starts monitoring immediately, resets at the beginning of each month, and suspends the assigned warehouse when the used credits reach 100% of the credit quota:
USE ROLE ACCOUNTADMIN; CREATE OR REPLACE RESOURCE MONITOR limit1 WITH CREDIT_QUOTA=1000 TRIGGERS ON 100 PERCENT DO SUSPEND; ALTER WAREHOUSE wh1 SET RESOURCE_MONITOR = limit1;The SUSPEND action waits for currently-executing queries to finish before suspending the warehouse. This means that a query started before the trigger fires executes to completion and the warehouse consumes credits even after the quota is reached.
To create a monitor that is similar to the first example, but suspends at 90% and suspends immediately at 100% to prevent all warehouses in the account from consuming credits after the quota has been reached:
USE ROLE ACCOUNTADMIN; CREATE OR REPLACE RESOURCE MONITOR limit1 WITH CREDIT_QUOTA=1000 TRIGGERS ON 90 PERCENT DO SUSPEND ON 100 PERCENT DO SUSPEND_IMMEDIATE; ALTER WAREHOUSE wh1 SET RESOURCE_MONITOR = limit1;In this example, a notification is generated and the assigned warehouses are suspended when 90% usage is reached, which prevents the warehouses from executing any new queries, but allows currently-executing queries to complete. If the assigned warehouses reach 100% usage, a notification is generated and the warehouses are suspended immediately, canceling all currently-executing queries.
To create a monitor that is similar to the first example, but lets the assigned warehouse exceed the quota by 10% and also includes two notification actions to alert account administrators as the used credits reach the halfway and three-quarters points for the quota:
USE ROLE ACCOUNTADMIN; CREATE OR REPLACE RESOURCE MONITOR limit1 WITH CREDIT_QUOTA=1000 TRIGGERS ON 50 PERCENT DO NOTIFY ON 75 PERCENT DO NOTIFY ON 100 PERCENT DO SUSPEND ON 110 PERCENT DO SUSPEND_IMMEDIATE; ALTER WAREHOUSE wh1 SET RESOURCE_MONITOR = limit1;In this example:
When 50% and 75% usage is reached, an alert notification is sent to all account administrators who have enabled notifications, but no other actions are performed.
When 100% usage is reached, the assigned warehouse is suspended.
If the warehouse is still running when 110% usage is reached, it is suspended immediately.
Creating a Resource Monitor with a Custom Schedule¶
To create a resource monitor that uses a schedule other than the default:
- Classic Console
Use the ACCOUNTADMIN system role.
Click on Account
» Resource Monitors » Create Resource Monitor.
Enter a name and quota.
Specify whether the resource monitor will be used for monitoring your account or individual warehouses.
In the Schedule field, click the Customize link and specify one or more of the following properties, as desired:
Reset used credits based on the specified frequency.
Start monitoring credit usage immediately or at a later date and time.
Suspend warehouses at the specified end date and time, regardless of whether the credit quota threshold has been reached.
Enter a threshold for at least one of the suspend actions. You can also specify up to five notify actions that simply send alerts without suspending any warehouses.
- SQL
Execute a CREATE RESOURCE MONITOR command, with one or more of the following scheduling properties:
FREQUENCY
START_TIMESTAMP
END_TIMESTAMP
For example:
To create an account-level resource monitor that starts immediately (based on the current timestamp), resets monthly on the same day, has no end date or time, and suspends the assigned warehouse when the used credits reach 100% of the quota:
USE ROLE ACCOUNTADMIN; CREATE OR REPLACE RESOURCE MONITOR limit1 WITH CREDIT_QUOTA=1000 FREQUENCY = MONTHLY START_TIMESTAMP = IMMEDIATELY TRIGGERS ON 100 PERCENT DO SUSPEND; ALTER WAREHOUSE wh1 SET RESOURCE_MONITOR = limit1;
To create a resource monitor that starts at a specific date and time in the future, resets weekly on the same day, has no end date or time, and performs two different suspend actions at different thresholds on two assigned warehouses:
USE ROLE ACCOUNTADMIN; CREATE OR REPLACE RESOURCE MONITOR limit1 WITH CREDIT_QUOTA=2000 FREQUENCY = WEEKLY START_TIMESTAMP = '2019-03-04 00:00 PST' TRIGGERS ON 80 PERCENT DO SUSPEND ON 100 PERCENT DO SUSPEND_IMMEDIATE; ALTER WAREHOUSE wh1 SET RESOURCE_MONITOR = limit1; ALTER WAREHOUSE wh2 SET RESOURCE_MONITOR = limit1;
Note
You cannot change the customized schedule for a resource monitor back to the default. You must drop the monitor and create a new monitor.
Modifying a Resource Monitor¶
You can modify the following properties for an existing resource monitor:
Increase or decrease the credit quota for the monitor.
If the monitor is monitoring your account, convert it to monitor individual warehouses.
If the monitor is monitoring individual warehouses:
Add or remove warehouses from the list.
Convert it to monitor your account.
Customize the schedule (frequency, start timestamp, and end timestamp) for the monitor.
Add or remove actions, or modify the threshold percentages for existing actions.
Note
Changing any of these properties does not affect the used credits to-date for the monitor. All changes only affect used credits after the changes are saved.
Resource monitors can be modified through either the web interface or SQL:
- Classic Console
Using the ACCOUNTADMIN system role:
- SQL
To change the quota, customize the schedule, or add/remove/modify actions:
Using the ACCOUNTADMIN system role or a role that has been granted the MODIFY privilege on the resource monitor, execute an ALTER RESOURCE MONITOR command.
To change the monitoring level:
Using the ACCOUNTADMIN system role, execute an ALTER WAREHOUSE or ALTER ACCOUNT command.
Note that to modify a warehouse, the ACCOUNTADMIN role must also have the MODIFY privilege on the warehouse.
For example, to increase the credit quota for
limit1
to3000
:ALTER RESOURCE MONITOR limit1 SET CREDIT_QUOTA=3000;
Note
If a resource monitor has a customized schedule, you cannot change the schedule back to the default. You must drop the monitor and create a new monitor.
Setting a Resource Monitor for Your Account¶
A resource monitor can be set for your account through either the web interface or SQL:
- Classic Console
The process is the same as creating or modifying a resource monitor (see instructions in this topic).
- SQL
In SQL, this task is performed in two steps:
Use CREATE RESOURCE MONITOR to create the resource monitor (if it doesn’t exist already).
Use ALTER ACCOUNT command to set the resource monitor you created as the monitor for your account.
For example:
USE ROLE ACCOUNTADMIN; CREATE RESOURCE MONITOR accountmax WITH CREDIT_QUOTA=10000 TRIGGERS ON 100 PERCENT DO SUSPEND; ALTER ACCOUNT SET RESOURCE_MONITOR = accountmax;
To view whether a resource monitor is set for your account, use the web interface or the SHOW RESOURCE MONITORS command. The LEVEL
column
for a resource monitor displays whether it is set for your account or individual warehouses.
Important
An account-level resource monitor only controls the virtual warehouses explicitly created in your account; it does not control credit usage by the Snowflake-provided warehouses for serverless features (for example, Snowpipe, Automatic Clustering, and materialized views). For a full list of features, see Serverless Features.
A warehouse-level resource monitor can monitor, but cannot suspend, credit usage by Cloud Services. The monitor can only suspend the user-managed virtual warehouses created in your account. After a user-managed virtual warehouse is suspended, subsequent queries run against that warehouse can still result in additional cloud services costs. For more details about credit usage for cloud services, see Cloud Service Credit Usage.
Assigning Warehouses to a Resource Monitor¶
Warehouses can be assigned to an existing resource monitor through either the web interface or SQL.
Only account administrators (users with the ACCOUNTADMIN role) can assign warehouses to resource monitors. This role must also have the MODIFY privilege on each warehouse.
- Classic Console
- SQL
Execute an ALTER WAREHOUSE command.
For example, using the resource monitor (
limit1
) from a previous example, assign a different warehouse to the monitor:ALTER WAREHOUSE wh3 SET RESOURCE_MONITOR = limit1;
Viewing Resource Monitors¶
Resource monitors can be viewed through either the web interface or SQL:
- Classic Console
Using the ACCOUNTADMIN role:
- SQL
Using the ACCOUNTADMIN role or a role that has been granted the MONITOR or MODIFY privilege on the desired resource monitor:
Execute a SHOW RESOURCE MONITORS command.
In addition, using any role, you can execute a SHOW WAREHOUSES command to view the warehouses owned by the role (or for which the role has been granted USAGE privilege). The output includes the resource monitor, if any, to which the warehouse is assigned.
Note
For provider accounts that have created reader accounts, Snowflake provides an additional view, RESOURCE_MONITORS. This view can be used for querying resource monitor usage in the provider’s reader accounts. For more details, see Account Usage.