Troubleshoot budgets¶
This topic explains how to monitor budgets for problems and provides solutions to common issues.
Using an event table to monitor budgets¶
You can use an event table to collect telemetry data related to budgets. After Snowflake starts collecting the data in the event table, you can query the table, create a stream to track changes, or set alerts to send notifications when certain events occur.
If you don’t want to collect telemetry data for budgets, you must set the
ENABLE_BUDGET_EVENT_LOGGING account parameter to FALSE to turn it off.
Understanding the events¶
The following table describes the values in the event table that correspond to budget events so you can focus on the appropriate events. For detailed information about the structure of an event table, see Event table columns.
Event table column |
Field |
Value |
Description |
|---|---|---|---|
|
|
|
Unique ID of the budget instance. |
|
|
Fully qualified name of the budget instance. |
|
|
|
|
Constant identifier for all budget telemetry events. |
|
n/a |
|
Indicates a budget log event. |
|
|
|
Descriptive event name. Possible values include the following:
|
|
|
Severity level of budget event. |
|
|
|
|
Descriptive event message, often including contextual details such as an integration name or operation. |
Use the following examples to better understand how to identify budget events in an event table.
- Query: Find all events related to the propagation of all budgets within the account
- Query: Find all events related to a specific budget (for example,
MY_DB.SCH1.MY_BUDGET)
Troubleshooting specific problems¶
The following scenarios can help you troubleshoot issues that can occur when creating or editing budgets:
You can’t activate the account budget¶
There are multiple reasons you might be unable to activate your account budget:
Error |
|
|---|---|
Cause |
If your Snowflake account is new, the account budget is not yet available in your account. |
Solution |
Wait for the account budget to be available in your newly created account. You can activate it after it becomes available. |
Error |
|
|---|---|
Cause |
The account budget has already been activated. |
Solution |
You can call the <budget_name>!GET_CONFIG method to view the activation timestamp: |
Error |
|
|---|---|
Cause |
Your account does not yet support the Budgets feature. |
Solution |
The Budgets feature is not available for accounts in Gov regions. Support for Gov regions will be available in a future release. |
You can’t create a custom budget¶
There are multiple reasons you might be unable to create a custom budget.
Error |
|
|---|---|
Cause |
The role you are using does not have the privileges required to create custom budgets. |
Solution |
Use a role with the required privileges. See Create a custom role to create budgets. |
Error |
|
|---|---|
Cause |
You pass arguments to the constructor method to create a budget. |
Solution |
See CREATE BUDGET and edit your create statement. |
You can’t activate a custom budget¶
Error |
|
|---|---|
Cause |
You tried to call the ACTIVATE method on a custom budget. |
Solution |
The ACTIVATE method is only available on the account budget. After you have created a custom budget, use the <budget_name>!SET_SPENDING_LIMIT and <budget_name>!SET_EMAIL_NOTIFICATIONS methods to configure the budget and start receiving notification emails. |
You can’t call methods on the account budget¶
There are multiple reasons why calling a method on the account budget might fail.
Error |
|
|---|---|
Cause |
You tried to call any of the following methods on the account budget: |
Solution |
These methods are not available on the account budget. The account budget monitors all supported objects in the account and objects cannot be added or removed. For more information, see Account budget and custom budgets. |
Error |
|
|---|---|
Cause |
You tried to call a method on the account budget before the account budget is activated. |
Solution |
You can’t add or remove objects from a custom budget¶
To successfully add or remove an object from a custom budget, the role used to call the method must have the required privileges and role.
Error |
|
|---|---|
Cause |
The role you used to call the instance method does not have the required privileges to add (or remove) objects from the budget. |
Solution |
Grant the required instance role and privileges to the role used to call the method. For more information, see Create a custom role to monitor a custom budget. |
Error |
|
|---|---|
Cause |
You tried to add an object to a custom budget but the role you used to call the method doesn’t have the required privileges. |
Solution |
To add (or remove) an object from a budget, the role used to call the method must have the APPLYBUDGET privilege on the object. If the parent object is a database or schema, you must also have the USAGE privilege on the database and schema that contain the object. For more information, see the list of required object privileges. |
Error |
|
|---|---|
Cause |
You tried to create a reference for an object without specifying the PRIVILEGE parameter in the SYSTEM$REFERENCE statement. |
Solution |
Create the reference with the APPLYBUDGET privilege on the object. |
Error |
|
|---|---|
Cause |
There are multiple causes for this error message:
|
Solution |
|
You can’t set email notifications for a budget¶
The following scenarios can help you troubleshoot common issues when calling the <budget_name>!SET_EMAIL_NOTIFICATIONS method.
Error |
|
|---|---|
Cause |
The role you used to set the email notifications for a custom budget does not have the ADMIN instance role. |
Solution |
Use a role with the required privileges and roles. See the Access control requirements for SET_EMAIL_NOTIFICATIONS. |
Error |
|
|---|---|
Cause |
The notification integration does not exist. |
Solution |
Use a valid notification integration. For more information, see Create an email notification integration. Include the email addresses for budgets notifications in the ALLOWED_RECIPIENTS list. |
Error |
|
|---|---|
Cause |
The email addresses are not included in the notification integration. |
Solution |
Add the email addresses to the notification integration, or use a notification integration that includes all the email addresses in the ALLOWED_RECIPIENTS list. |
Error |
|
|---|---|
Cause |
Some or all of the email addresses you tried to add are not validated. |
Solution |
See Verify the email addresses of the email notification recipients. |
You can’t successfully call the GET_SERVICE_TYPE_USAGE method¶
The following scenarios can help you troubleshoot common issues when calling the <budget_name>!GET_SERVICE_TYPE_USAGE method.
Error |
|
|---|---|
Cause |
You called the method with invalid arguments or the wrong number of arguments. |
Solution |
Check that the arguments you use to call the method are valid and that you’ve included all required arguments. |
Error |
|
|---|---|
Cause |
The TIME_DEPART argument is an invalid string. |
Solution |
Use one of the valid values listed for the TIME_DEPART argument in the reference topic. |
Error |
|
|---|---|
Cause |
The USER_TIMEZONE argument is an invalid string. |
Solution |
Use a valid timezone string. For more information, see the usage notes for GET_SERVICE_TYPE_USAGE. |
The Budgets feature is not available for your account¶
Errors |
|
|---|---|
Cause |
Your account does not yet support the Budgets feature. |
Solution |
The Budgets feature is not available for accounts in Gov regions. Support for Gov regions will be available in a future release. |