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
In a nutshell
  • SNOWFLAKE.DATA_SHARING_USAGE holds listing usage views; only the publishing account sees the data.
  • SNOWFLAKE.SHARING_USAGE_VIEWER lets a non admin role read them.
  • Latency is up to 2 days for most views; APPLICATION_STATE is 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.

Providerlisting or shareconsumers useUsage dataSNOWFLAKE.DATA_SHARING_USAGEread byProvider adminACCOUNTADMIN or SHARING_USAGE_VIEWERacts onListing changesprice, regions, access

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.

ViewWhat it covers (provider side)Latency
LISTING_ACCESS_HISTORYAccess to listingsUp to 2 days
LISTING_CONSUMPTION_DAILYDaily consumption by consumersUp to 2 days
LISTING_EVENTS_DAILYDaily listing eventsUp to 2 days
LISTING_TELEMETRY_DAILYDaily telemetry such as clicksUp to 2 days
LISTING_AUTO_FULFILLMENT_REFRESH_DAILYRefreshes of auto fulfilled listingsUp to 2 days
LISTING_AUTO_FULFILLMENT_DATABASE_STORAGE_DAILYStorage for auto fulfilled databasesUp to 2 days
MONETIZED_USAGE_DAILYUsage of paid listingsUp to 2 days
APPLICATION_STATEState of shared applicationsUp to 10 minutes
MARKETPLACE_LISTING_INVOICE_STATUSStatus of listing invoicesUp to 24 hours

Latency figures are approximate. Do not build alerts that expect same hour data from the daily views.

Access rules:

  • Only ACCOUNTADMIN can query the SNOWFLAKE database by default.
  • To let another role read the sharing views without the rest of the database, grant it the SNOWFLAKE.SHARING_USAGE_VIEWER database 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:

QuestionHow
Which accounts can query this shareSHOW GRANTS OF SHARE
Which objects are in the shareSHOW GRANTS TO SHARE
What do shares cost the providerStorage of the shared objects, plus replication and auto fulfillment storage and refresh costs
Is a refresh failingDaily failure email to the listing contact, and the auto fulfillment refresh view
Exam tip

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.

PieceMeaning
Application packageThe provider's bundle: data content, logic, a manifest file, a setup script, versions and patches
Manifest fileConfiguration of the app, including where the setup script lives
Setup scriptSQL that runs when the app is installed or upgraded
ApplicationThe database object installed in the consumer account
Version and patchHow the provider releases changes; rolled out step by step
ListingHow consumers find and install the app
Providerapplication packageadd version and patchReleaseversion, patchlisting deliversConsumerinstalls appgrantsApplicationruns setup script

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_STATE and PROVIDER_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.
Watch out

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.

ConcernProviderConsumer
Who builds the logicProviderNot involved
Where it runsConsumer accountConsumer account
Who grants access to dataProvider defines what it needsConsumer grants
UpdatesReleases versions and patchesApplies 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_USAGE holds listing usage views; only the publishing account sees the data.
  • SNOWFLAKE.SHARING_USAGE_VIEWER lets a non admin role read them.
  • Latency is up to 2 days for most views; APPLICATION_STATE is 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.