Data Sharing and Snowflake Marketplace · Topic 10 of 10
Monitoring Data Sharing Usage and Managing Native Apps
Monitor data sharing usage with the DATA_SHARING_USAGE views and Provider Studio, and manage Snowflake Native Apps, versions, patches and consumer grants.
- 5 min
SNOWFLAKE.DATA_SHARING_USAGEholds listing usage views; only the publishing account sees the data.SNOWFLAKE.SHARING_USAGE_VIEWERlets a non admin role read them.- Latency is up to 2 days for most views;
APPLICATION_STATEis up to 10 minutes.
What it is
Two last duties close the chapter. A provider has to see who uses its shared data and listings, how often, and what it costs. And an administrator has to manage Native Apps, which are applications that a provider packages with data and logic and delivers through a listing.
How it works
Monitor data sharing usage
Listing activity is recorded in the SNOWFLAKE.DATA_SHARING_USAGE schema. Their data is available only to the account that published each listing.
| View | What it covers (provider side) | Latency |
|---|---|---|
LISTING_ACCESS_HISTORY | Access to listings | Up to 2 days |
LISTING_CONSUMPTION_DAILY | Daily consumption by consumers | Up to 2 days |
LISTING_EVENTS_DAILY | Daily listing events | Up to 2 days |
LISTING_TELEMETRY_DAILY | Daily telemetry such as clicks | Up to 2 days |
LISTING_AUTO_FULFILLMENT_REFRESH_DAILY | Refreshes of auto fulfilled listings | Up to 2 days |
LISTING_AUTO_FULFILLMENT_DATABASE_STORAGE_DAILY | Storage for auto fulfilled databases | Up to 2 days |
MONETIZED_USAGE_DAILY | Usage of paid listings | Up to 2 days |
APPLICATION_STATE | State of shared applications | Up to 10 minutes |
MARKETPLACE_LISTING_INVOICE_STATUS | Status of listing invoices | Up to 24 hours |
Latency figures are approximate. Do not build alerts that expect same hour data from the daily views.
Access rules:
- Only
ACCOUNTADMINcan query theSNOWFLAKEdatabase by default. - To let another role read the sharing views without the rest of the database, grant it the
SNOWFLAKE.SHARING_USAGE_VIEWERdatabase role.
GRANT DATABASE ROLE SNOWFLAKE.SHARING_USAGE_VIEWER TO ROLE sharing_analyst;
SELECT * FROM SNOWFLAKE.DATA_SHARING_USAGE.LISTING_CONSUMPTION_DAILY
ORDER BY 1 DESC;
Provider Studio also shows listing analytics in Snowsight, so a business owner does not need SQL.
Other checks an administrator does on shares:
| Question | How |
|---|---|
| Which accounts can query this share | SHOW GRANTS OF SHARE |
| Which objects are in the share | SHOW GRANTS TO SHARE |
| What do shares cost the provider | Storage of the shared objects, plus replication and auto fulfillment storage and refresh costs |
| Is a refresh failing | Daily failure email to the listing contact, and the auto fulfillment refresh view |
Consumers pay for their own queries on shared data. The provider's cost is storage and, for cross region delivery, the replication costs. Reader accounts are the exception: the provider pays their compute.
Manage Native Apps
The Snowflake Native App Framework lets a provider deliver data and application logic that runs in the consumer's account. It builds on listings, so the app reaches consumers through the Marketplace or a private listing, either free or paid.
| Piece | Meaning |
|---|---|
| Application package | The provider's bundle: data content, logic, a manifest file, a setup script, versions and patches |
| Manifest file | Configuration of the app, including where the setup script lives |
| Setup script | SQL that runs when the app is installed or upgraded |
| Application | The database object installed in the consumer account |
| Version and patch | How the provider releases changes; rolled out step by step |
| Listing | How consumers find and install the app |
Provider side tasks:
- Build the package with a manifest and setup script, test it as an installed application, then add versions and patches.
- Attach the package to a listing. Application packages must use Cross-Cloud Auto-Fulfillment to reach other regions, and their refresh is scheduled at the account level.
- Watch installs and states in
APPLICATION_STATEandPROVIDER_APPLICATION_DAILY_USAGE_HISTORY. - Use the event logging that the framework supports to troubleshoot. Consumers can enable logging and share events with the provider.
Consumer side tasks:
- Install the app from the listing, which creates the application and runs its setup script.
- Grant the app the privileges it asks for, so it can reach the objects it needs. The app has no access that the consumer has not granted.
- Apply upgrades when the provider releases a new version or patch.
- Review the access the app holds from time to time, and remove it when the app is no longer used.
Do not grant an app broad privileges "to make it work". Grant only the objects and privileges the provider documents, because the app runs inside your account.
| Concern | Provider | Consumer |
|---|---|---|
| Who builds the logic | Provider | Not involved |
| Where it runs | Consumer account | Consumer account |
| Who grants access to data | Provider defines what it needs | Consumer grants |
| Updates | Releases versions and patches | Applies upgrades |
Common mistakes
Expecting live usage numbers in the daily views. Most have up to two days of latency.
Giving ACCOUNTADMIN to analysts to read usage. Grant SNOWFLAKE.SHARING_USAGE_VIEWER instead.
Thinking shared queries cost the provider compute. The consumer's warehouse pays, except in reader accounts.
Installing an app and granting everything. Grant only what the app needs.
Putting an application package on a listing without auto fulfillment for other regions. It must use it to reach them.
What to remember for the exam
SNOWFLAKE.DATA_SHARING_USAGEholds listing usage views; only the publishing account sees the data.SNOWFLAKE.SHARING_USAGE_VIEWERlets a non admin role read them.- Latency is up to 2 days for most views;
APPLICATION_STATEis up to 10 minutes. - Native App parts: application package, manifest, setup script, application, versions and patches.
- Consumers grant privileges to the app; providers release upgrades.
Check yourself
Which database role gives read access to the sharing usage views without full
ACCOUNTADMIN?SNOWFLAKE.SHARING_USAGE_VIEWER.What runs when a Native App is installed?
The setup script defined in the application package.
Who decides what a Native App may access in the consumer account?
The consumer, by granting privileges to the app.
Topic 10 of 10 in Data Sharing and Snowflake Marketplace
Test yourself on Data Sharing and Snowflake Marketplace
The full Snowflake ADA-C02 question bank has 814 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Snowflake. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.