Connect Snowflake

Snowflake Information Schema checks and key-pair auth

Snowflake is on every plan, including Free. The table limit for the plan still applies. Prices on the pricing page are in US dollars.

On Connections, enter the account identifier, user, role, warehouse, database, and an optional schema. Row Monitor generates an RSA key pair, stores the private key encrypted, and shows only the public key. Paste that public key into the user. The private key is not shown again. Generate a new pair to replace it, then update the user. Deleting the connection, or closing the account that owns the workspace, deletes the private key.

The account identifier looks like orgname-account or xy12345.us-east-1. Do not include https:// or .snowflakecomputing.com. Use unquoted identifiers.

What a check reads

  • Schema: INFORMATION_SCHEMA.COLUMNS
  • Volume: INFORMATION_SCHEMA.TABLES.ROW_COUNT
  • Freshness: INFORMATION_SCHEMA.TABLES.LAST_ALTERED

LAST_ALTERED is the last DML, DDL, or background metadata change on the table. It is not the maximum of a timestamp column. Checks do not SELECT from the tables you watch, and they do not run COUNT(*). Views are not listed.

Roles

The script creates a role, grants USAGE on the warehouse, database, and schema, and grants REFERENCES on tables. Snowflake documents REFERENCES as the privilege that lets a role view table structure through Information Schema without reading the data. A base table does not need MONITOR for these columns, and the script does not grant SELECT. It also does not grant OPERATE on the warehouse.

The user is TYPE = SERVICE. A service user has no password and cannot sign in to the Snowflake web interface. Authentication is the key pair.

-- Run as a role that can create users and grant privileges, such as SECURITYADMIN.
-- Replace your_warehouse, your_database, and your_schema.
-- Repeat the schema and table grants for every schema you want watched.
-- FUTURE grants apply to tables created by the role that runs this statement.
-- If a different role owns new tables, that owner runs the FUTURE grant.
--
-- SELECT is not granted. Checks read Information Schema only.
-- MONITOR is not granted on tables. A base table has no MONITOR privilege
-- that these checks need. REFERENCES is what exposes the table structure,
-- ROW_COUNT, and LAST_ALTERED without reading rows.
-- OPERATE is not granted on the warehouse. Set AUTO_RESUME = TRUE on an
-- X-Small warehouse so USAGE can wake it.

CREATE ROLE IF NOT EXISTS rowmonitor_ro;

GRANT USAGE ON WAREHOUSE your_warehouse TO ROLE rowmonitor_ro;
GRANT USAGE ON DATABASE your_database TO ROLE rowmonitor_ro;
GRANT USAGE ON SCHEMA your_database.your_schema TO ROLE rowmonitor_ro;
GRANT REFERENCES ON ALL TABLES IN SCHEMA your_database.your_schema TO ROLE rowmonitor_ro;
GRANT REFERENCES ON FUTURE TABLES IN SCHEMA your_database.your_schema TO ROLE rowmonitor_ro;

CREATE USER IF NOT EXISTS rowmonitor_svc
  TYPE = SERVICE
  DEFAULT_ROLE = rowmonitor_ro
  DEFAULT_WAREHOUSE = your_warehouse
  DEFAULT_NAMESPACE = your_database.your_schema
  COMMENT = 'Row Monitor metadata checks';

GRANT ROLE rowmonitor_ro TO USER rowmonitor_svc;

-- Replace the key with the public key shown on the connection page.
-- Do not paste the private key. Row Monitor keeps that.
ALTER USER rowmonitor_svc SET RSA_PUBLIC_KEY='paste-public-key-here';

After you save the connection in Row Monitor, replace paste-public-key-here with the public key on the connection page, or run the ALTER USER statement that page shows.

Cost

Information Schema queries still run on a warehouse. Use an X-Small warehouse. Set AUTO_RESUME = TRUE so the USAGE grant can wake it, and set a short AUTO_SUSPEND (60 seconds is enough). The cost is warehouse credits for the seconds that warehouse is awake. It is not a scan of your tables. Row Monitor closes the session when the check finishes. It does not keep a warehouse running between checks.

If the test says the role cannot see columns or a row count, the role is missing REFERENCES on that table. Do not add SELECT to get past that. The check will not scan the table.

Alert emails, Slack messages, and the times in the app use the workspace time zone. It starts as the browser's zone at signup. The owner can change it in Settings, and daylight saving is included. Airflow schedules are still evaluated the way Airflow defines them. The time zone does not change detection. Back to help