# RESOURCE MONITOR

Config path: `/resource_monitor.yaml`

Example:

```yaml
test_res_monitor_1:
  credit_quota: 125
  frequency: monthly
  triggers:
    50: notify
    75: notify
    100: suspend
    110: suspend_immediate
```

## Schema

* *{key}* (ident) - name of resource monitor
* *{value}* (dict)
  * <mark style="background-color:red;">**credit\_quota**</mark> (int) - he number of credits allocated to the resource monitor per frequency interval
  * <mark style="background-color:red;">**frequency**</mark> (str) - `MONTHLY | DAILY | WEEKLY | YEARLY | NEVER`
  * <mark style="background-color:red;">**triggers**</mark> (dict)
    * {key} (int) - quota threshold in percent
    * {value) (str) - action to take when threshold was reached `SUSPEND | SUSPEND_IMMEDIATE | NOTIFY`

## Usage notes

1. Setting custom `START_TIMESTAMP` and `END_TIMESTAMP` is currently not supported, since it will cause your config to depend on wall clock time. `START_TIMESTAMP` is automatically set to `IMMEDIATELY` on creation and on change of frequency of resource monitor.
2. Comments for resource monitors are not supported by Snowflake.

## Links

* [CREATE RESOURCE MONITOR](https://docs.snowflake.com/en/sql-reference/sql/create-resource-monitor.html)
* [ALTER RESOURCE MONITOR](https://docs.snowflake.com/en/sql-reference/sql/alter-resource-monitor.html)
* [SHOW RESOURCE MONITORS](https://docs.snowflake.com/en/sql-reference/sql/show-resource-monitors.html)
* [Parser & JSON Schema (GitHub)](https://github.com/littleK0i/SnowDDL/blob/master/snowddl/parser/resource_monitor.py)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.snowddl.com/basic/yaml-configs/resource-monitor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
