Event logging for Snowpipe¶
Snowpipe can record events in your active event table as it processes files and as the state of a pipe changes. Use these events to do the following:
- Follow each file through a pipe, from the moment that Snowpipe receives it until it loads or fails.
- Find out when a Google Cloud Storage or Microsoft Azure notification channel can’t be read, which usually means a configuration problem such as missing permissions.
- See when a pipe pauses, resumes, stops, or is throttled.
- Measure how long Snowpipe takes to load each file.
- Get alerted when a pipe or a file has an error.
Pipes that load Apache Iceberg™ tables record the same events as pipes that load standard tables.
Note
Recording events in an event table incurs costs. For more information, see Costs of telemetry data collection.
Before you begin¶
Make sure that you have the following:
- An active event table: Snowflake writes Snowpipe events to the active event table that’s associated with the pipe. By default, that’s the account’s event table,
SNOWFLAKE.TELEMETRY.EVENTS. If you associate a different event table with the account, or with the database that contains the pipe, pipe events go there instead. Notification channel events always go to the account’s event table. To find the account’s event table, runSHOW PARAMETERS LIKE 'EVENT_TABLE' IN ACCOUNT;. For more information, see Event table overview. - Privileges to set the event level: To set the
LOG_EVENT_LEVELparameter, you need theMODIFY LOG EVENT LEVELprivilege on the account. To set it on a pipe, you also need theOPERATEorOWNERSHIPprivilege on the pipe and theUSAGEprivilege on the database and schema that contain the pipe. To set it on a database or schema, you also need theMODIFYprivilege on that database or schema. For more information, see Setting levels for logging, metrics, and tracing. - Privileges to query events: To query
SNOWFLAKE.TELEMETRY.EVENTS, use a role that’s granted theSNOWFLAKE.EVENTS_ADMINapplication role. For read-only access that can’t delete events, use a role that’s granted theSNOWFLAKE.EVENTS_VIEWERapplication role, and query theSNOWFLAKE.TELEMETRY.EVENTS_VIEWview instead. For more information, see Roles for access to the default event table and EVENTS_VIEW.
Enable Snowpipe events¶
Snowpipe records events only when the LOG_EVENT_LEVEL parameter is set to a level other than OFF, which is the default. If LOG_LEVEL was set before the 2026_02 behavior change bundle, LOG_EVENT_LEVEL was initialized to the same value, so Snowpipe might already record events. To check the account-level value, run SHOW PARAMETERS LIKE 'LOG_EVENT_LEVEL' IN ACCOUNT;.
You can set LOG_EVENT_LEVEL on the account, a database, a schema, or an individual pipe. A pipe that doesn’t have its own setting inherits the level from its schema, its database, or the account, in that order:
Keep the following in mind when you choose where to set the level:
- An account-level setting also records events from tasks, dynamic tables, and other features that write events to the event table, and those extra events add cost. To record events only for Snowpipe, set the level on individual pipes.
- A level that you set on a pipe applies only to that pipe, so set it again on pipes that you create or recreate later. To cover future pipes too, set the level on the schema or database that contains them. That setting also applies to other objects in the schema or database that record events.
- A level that you set on a pipe doesn’t record
notification_receivedornotification_channel_erroredevents, because those events belong to a notification channel rather than a pipe. To record them, setLOG_EVENT_LEVELon the account.
Snowpipe records events at the level that you set and at every more severe level. The following table shows the Snowpipe events that each level captures:
| Level | Events captured |
|---|---|
ERROR | Files that failed to load, pipes that stopped or stalled because of an error, and notification channel errors (only when you set the level on the account) |
WARN | The ERROR events, plus throttled pipes, cloned pipes, and pipes that Snowflake stopped (STOPPED_BY_SNOWFLAKE_ADMIN or STOPPED_FEATURE_DISABLED) |
INFO | The WARN events, plus pipes that were paused or resumed |
DEBUG | The INFO events, plus every file that Snowpipe receives, skips, and loads |
TRACE | The DEBUG events, plus every event notification that Snowflake receives (only when you set the level on the account) |
DEBUG and TRACE record at least one event for each file, so they produce many more events, and higher costs, than the other levels. For continuous monitoring, start with ERROR or WARN, and use DEBUG when you need to follow individual files.
Query Snowpipe events¶
The following examples query the default event table, SNOWFLAKE.TELEMETRY.EVENTS. Keep the following in mind:
- If you use a different event table, replace the table name. If the database that contains a pipe has its own event table, that pipe’s events go there, but notification channel events still go to the account’s event table. In that case, query both tables. To find a database’s event table, run
SHOW PARAMETERS LIKE 'EVENT_TABLE' IN DATABASE mydb;. - Examples that read fields from the
VALUEcolumn usePARSE_JSON. State values are uppercase, such asRECEIVED,INGESTED, andFAILED. - Pipe names in event attributes are uppercase, unless you created the pipe with a quoted name.
- The
TIMESTAMPcolumn is aTIMESTAMP_NTZvalue in UTC, so the examples compare it withSYSDATE(), which returns the current UTC time. Comparing it withCURRENT_TIMESTAMP()shifts the time range by your session’s offset from UTC. - For the fields that each type of event records, see Snowpipe event types.
Find recent errors¶
The following query returns the Snowpipe errors from the last 24 hours, including files that failed to load, notification channel errors, and pipes that stopped or stalled because of an error:
Follow a file through a pipe¶
With LOG_EVENT_LEVEL set to DEBUG or TRACE, the following query returns the file_lifecycle events for a single file, in order:
For a file that loaded successfully, the query returns a RECEIVED state followed by an INGESTED state. For a file that failed, the last state is FAILED, and first_error_message shows the first error. If the pipe ignored the file because it already processed a file with the same path and name, the state is SKIPPED.
Measure how long files take to load¶
With LOG_EVENT_LEVEL set to DEBUG or TRACE, the following query compares when Snowpipe received each file with when it loaded the file:
To measure load times without recording DEBUG events, compare the PIPE_RECEIVED_TIME and FIRST_COMMIT_TIME columns of the COPY_HISTORY view.
Get alerted about Snowpipe problems¶
To be notified when Snowpipe records a problem, create an alert that checks Snowpipe events. You can create an alert from a template for common problems, such as pipes that stop, or write your own alert for other problems, such as files that fail to load. For both options, and for an alert that detects when event notifications stop arriving, see Monitor Snowpipe with alerts.
Snowpipe event types¶
The name key in the RECORD column identifies the type of each Snowpipe event:
| Event | When Snowpipe records it | Severity |
|---|---|---|
| file_lifecycle | When Snowpipe receives a file, skips it, loads it, or fails to load it | DEBUG when a file is received, skipped, or loaded; ERROR when it fails to load |
| notification_received | When Snowflake receives an event notification | TRACE |
| notification_channel_errored | When Snowflake can’t read messages from a notification channel | ERROR |
| pipe_lifecycle | When the state of a pipe changes | INFO when you pause or resume a pipe; WARN or ERROR when it stops or stalls |
| pipe_throttled | When Snowflake temporarily stops adding files to a pipe’s queue because of a rate limit | WARN |
file_ lifecycle¶
Snowpipe records a file_lifecycle event at each step of a file’s progress through a pipe. The RECORD_ATTRIBUTES column contains the path of the file in snow.file.path.
When Snowpipe receives a request to load a file, it records an event with a state value of RECEIVED. If the pipe already processed a file with the same path and name, the state is SKIPPED instead. SKIPPED doesn’t mean that the file had errors: a file that doesn’t load because of errors, including under ON_ERROR = SKIP_FILE, has the FAILED state, as shown later in this section. The following example shows a RECEIVED or SKIPPED event:
After Snowpipe loads the file, it records an event with a state value of INGESTED. Snowpipe also records INGESTED for a file that loads partially, for example with ON_ERROR = CONTINUE. The following example shows an INGESTED event:
If Snowpipe doesn’t load the file because of errors, it records an ERROR event with a state value of FAILED. The event includes the first error in the file, where the error occurred, and how many errors the file contains:
notification_ received¶
Snowflake records a notification_received event when it receives an event notification from your cloud storage service. The RESOURCE_ATTRIBUTES column identifies the notification channel rather than a pipe, because one channel can serve several pipes. The following example shows a notification_received event:
notification_ channel_ errored¶
Snowflake records a notification_channel_errored event when it can’t read messages from a notification channel. Snowflake records this event for Google Cloud Storage and Microsoft Azure notification channels. The error usually means a configuration problem, such as missing permissions on the notification channel. The following example shows a notification_channel_errored event:
pipe_ lifecycle¶
Snowpipe records a pipe_lifecycle event when the state of a pipe changes. When you pause or resume the pipe itself with PIPE_EXECUTION_PAUSED, the event has INFO severity:
When a pipe stops processing files, its state starts with STOPPED_ or STALLED_, and the event includes an error message:
The severity depends on why the pipe stopped:
WARN:STOPPED_BY_SNOWFLAKE_ADMIN,STOPPED_CLONED, orSTOPPED_FEATURE_DISABLED.ERROR:STOPPED_STAGE_ALTERED,STOPPED_STAGE_DROPPED,STOPPED_NOTIFICATION_INTEGRATION_DROPPED,STOPPED_MISSING_PIPE,STOPPED_MISSING_TABLE,STALLED_COMPILATION_ERROR,STALLED_INITIALIZATION_ERROR,STALLED_EXECUTION_ERROR,STALLED_INTERNAL_ERROR, orSTALLED_STAGE_PERMISSION_ERROR.
For what each state means and how to fix it, see Pipe execution states.
pipe_ throttled¶
Snowpipe records a pipe_throttled event when Snowflake temporarily stops adding files to a pipe’s queue, because the account, the pipe, or the target table exceeded the rate at which Snowpipe accepts new files. The event lists the files that Snowflake didn’t add to the queue. For a pipe that uses automated loading, Snowflake retries these files from the event notifications later, so they load after a delay. If you call the Snowpipe REST API, throttled requests fail with HTTP error 429, so submit those files again. If pipe_throttled events continue, contact Snowflake Support. The following example shows a pipe_throttled event:
Event table columns for Snowpipe events¶
Snowpipe events populate the following columns in the event table, and leave all other columns NULL:
| Column | Data type | Description |
|---|---|---|
TIMESTAMP | TIMESTAMP_NTZ | The UTC time when the event was created. |
RESOURCE_ATTRIBUTES | OBJECT | The object that the event is about: the database, schema, and pipe, or the notification channel. See the next table. |
RECORD_TYPE | STRING | The type of record. For Snowpipe events, this value is always EVENT. |
RECORD | OBJECT | The name of the event, in the name key, and its severity, in the severity_text key. |
RECORD_ATTRIBUTES | OBJECT | For file_lifecycle events, the path of the file, in the snow.file.path key. |
VALUE | VARIANT | Details that depend on the event type, such as the state of a file or a pipe, or an error message. For examples, see Snowpipe event types. |
The RESOURCE_ATTRIBUTES column contains the following keys:
| Key | Data type | Description | Example |
|---|---|---|---|
snow.database.name | VARCHAR | The name of the database that contains the pipe. | "MYDB" |
snow.schema.name | VARCHAR | The name of the schema that contains the pipe. | "MYSCHEMA" |
snow.pipe.name | VARCHAR | The name of the pipe. | "ORDERS_PIPE" |
snow.notification_channel.name | VARCHAR | For notification events, the name of the notification channel that received the message or encountered the error. | "arn:aws:sqs:us-west-2:123456789012:sf-snowpipe-AIDA3" |