Warehouse resource monitors in Snowflake are essential tools for managing and controlling credit consumption across your organization. They allow administrators to set up alerts and actions based on credit usage thresholds, helping prevent unexpected costs and ensuring budget compliance.
Resource …Warehouse resource monitors in Snowflake are essential tools for managing and controlling credit consumption across your organization. They allow administrators to set up alerts and actions based on credit usage thresholds, helping prevent unexpected costs and ensuring budget compliance.
Resource monitors track the credit usage of virtual warehouses over a specified time interval, which can be daily, weekly, monthly, yearly, or a custom period. When creating a resource monitor, you define credit quotas that represent the maximum number of credits that can be consumed during the monitoring period.
Key components of resource monitors include:
1. **Credit Quota**: The total number of credits allocated for the monitoring interval. This serves as your budget ceiling for warehouse operations.
2. **Monitoring Level**: Resource monitors can be applied at the account level to track all warehouses or assigned to specific individual warehouses for granular control.
3. **Trigger Actions**: You can configure multiple threshold percentages (such as 50%, 75%, 90%, 100%) that initiate specific actions:
- **Notify**: Sends notifications to account administrators when the threshold is reached
- **Notify and Suspend**: Alerts administrators and suspends the warehouse after current statements complete
- **Notify and Suspend Immediately**: Alerts administrators and cancels all running statements while suspending the warehouse
4. **Schedule**: Defines when the monitoring period starts and resets the credit counter.
Only users with ACCOUNTADMIN role can create resource monitors by default. Once created, these monitors provide visibility into spending patterns and help organizations optimize their Snowflake investment.
Best practices include setting multiple notification thresholds at different percentages to receive early warnings, applying monitors to production warehouses to prevent service interruptions from budget overruns, and regularly reviewing usage patterns to adjust quotas appropriately. Resource monitors are crucial for maintaining financial governance in cloud data platforms where consumption-based pricing requires careful management.
Warehouse Resource Monitors in Snowflake
Why Warehouse Resource Monitors Are Important
Resource monitors are essential tools for controlling costs in Snowflake. Since Snowflake uses a consumption-based pricing model, warehouse compute costs can escalate quickly if left unchecked. Resource monitors provide the guardrails needed to prevent unexpected charges and ensure budget compliance across your organization.
What Are Resource Monitors?
Resource monitors are Snowflake objects that allow you to set credit quotas and define actions when those quotas are reached. They track credit usage at the account level or for specific warehouses, enabling administrators to:
• Set monthly, weekly, daily, or custom credit limits • Receive notifications when usage thresholds are approached • Automatically suspend warehouses when limits are exceeded • Monitor spending patterns across different teams or projects
How Resource Monitors Work
Resource monitors operate by tracking credit consumption against a defined quota. Key components include:
Credit Quota: The maximum number of credits allowed during the monitoring period.
Schedule: Defines when the monitor starts, ends, and resets. Options include: • Daily • Weekly • Monthly • Yearly • Custom date range • Never (one-time use)
Triggers and Actions: You can set multiple triggers at different percentage thresholds: • NOTIFY - Sends a notification to account administrators • NOTIFY & SUSPEND - Notifies and suspends the warehouse after current queries complete • NOTIFY & SUSPEND IMMEDIATELY - Notifies and suspends the warehouse, canceling all running queries
Creating Resource Monitors
Resource monitors can be created using SQL:
CREATE RESOURCE MONITOR monitor_name WITH CREDIT_QUOTA = 1000 FREQUENCY = MONTHLY START_TIMESTAMP = IMMEDIATELY TRIGGERS ON 75 PERCENT DO NOTIFY ON 90 PERCENT DO NOTIFY ON 100 PERCENT DO SUSPEND;
Assigning Resource Monitors
Resource monitors can be assigned at two levels: • Account Level: Only ACCOUNTADMIN can assign a monitor to the entire account • Warehouse Level: Can be assigned to one or more specific warehouses
A warehouse can only have ONE resource monitor assigned at a time. However, a single resource monitor can be assigned to multiple warehouses.
Key Permissions
• ACCOUNTADMIN role is required to create resource monitors • ACCOUNTADMIN is required to assign monitors at the account level • Users with MODIFY privilege on a warehouse can assign resource monitors to that warehouse
Exam Tips: Answering Questions on Warehouse Resource Monitors
Tip 1: Remember that only ACCOUNTADMIN can create resource monitors and assign them at the account level. This is frequently tested.
Tip 2: Understand the difference between SUSPEND and SUSPEND IMMEDIATELY. The former allows running queries to finish; the latter terminates all active queries.
Tip 3: Know that a warehouse can have only ONE resource monitor, but one resource monitor can cover MULTIPLE warehouses.
Tip 4: Resource monitors track credit usage, not storage costs. They only monitor compute credits consumed by warehouses.
Tip 5: Cloud services compute that exceeds 10% of daily warehouse usage is billed separately and IS tracked by resource monitors.
Tip 6: When a resource monitor suspends a warehouse, users cannot resume it until the quota is increased or the monitor is removed.
Tip 7: Remember the available frequencies: DAILY, WEEKLY, MONTHLY, YEARLY, and NEVER.
Tip 8: Notifications are sent to account administrators who have enabled notifications in their preferences - this setting must be configured for alerts to be received.