Schema:

ACCOUNT_USAGE

SNOWPIPE_STREAMING_CLIENT_HISTORY view

This Account Usage view can be used to query the events recorded for Snowpipe Streaming clients within the last 365 days (1 year). Each row is a single client event, such as BLOB_PERSIST, with the time the event occurred and the size of the blob. The view doesn’t record durations. It covers your entire Snowflake account.

Columns

Column NameData TypeDescription
CLIENT_NAMEVARCHARName of the Snowpipe Streaming ingest client.
SNOWFLAKE_PROVIDED_IDVARCHARInternal/system-generated identifier for the Snowpipe Streaming ingest client used for the data load.
EVENT_TIMESTAMPTIMESTAMP_LTZTime (in the local time zone) at which the event occurred.
EVENT_TYPEVARCHARType of the event.
BLOB_SIZE_BYTESNUMBERThe blob size in bytes.

Usage notes

  • Latency for the view may be up to 120 minutes (2 hours).
  • Each row is a single event and has no end time or elapsed duration. For billing, each distinct second that has one or more events counts as one client-second.

Examples

Query the Snowpipe Streaming client events recorded within the last 365 days.

SELECT * FROM SNOWFLAKE.ACCOUNT_USAGE.SNOWPIPE_STREAMING_CLIENT_HISTORY;

The query returns the following results.

+----------------+----------------------------+------------------------------+--------------+----------------+
|    CLIENT_NAME |    SNOWFLAKE_PROVIDED_ID   |              EVENT_TIMESTAMP |   EVENT_TYPE | BLOB_SIZE_BYTES|
|----------------+--------------------------- +------------------------------+--------------|----------------|
|      MY_CLIENT |FE0B1xJrBAAL3bAAUz1M9876nMCd| 2023-02-04 02:07:34.000 +0000| BLOB_PERSIST |           1,648|
|      MY_CLIENT |D1CIBBPGGFyprBanMvAA1234V3ss| 2023-02-04 02:15:54.000 +0000| BLOB_PERSIST |           3,120|
+----------------+----------------------------+------------------------------+--------------+----------------+

Query the hourly credits consumed by each client loading data into Snowflake tables using Snowpipe Streaming within the last 365 days.

SELECT COUNT(DISTINCT event_timestamp) AS client_seconds, date_trunc('hour',event_timestamp) AS event_hour, client_seconds*0.000002777777778 as credits, client_name, snowflake_provided_id
FROM SNOWFLAKE.ACCOUNT_USAGE.SNOWPIPE_STREAMING_CLIENT_HISTORY
GROUP BY event_hour, client_name, snowflake_provided_id;

The query uses COUNT(DISTINCT event_timestamp) because there can be multiple events per second. Each distinct second counts once, regardless of the number of events in that second.