Sitemap

Road to Snowflake SnowPro Core Certification: Resource Monitors

Eleventh Chapter: Resource Monitors

5 min readSep 30, 2021
Chapter 11 of the SnowPro Core Course. Resource Monitors.
Chapter 11 of the SnowPro Core Course. Resource Monitors.

In all the cloud services, there must be something to control the price we spend. In Snowflake, this is controlled by Resource Monitors. Let’s study them in depth to be prepared for the SnowPro Core certification!

  1. Intro to Resource Monitors
  2. Resource Monitors Assignment
  3. Resource Monitors Parameters
  4. Typical Exam Questions on Resource Monitors

Remember that all the chapters from the course can be found in the following link:

RESOURCE MONITORS

We use Resource monitors to help control costs and avoid unexpected credit usage caused by running data warehouses. You can impose limits on the number of credits that warehouses consume. You can see the credits you’ve consumed in the Account section of the Snowflake UI (you must have an AccountAdmin role).

Consumed Credits by a Snowflake Account
Consumed Credits by a Snowflake Account

Resource Monitors are ONLY created by AccountAdmins, although roles with the MONITOR & MODIFY privileges can view and modify the resource monitor.

Resource Monitors Assignment

Resource monitors can be assigned in the following scenarios:

  • You can set a single monitor at the account level to control credit usage for all warehouses in your account.
  • You can assign a monitor to one or more warehouses, controlling the credit usage for each warehouse.
  • You can assign a warehouse to only a single resource monitor below the account level — this is a typical exam question.

We can see these three cases in the following diagram:

Resource Monitors example (via docs.snowflake.com)
Resource Monitors example (via docs.snowflake.com)

Resource Monitors Parameters

We need to specify several parameters when creating a Resource Monitor. Let’s take a look at them:

1) Credit Quota → Specifies the number of Snowflake credits allocated to the monitor for the specified frequency interval. A credit quota of 1000 would mean that the warehouse can consume until 1000 credits. It works by interval, and it will be restarted. For example, we can set the credit quota for an entire month, and the following month the credit quota would reset to 0.

2) Monitor Level→ It specifies whether the resource monitor is used to monitor the credit usage for your entire Account or individual WareHouses.

3) Schedule → When the monitor is going to start monitoring and when the credits reset back to 0. The credits are reset to 0 at the beginning of each calendar month.

4) Actions → They are triggers. Each action specifies a threshold and the action to perform when the threshold is reached within the specified interval. To receive notifications, each account administrator must explicitly enable notifications through the web interface, specifying their email if they want to receive them by email. Resource monitors support the following actions:

  • Notify (send notification) → Perform no action but send an alert notification (email/web UI).
  • Notify & Suspend (suspend warehouse) → Send a notification and suspend all assigned warehouses after all statements being executed by the warehouse (s) have been completed.
  • Notify & Suspend Immediately (kill query) → Send a notification and suspend all assigned warehouses immediately.
Needed Params to create a Resource Monitor in Snowflake
Needed Params to create a Resource Monitor in Snowflake

What happens if a monitor suspends a Warehouse, but we want to use it again in the same cycle? We have the following options to restart the warehouse again:

  • The credit quota for the monitor is increased.
  • The credit threshold for the suspension action is increased.
  • The warehouses are no longer assigned to the monitor.
  • The monitor is dropped.
  • The next interval, if any, starts as dictated by the start date for the monitor.

TYPICAL EXAM QUESTIONS

Can Resource Monitors be replicated?

  1. True
  2. False

Solution: 1. Replication was only supported for Databases, and you couldn’t replicate other objects in your account, like Users or Resource monitors. But as a preview feature in 2022, account objects can finally be replicated! You can read more information at the following link: https://docs.snowflake.com/en/user-guide/account-replication-intro.html

Can a Warehouse be assigned to more than one Resource Monitor?

  1. True
  2. False

Solution: 2. You can assign a warehouse to only a single resource monitor below the account level.

For which activities does Snowflake have administration settings to help with resource consumption?

  1. Help control costs associated with unexpected warehouse credit usage
  2. Manage access to Snowflake for specific users
  3. Manage the availability of the product

Solution: 1

What can the resource monitor associated with a Warehouse do when it reaches (or is about to) hit the limit?

  1. Suspend the WareHouse
  2. Send notification alert
  3. Kill the query that is running
  4. Delete the Snowflake account

Solution: 1, 2, 3

What is the property name from the Resource Monitors that lets you specify whether you want to control the credit usage of your entire account or a specific set of warehouses?

  1. Credit Quota
  2. Monitor Level
  3. Schedule
  4. Notification

Solution: 2

What actions can a Resource Monitor take when it hits the limit?

  1. Notify & Suspend
  2. Notify & Suspend Immediately
  3. Notify
  4. Notify & Increase the limit

Solution: 1, 2, 3

Which properties of a Resource Monitor can be modified?

  1. Credit Quota
  2. Monitor Level
  3. Schedule
  4. Actions

Solution: 1, 2, 3, 4

Thanks for Reading!

If you like my work and want to support me…

  1. The BEST way is to follow me on Medium here.
  2. Feel free to clap if this post is helpful for you! :)
  3. More Snowflake SnowPro Core practice exam questions? Find them at FullCertified.com!

--

--

Gonzalo Fernandez Plaza
Gonzalo Fernandez Plaza

Written by Gonzalo Fernandez Plaza

Computer Science Engineer & Tech Lead 🖥️. Publishing AWS & Snowflake ❄️ courses & exams. https://www.fullcertified.com

No responses yet