Use Snowsight to work with cost anomalies¶
This topic describes how to use Snowsight to identify and investigate cost anomalies, which occur when daily consumption in an account or organization is above or below the expected range of consumption for the day. It also describes how to use Snowsight to configure notifications so specific users are emailed when cost anomalies occur.
For an overview of cost anomalies, see Introduction to cost anomalies.
Configure notifications with Snowsight¶
When Snowflake identifies a cost anomaly, it sends a notification to a list of email addresses. When deciding who will receive notifications for cost anomalies, be aware that email notifications might contain details about how much was spent by an account.
Each account can have a notification list for account-level anomalies within the account. You can also define a separate notification list for the organization to control who is notified when there is an organization-level anomaly.
Each email address must have been verified by the user.
You can use a group email address, such as a distribution list, for notifications, but this email address must be verified. Before adding a group email address to the notification list, you might need to create a new Snowflake user with the group email address so you can verify it.
Note
Email notifications are processed through Snowflake’s Amazon Web Services (AWS) deployments, using AWS Simple Email Service (SES). The content of an email message sent using AWS may be retained by Snowflake for up to thirty days to manage the delivery of the message. After this period, the message content is deleted.
To add email addresses where notifications are sent when there is a cost anomaly, complete the following steps:
Sign in to Snowsight as a user with the required privileges.
In the navigation menu, select Admin » Cost management, and then select Anomalies.
Select Notifications.
To specify who gets notified for an account-level anomaly, do the following:
In the Notify for account anomalies field, enter the email address of a Snowflake user you want contacted for anomalies.
Press Enter.
Repeat for additional users.
To specify who gets notified for an organization-level anomaly, do the following:
In the Notify for organization anomalies field, enter the email addresses of a Snowflake user you want contacted for anomalies.
Press Enter.
Repeat for additional users.
Select Save changes.
Identify and investigate cost anomalies with Snowsight¶
Step 1: Identify cost anomalies
Sign in to Snowsight as a user with the required privileges.
In the navigation menu, select Admin » Cost management, and then select Anomalies.
Use the filters to select a timeframe and account. If you want to identify organization-level anomalies, select All accounts.
Do one of the following:
Use the chart to visually track actual consumption and the expected range of consumption over time. Cost anomalies where actual consumption went above or below the expected range are visually represented in the chart.
Use the table to view a list of all cost anomalies within the timeframe. Sort as desired.
Step 2: Investigate a cost anomaly
After identifying a cost anomaly, you can investigate it using the side panel or by using Cortex Code to ask natural-language questions.
Investigate using the side panel¶
Select a cost anomaly by clicking the indicator in the chart or selecting a row in the table. A side panel opens.
If you are investigating an account-level anomaly (you selected a specific account in the filter), you can use the side panel to drill down into the following:
Use the Top consumption drivers section to investigate hourly consumption within the account. You can view consumption for all service types or you can focus on the services that consumed the most credits during the day.
Use the Top warehouses section to identify the warehouses within the account that had the greatest absolute change in consumption.
If you are investigating anomalies in the account that you are currently signed in to, use the Top queries section to identify the most expensive queries in the warehouse that had the greatest change in consumption. This might not show the most expensive query in the account because it focuses on queries in a specific warehouse (the one with the greatest change in consumption).
Drill down into the most expensive queries by selecting the Open in Worksheet icon that is located near the Query ID. A worksheet opens that shows the query that was executed.
If you are investigating an organization-level anomaly (you selected All Accounts in the filter), you can use the side panel to drill down into the following:
Use the Top accounts section to identify the accounts that had the greatest absolute change in consumption.
Use the Top warehouses section to drill down into the account with the greatest change in consumption. You can identify the warehouses within the account that had the greatest change in consumption.
This might not show the warehouse with the greatest change within the entire organization because it focuses on warehouses in a specific account (the one with the greatest change in consumption). To programmatically retrieve the top warehouses in a different account or within the organization, see Warehouse-level consumption.
Tip
If the Anomalies tab does not provide the consumption data you need to identify the root cause of the cost anomaly, you can select the Consumption tab for further investigation.
Investigate with Cortex Code¶
Cortex Code is an AI-driven intelligent agent integrated into the Snowflake platform. You can use Cortex Code to investigate cost anomalies by highlighting a section of the consumption chart and asking natural-language questions.
Note
First-time users: When you first access the Anomalies tab, you might see an introductory prompt highlighting the Snap and Ask feature. This prompt appears near the consumption chart and introduces the Add to Chat and Explain quick actions. Select either action to begin using Cortex Code for cost investigation.
Prerequisites
Before you can use Cortex Code to investigate cost anomalies, you must be granted the following privileges:
The required privileges to access Cortex Code in Snowsight.
Investigate a cost anomaly with Cortex Code
To investigate a cost anomaly with Cortex Code, do the following:
Identify and highlight activity in the consumption chart that you want to investigate, such as a spike in compute costs.
The Add to Chat and Explain quick actions appear.
Select one of the following quick actions:
Add to Chat: Start a Cortex Code chat where you can enter prompts and interact with Cortex Code.
Explain: Cortex Code will analyze the highlighted area of the chart and return an analysis.
Cortex Code analyzes the cost activity for the highlighted area and reports its findings. It might ask you to run SQL statements to gather more information about the anomaly. For example, if you ask about a cost spike, it might generate a SQL statement that identifies the warehouses, queries, or users that contributed to the increase.
Example prompts
The following example prompts cover different types of analysis that Cortex Code supports for cost anomalies:
Use case |
Example prompt |
|---|---|
Gather general information about a cost change |
What changed in this highlighted window? |
Determine the cause of a cost spike |
Why did this cost spike occur? |
Identify cost drivers |
Which top warehouses contributed the most to this increase? |
Get recommendations to reduce costs |
What can I do to reduce these costs? |
Investigate specific cost categories |
What queries caused this compute cost increase? |
For more information, see Cortex Code.