❄️
Data Flakes

Back

Resource monitors in Snowflake are powerful tools designed to help you control and monitor the credit usage of your warehouses and entire account. Available from the Standard Edition onwards, these monitors are essential for efficient resource management.

Overview#

Purpose#

Resource monitors are used to control and monitor credit usage, ensuring that your Snowflake environment runs efficiently and within budget.

Availability#

This feature is available in the Standard Edition and higher editions of Snowflake.

Scope#

Resource monitors can be applied at various levels:

  • Account Level: Monitors credit usage for the entire Snowflake account.
  • Individual Warehouses: Monitors credit usage of specific warehouses.
  • Group of Warehouses: Monitors a collection of warehouses under one resource monitor.

Setting Credit Quotas#

Credit Quota#

A credit quota is a limit set on credit usage for a defined cycle. The default cycle is monthly, but it can be customised to fit different time frames such as daily, weekly, or any other period as needed.

Customisation#

Schedules can be adjusted to suit your operational needs, providing flexibility in how credit usage is monitored.

Scope#

Resource monitors can be tailored to monitor credit usage at different levels:

  • Account Level: For the entire Snowflake account.
  • Individual Warehouses: For specific warehouses.
  • Group of Warehouses: For multiple warehouses collectively.

Actions Based on Quota#

Resource monitors allow for specific actions to be set when certain usage thresholds are met. The primary actions include:

1. Notify#

Trigger: When a specified percentage of the credit quota is used (e.g., 50%).

Action: Sends a notification to designated users.

Purpose: Alerts administrators before the quota is fully utilised, allowing for proactive management.

2. Suspend and Notify#

Trigger: When a higher percentage of the credit quota is used.

Action:

  • Suspends the specified warehouse(s) after completing current running queries.
  • Sends a notification to designated users.

Detail: “Suspend” means no new queries will start, but existing queries will complete, allowing administrators to manage workloads without abrupt interruptions.

3. Suspend Immediately and Notify#

Trigger: When the credit quota is reached.

Action:

  • Immediately suspends the specified warehouse(s).
  • Aborts any running queries.
  • Sends a notification to designated users.

Detail: Provides strict control to ensure no further credit consumption beyond the set quota, useful for environments with strict budget constraints.

Setting Percentages Above 100%#

Usage: Allows for handling scenarios where it’s acceptable to exceed the quota temporarily.

Purpose: Provides flexibility in managing unexpected surges in credit usage.

Creation and Management#

Roles and Permissions#

Creation: Only users with the ACCOUNTADMIN role can create resource monitors.

Delegation: ACCOUNTADMIN can grant privileges to other roles for monitoring and modifying resource monitors.

Privileges:

  • Monitor: View usage and status of resource monitors.
  • Modify: Adjust settings and quotas of existing resource monitors.

Steps to Create a Resource Monitor#

  1. Define Credit Quota:

    • Determine the limit of credits for the chosen cycle.
    • Select the cycle period (monthly, weekly, daily, etc.).
  2. Specify Scope:

    • Choose to apply the monitor at the account level, for individual warehouses, or for a group of warehouses.
  3. Set Actions and Thresholds:

    • Define the percentage thresholds and corresponding actions (notify, suspend and notify, suspend immediately and notify).
  4. Assign Notifications:

    • Specify which users or roles should receive notifications.

Practical Example#

Here’s how to create and configure a resource monitor in Snowflake:

Disclaimer

The information provided on this website is for general informational purposes only. While we strive to keep the information up to date and correct, there may be instances where information is outdated or links are no longer valid. We make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability, or availability with respect to the website or the information, products, services, or related graphics contained on the website for any purpose. Any reliance you place on such information is therefore strictly at your own risk.