Labels
Labels allow you to tag historical queries based on conditions you specify, and then filter query activity reports based on these Labels. This allows you to better understand your workload, and to drill down into specific types of queries.
Labels can only be created by Snowflake account administrators (i.e. users with the ACCOUNTADMIN role)
Name A unique name for the label. Label name can not have the same name as a column in
SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
.Condition This is a valid WHERE clause which can be applied to Snowflake’s
SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
table. In addition, QTag functions can be used in Label Conditions to provide more advanced matching. See the Labels Examples page for more possibilities.
Sundeck provides two ways to create labels: Sundeck SaaS User interface and SQL stored procedures.
Sundeck provides the following stored procedures for creating, using and managing labels:
Sundeck comes with a set of predefined labels and you can start taking advantage of them immediately. Predefined labels can be modified and/or deleted.
To create a label, please follow the steps below.
- Click on “Labels” link in the left-hand navigation menu and then “Create Label” button in the right most corner of the screen.
- “Create Label” form will appear once you’ve clicked on “Create Label” button.
- Fill in the form and when done click the “Save” button.
- After a few seconds, you’ll be taken back to the list of Labels, and you’ll see your new query monitor listed.
Same label created with SQL:
kai#COMPUTE_WH@(no database).(no schema)>use database native-app;
+----------------------------------+
| status |
|----------------------------------|
| Statement executed successfully. |
+----------------------------------+
1 Row(s) produced.
kai#COMPUTE_WH@SUNDECK.(no schema)>call ADMIN.create_label(
'call_statements',
NULL,
NULL,
'query_text ilike \'call\'');
+--------------+
| CREATE_LABEL |
|--------------|
| NULL |
+--------------+
1 Row(s) produced.