CertSafari
    Snowflake SnowPro Specialty: Native Apps· Lessons

    Domain 2 · Lesson 5/12

    Native App telemetry: log levels, event definitions and event sharing

    Implement development workflows.

    15 min read
    9.5% of exam
    6 sources
    Published 21 Oct 2026
    Docs as of 18 Oct 2026

    What you will be able to do

    • Set default log_level, trace_level, metric_level and log_event_level in the manifest and explain what happens when they are missing
    • Declare required and optional event definitions in telemetry_event_definitions
    • Trace where an app's telemetry is stored in the consumer account and how a shared copy reaches the provider
    • Set up a provider event account and active event table, and name who pays for shared events
    • Gate parts of a Streamlit UI on the viewer's application role by choosing the right IS_APPLICATION_ROLE_ACTIVATED context

    Key concept

    Levels emit, event definitions filter — The log and trace levels in the manifest decide what telemetry the app produces at all. Event definitions are a second layer that only decides which of those records the consumer shares with the provider.

    1.Default log and trace levels in the manifest

    A Native App runs in the consumer's account, so the provider can't attach a debugger to it. Telemetry is how a provider finds out what the app is doing there: log messages about the state of a piece of code, trace events that group work across several parts of the code, and metrics on the CPU and memory used by stored procedures and UDFs. All three are switched on in the configuration block of manifest.yml.

    Default telemetry levels set in the manifest's configuration blockyaml
    configuration:
      ...
      log_level: INFO
      trace_level: ALWAYS
      metric_level: ALL
      log_event_level: INFO
      ...

    Each property controls its own stream. log_level sets which log messages are captured. Without it, the default log data is not captured. trace_level turns on tracing, and tracing automatically records the start and end of every query and stored procedure call. metric_level emits auto-instrumented resource metrics. log_event_level, introduced in BCR bundle 2026_02, controls which application lifecycle events (RECORD_TYPE=EVENT) are recorded, separately from log messages. Its values run from TRACE through FATAL, plus OFF.

    Choose the levels carefully before you publish. Once an app is published, its log and trace levels cannot be changed. The trace level also has a privacy cost. Any trace_level other than OFF can expose calls to hidden stored procedures to any user in the consumer account who can read the event table.

    The manifest sets defaults for the whole app. Inside the setup script you can override them for individual objects. Use ALTER SCHEMA, ALTER PROCEDURE or ALTER FUNCTION ... SET for schemas, stored procedures and UDFs, and CREATE OR ALTER VERSIONED SCHEMA for versioned schemas. The properties you can set this way are LOG_LEVEL, TRACE_LEVEL and METRIC_LEVEL. Containerized apps are the exception: their telemetry levels go in the service specification, and the manifest log_level does not propagate into containers.

    Checkpoint 1 of 8· Fill the gap

    A provider wants the app to emit logs, traces, metrics and lifecycle events by default. Which top-level manifest block holds these settings?

     ? :
      ...
      log_level: INFO
      trace_level: ALWAYS
      metric_level: ALL
      log_event_level: INFO
      ...

    Sources12

    2.Event definitions: required and optional filters

    Event definitions decide which of the emitted records are shared with the provider. The consumer still receives everything the levels produce. A provider lists event definitions under configuration.telemetry_event_definitions and marks each one MANDATORY or OPTIONAL. They are set per version or patch, when that version or patch is published. The consumer never chooses which definitions are required.

    One required and one optional event definitionyaml
    configuration:
      telemetry_event_definitions:
        - type: ERRORS_AND_WARNINGS
          sharing: MANDATORY
        - type: DEBUG_LOGS
          sharing: OPTIONAL
    Supported event definitions and what each one shares
    Event definitionShares
    SNOWFLAKE$ALLEvery log message and trace event the app emits
    SNOWFLAKE$ALL_EVENTSRecords with RECORD_TYPE EVENT
    SNOWFLAKE$ERRORS_AND_WARNINGSLOG records with severity FATAL, ERROR or WARN
    SNOWFLAKE$TRACESSPAN and SPAN_EVENT records
    SNOWFLAKE$USAGE_LOGSLOG records with severity INFO
    SNOWFLAKE$DEBUG_LOGSLOG records with severity DEBUG or TRACE
    SNOWFLAKE$METRICSMETRIC records

    Required definitions are switched on automatically when the app is installed. Afterwards the consumer cannot disable event sharing or any required definition. A consumer who won't share that data cannot install the app, so installing is the act of accepting it. On upgrade, providers can use system functions or the Python Permission SDK to check that every required definition is enabled. Optional definitions are the consumer's choice and can be switched on or off at any time without blocking installation.

    The two layers also affect each other at runtime. When a consumer enables event definitions, Snowflake raises the app's log and trace levels to the most verbose ones those definitions allow. For example, enabling DEBUG_LOGS lets debug-level records through even if the manifest default is quieter.

    Event definitions are optional for the provider too. An app without them gives the consumer a single all-or-nothing switch, and Snowsight shows only the All type. Older event sharing behaves like an OPTIONAL ALL definition, so an existing app already works that way. To move to finer-grained sharing, add definitions to the manifest of a new version or patch. Nothing else needs to change. Apps that use Snowpark Container Services currently support only SNOWFLAKE$ALL.

    Checkpoint 2 of 8· Check yourself

    After installing an app, a consumer's security team wants to stop sharing all telemetry with the provider. The app's manifest declares ERRORS_AND_WARNINGS with sharing: MANDATORY and DEBUG_LOGS with sharing: OPTIONAL. What can the consumer do?

    Checkpoint 3 of 8· Exam question

    Which of the following statements about required and optional events in a Native App's event definitions are correct?(Select 3)

    0 of 3 selected

    Sources13

    3.Where telemetry lands and how the consumer approves sharing

    App telemetry is written first to the active event table in the consumer account. If the consumer has done nothing, that table is SNOWFLAKE.TELEMETRY.EVENTS, which is active in every account by default. A consumer who wants app telemetry kept apart from other account events can create a custom event table and make it active instead. Snowflake ships two database roles for access: EVENTS_ADMIN manages row-access policies and deletes data, and EVENTS_VIEWER has read-only access to the masked SNOWFLAKE.TELEMETRY.EVENTS_VIEW.

    After installation, the app's event definitions appear in the Events and logs tab on the app's Security page. This is where the consumer enables sharing and switches optional definitions on or off. From then on, each record that passes an enabled definition is also inserted into the provider's event table. There is no daily batch, no file export, and the provider never queries the consumer's table.

    Sharing does not depend on the consumer keeping a local copy. If the consumer sets its event table to NONE, the events are not stored in the consumer account, but they are still shared with the provider. Turning off local storage is not a way to opt out of required definitions.

    Checkpoint 4 of 8· Check yourself

    A consumer's compliance team wants an auditor to read the app telemetry stored in their account. The auditor must not be able to delete event data or change row-access policies. What should they set up?

    Checkpoint 5 of 8· Exam question

    A support engineer is investigating where a newly installed Native App's telemetry data is being stored, and the consumer has not configured any custom event table. Which event table holds this data by default?

    Checkpoint 6 of 8· Exam question

    When event sharing is enabled for a Native App, how does telemetry data actually reach the provider's account?

    Sources31

    4.Provider event accounts, privacy and costs

    Shared events can only be collected in the region where the consumer installed the app. That decides how the provider has to set up. In each region where consumers will share events, the provider needs an event account that has an active event table, and it must exist before consumers install. If it doesn't, the shared copy from that region is dropped. The consumer's own table still keeps its local copy. Snowflake strongly recommends centralized event sharing for new deployments. The per-region setup below is for deployments where that isn't an option.

    Provider-side setup for receiving shared events in a region
    StepCommandConstraint
    Choose the region's event accountSYSTEM$SET_EVENT_SHARING_ACCOUNT_FOR_REGIONRequires an organization administrator role; cannot be a locked, suspended, reader, trial or Snowflake managed account
    Create the tableCREATE EVENT TABLEAn account can hold several event tables
    Make it activeALTER ACCOUNT SET EVENT_TABLEOnly one event table is active at a time
    Review the setupSYSTEM$SHOW_EVENT_SHARING_ACCOUNTSMay lag briefly while metadata reaches all regions
    Making the new event table active in the event accountsql
    ALTER ACCOUNT SET EVENT_TABLE=event_db.event_schema.my_event_table;

    The consumer's identity is protected before any event leaves their account. Each shared record carries RESOURCE_ATTRIBUTES such as the package name, the consumer account locator, the organization, the region and the listing name. Database, query and application identifiers are replaced with SHA-1 hashes (snow.database.hash, snow.query.hash, snow.application.hash). Warehouse names, session IDs, user names and role names are left out entirely. To match a shared event to a local query, the consumer can call SYSTEM$GET_HASH_FOR_APPLICATION or compute the same SHA-1 values.

    The provider pays for shared events. All ingestion and storage costs on the provider side fall on the provider. A broad optional definition such as SNOWFLAKE$ALL is more data you pay to store, so ask for only the definitions you will actually use.

    Checkpoint 7 of 8· Put it in order

    Your team will start offering the app to consumers in a new region and wants to receive their shared events without per-region data loss. Put the provider-side steps in order.

    1. 1.Run CREATE EVENT TABLE in the event account
    2. 2.Run ALTER ACCOUNT SET EVENT_TABLE so the new table becomes the account's active event table
    3. 3.Let consumers in that region install the app and enable event sharing
    4. 4.Use an organization administrator role to call SYSTEM$SET_EVENT_SHARING_ACCOUNT_FOR_REGION and choose that region's event account

    Sources43

    5.Checking application roles from Streamlit code

    A Streamlit page inside an app often has to show different things to different viewers: an admin tab for one application role, a read-only dashboard for another. The page decides by asking Snowflake whether a given application role is activated, and the answer depends on which context you ask about.

    The check is SYS_CONTEXT('SNOWFLAKE$APPLICATION', 'IS_APPLICATION_ROLE_ACTIVATED', <context>, <app_role>). Pass the bare role name. Qualifying it with the app name is a mistake, because the function works out the application from where it is called. The result is the VARCHAR 'TRUE' or 'FALSE', so cast it to BOOLEAN before comparing it with TRUE. An invalid role name also returns 'FALSE' rather than an error, which makes a typo in the role name look like a viewer who lacks access.

    Is the application role in the role hierarchy of the viewer's session?sql
    SELECT SYS_CONTEXT('SNOWFLAKE$APPLICATION', 'IS_APPLICATION_ROLE_ACTIVATED', 'SESSION', 'my_app_role');

    The context argument is the part that matters. SESSION looks at the primary and secondary roles of the current session, which is the viewer. ACTIVE looks at the role executing the current call. Inside an owner's rights procedure, or inside a Streamlit, the active roles can differ from the session roles, so an ACTIVE check answers a question about the owner rather than the person looking at the page. To gate a UI element on who is viewing it, use SESSION.

    IS_APPLICATION_ROLE_IN_SESSION is the older single-purpose form, and it only works when called from within an app. It checks the consumer's current session and does not return TRUE when the app itself calls it, because application roles are owned by the app but not granted to it.

    Checkpoint 8 of 8· Check yourself

    A Streamlit page should show an Admin tab only to viewers whose session holds the application role app_admin. Which call does that?

    Sources56

    Sources

    (6)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “After you publish an app, the log and trace levels cannot be changed.”
      ↩︎ Default log and trace levels in the manifest
      “The manifest log_level does not propagate into containers.”
      ↩︎ Default log and trace levels in the manifest
      “consumers cannot disable event sharing or the required event definitions”
      ↩︎ Event definitions: required and optional filters
      “Snowflake uses the most verbose log and trace levels allowed by the event definitions the consumer has enabled.”
      ↩︎ Event definitions: required and optional filters
      “Snowflake Native Apps with Snowpark Container Services currently only support the SNOWFLAKE$ALL event definition.”
      ↩︎ Event definitions: required and optional filters
      “the event definitions appear in the Events and logs tab on the Security page of the app”
      ↩︎ Where telemetry lands and how the consumer approves sharing
      “Event definitions are filters that act on the log messages and trace events.”
      ↩︎ Key concept
      “Required event definitions are enabled automatically when the app is installed.”
      ↩︎ Exam trap 1
      “Log and tracing levels determine the information that is inserted into the consumer event table.”
      ↩︎ Exam trap 3
      “If neither the log nor tracing levels are set, then the app does not emit any events.”
      ↩︎ Prediction
      “After installing an app with required event definitions, consumers cannot disable event sharing or the required event definitions.”
      ↩︎ Checkpoint
    2. 2.
      “Publishing an app with the trace_level property set to a value other than OFF might expose calls to hidden stored procedures”
      ↩︎ Default log and trace levels in the manifest
    3. 3.
      “The previous event sharing functionality is equivalent to the OPTIONAL ALL event definition.”
      ↩︎ Event definitions: required and optional filters
      “The default SNOWFLAKE.TELEMETRY.EVENTS table is active in every account out of the box.”
      ↩︎ Where telemetry lands and how the consumer approves sharing
      “When event sharing is enabled, the log messages and trace events are inserted into the event table in the provider account.”
      ↩︎ Where telemetry lands and how the consumer approves sharing
      “Providers are responsible for all costs associated with event sharing on the provider side, including data ingestion and storage.”
      ↩︎ Provider event accounts, privacy and costs
      “If the consumer sets the event table to NONE, the events are not stored in the consumer account. They are still shared with the provider.”
      ↩︎ Exam trap 2
      “EVENTS_ADMIN (manage row-access policies and delete data) and EVENTS_VIEWER (read-only access to the masked SNOWFLAKE.TELEMETRY.EVENTS_VIEW)”
      ↩︎ Checkpoint
    4. 4.
      “A provider can collect logs and shared events only in the same region where a consumer installs an app.”
      ↩︎ Provider event accounts, privacy and costs
      “Without an active event table, log messages and trace events that the consumer shares are discarded.”
      ↩︎ Provider event accounts, privacy and costs
      “After creating the event table, use ALTER ACCOUNT … SET EVENT_TABLE to specify that the event table is the active table for the account”
      ↩︎ Checkpoint
    5. 5.
      “Do not qualify the role name with the name of the application.”
      ↩︎ Checking application roles from Streamlit code
      “Do not qualify the role name with the name of the application.”
      ↩︎ Exam trap 4
      “SESSION: Checks if the application role is in the role hierarchy of the current session’s primary or secondary roles.”
      ↩︎ Checkpoint
    6. 6.
      “The currently active roles can differ from the session roles, for example, when executing an owner’s rights procedure or a Streamlit.”
      ↩︎ Checking application roles from Streamlit code

    Continue to part 2 of 2

    Testing a Native App locally with development and debug modes

    Spotted a mistake, or was something unclear? Tell us.