Documentation
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

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)

Label Properties

  • 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.

Creating Labels

Sundeck provides two ways to create labels: Sundeck SaaS User interface and SQL stored procedures.

DDL for Labels

Sundeck provides the following stored procedures for creating, using and managing labels:

Sundeck UI

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.

  1. Click on “Labels” link in the left-hand navigation menu and then “Create Label” button in the right most corner of the screen.
  2. “Create Label” form will appear once you’ve clicked on “Create Label” button.
  3. Fill in the form and when done click the “Save” button.
  4. After a few seconds, you’ll be taken back to the list of Labels, and you’ll see your new query monitor listed.

Examples

Home Page

Same label created with SQL:

vicky#COMPUTE_WH@(no database).(no schema)>use database opscenter;
+----------------------------------+                                            
| status                           |
|----------------------------------|
| Statement executed successfully. |
+----------------------------------+
1 Row(s) produced. 

vicky#COMPUTE_WH@OPSCENTER.(no schema)>call ADMIN.create_label(
                                      'call_statements', 
                                      NULL, 
                                      NULL, 
                                      'query_text ilike \'call\'');
+--------------+                                                                
| CREATE_LABEL |
|--------------|
| NULL         |
+--------------+
1 Row(s) produced.