Monitor analysis activity in collaborations¶
Activity history gives every collaborator an audit trail of analysis activity in a collaboration. Each collaborator sees only the activity and detail that is relevant to their role in the collaboration; sensitive information from any partner is never exposed across partners.
When you invoke a template run in a collaboration, you are opting in to sharing the activity metadata described on this page with the other collaborators whose resources were used by your run.
Note
Activity history is available in collaborations created on or after the release of this feature. Collaborations created before this date do not have access to activity history.
What activity is visible to you¶
What you can see in activity history depends on your activity and the resources you contribute to the collaboration:
Runs your account executed: You can always see the full detail of any analysis run your account executed in the collaboration, including template ID, data offerings referenced, source tables, local tables, template arguments, activation destination, duration, status, and failure reason.
Runs on your data offerings: If your account added data offerings to the collaboration, you can see any runs that referenced those offerings, including the analysis runner, duration, status, and the IDs of your data offerings that were used. Source tables from other accounts, local tables, and template arguments are not visible to you for these runs. If a run failed, you see a redacted error message rather than the full failure detail.
Runs that used your template: If your account added a template to the collaboration, you can see any runs that referenced that template, including the analysis runner, duration, and status. Data offering IDs, source tables, local tables, and template arguments are not visible to you for these runs. If a run failed, you see a redacted error message rather than the full failure detail.
If your account contributed multiple resource types, you see the union of all applicable activity.
How to view activity history¶
To view activity history for a collaboration, call VIEW_ACTIVITY_HISTORY with the collaboration name.
Basic query¶
Apply additional filters¶
Pipe the result of the procedure call into a SELECT using RESULT_SCAN to apply additional filters in the same session.
Get query execution details for your account’s runs¶
Each activity record is tagged with its ACTIVITY_ID in your account’s query history. To see the full query execution details
for a run your account submitted, query SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY and filter by the query tag.
Note that the view has a latency before records appear — see QUERY_HISTORY latency expectations for details.
Replace <your_activity_id> with the ACTIVITY_ID value from VIEW_ACTIVITY_HISTORY.
Result columns¶
VIEW_ACTIVITY_HISTORY returns the following columns:
Column |
Type |
Description |
|---|---|---|
|
VARCHAR |
Unique identifier for the activity record. Also added as a Query Tag into the underlying query so you can correlate an entry with account-level query history. |
|
VARCHAR |
Alias of the collaborator that ran the analysis. |
|
TIMESTAMP_LTZ |
Timestamp when the run started. |
|
NUMBER |
Total run duration, in milliseconds. |
|
VARCHAR |
|
|
VARCHAR |
Populated when |
|
VARCHAR |
Type of activity. Currently always |
|
VARIANT |
Additional details about the run. Contents are filtered based on what your account contributed to the collaboration. Possible sub-keys:
|
Access control¶
You must use a role that was granted privileges by calling one of the following procedures:
GRANT_PRIVILEGE_ON_OBJECT_TO_ROLE('VIEW ACTIVITY HISTORY', 'COLLABORATION', 'collaboration name', 'role name')GRANT_PRIVILEGE_ON_ACCOUNT_TO_ROLE('CREATE COLLABORATION', 'role name')GRANT_PRIVILEGE_ON_ACCOUNT_TO_ROLE('JOIN COLLABORATION', 'role name')
Limitations¶
Activation export failures are not surfaced: For activation template runs, a
SUCCESSstatus reflects only that the template query executed successfully. Failures that occur during the export of activation results are not reported in activity history.Free-form SQL activity is not recorded: Activity history only records template runs. Analyses run as free-form SQL queries do not appear in activity history.