Skip to content

Enable app observability

Enable observability for the RelationalAI (RAI) Native App by registering a secure view over Snowflake’s Event Table. Once registered, the app reads metrics through that view and makes them available in the relationalai.observability_preview schema, such as reasoner memory, CPU, and workload demand.

  • The RAI Native App is installed in your Snowflake account.
  • You can run SQL in Snowflake with an active warehouse.
  • You have SELECT access on the active Snowflake Event Table.

The Native App uses Snowflake’s Event Table to report internal metrics about app and reasoner usage, including memory, CPU, and demand. To access those metrics, you create a secure view that filters the Event Table for relevant app-shared metric rows, then register that view with the app so it can read the metrics and make them available in the relationalai.observability_preview schema.

Register a secure events view with the RAI Native App

Section titled “Register a secure events view with the RAI Native App”
  1. Find the active Event Table

    Use the account setting first so the rest of the SQL points at the right table.

    SHOW PARAMETERS LIKE 'EVENT_TABLE' IN ACCOUNT;
    SHOW TABLES LIKE 'EVENTS' IN SCHEMA SNOWFLAKE.TELEMETRY;
  2. Enable change tracking if needed

    Registration fails if change tracking is disabled on the Event Table.

    ALTER TABLE SNOWFLAKE.TELEMETRY.EVENTS
    SET CHANGE_TRACKING = TRUE;
  3. Create the filtered secure view

    Create the view in a database and schema that you own. The filter keeps the view limited to RAI database rows and rows explicitly flagged for sharing with RAI.

    CREATE DATABASE IF NOT EXISTS MONITORING;
    -- Change the schema name if needed.
    CREATE SCHEMA IF NOT EXISTS MONITORING.RAI_OBSERVABILITY;
    CREATE OR REPLACE SECURE VIEW MONITORING.RAI_OBSERVABILITY.RAI_OBS
    COMMENT = 'RelationalAI Native App observability filtered events view'
    CHANGE_TRACKING = TRUE
    AS
    SELECT
    TIMESTAMP,
    START_TIMESTAMP,
    RECORD_TYPE,
    RECORD_ATTRIBUTES,
    RECORD,
    TRACE,
    VALUE,
    RESOURCE_ATTRIBUTES['snow.executable.name'] as EXECUTABLE_NAME
    FROM SNOWFLAKE.TELEMETRY.EVENTS
    WHERE (resource_attributes['snow.database.name']::STRING = 'RELATIONALAI'
    OR record_attributes['rai_share']::BOOLEAN = TRUE);
  4. Register the view with the app

    Registration stores a persistent reference that the app uses to read the filtered telemetry.

    CALL RELATIONALAI.app.REGISTER_EVENTS_VIEW(
    SYSTEM$REFERENCE(
    'view',
    'MONITORING.RAI_OBSERVABILITY.RAI_OBS',
    'PERSISTENT',
    'SELECT'
    )
    );
  5. Validate the registration

    Do not continue until the status check is healthy.

    CALL RELATIONALAI.app.CHECK_EVENTS_VIEW_STATUS();

    Events view active means the configuration is valid and events are flowing. No events view registered means setup is incomplete. ERROR means the registration exists but the app cannot use it yet.