Snowflake tags in Unravel
Tags in Snowflake are metadata labels attached to objects like tables, warehouses, databases, and query sessions, enabling categorization and tracking of resource usage across accounts. Unravel currently captures tags for warehouses and tables to gain insights.
Using tags for queries and warehouses
Unravel currently captures tags for warehouses and tables.
Object Tags
Object tags in Snowflake are labels assigned to objects such as tables, databases, or warehouses to facilitate tracking of resource usage and performance metrics. By creating and assigning tags to specific objects, you can monitor and analyze storage, compute, and usage patterns associated with those objects. For details on how to create object tags, refer Create Tag and Object Tagging.
Query tags
Queries are not part of the Snowflake object hierarchy of persistent account objects such as users, tables, warehouses, etc. Therefore, there are no query tags. However, Snowflake users may use the SET statement to set tags for a session so that every query in the session has the tags. Here is an example:
If you want to apply a tag to a session, you can use the ALTER SESSION command. All queries executed after this will carry the same tag:
ALTER SESSION SET query_tag='example_tag';
Using the Snowflake Tags in Unravel
In Unravel, tags can be leveraged to see the estimated costs for the tags and to create dashboards that offer insights across different tags.
Query cost shown for the tags
In the Queries page, you can view the costs associated for each tags as shown in the following image:
Dashboards
You can create dashboards that track the cost of queries or storage usage based on the tags assigned to queries or tables.
For example, track how much each department (tagged using the department tag) is consuming in terms of compute resources and storage, and monitor the cost associated with each.