Monitor listings

As a data provider, you can track the usage metrics for your listings. There aretwo methods to get the usage metrics for your shared data:

  • Use BigQuery sharing (formerly Analytics Hub). With Sharingyou can view the usage metrics dashboard for your listings that includesdaily subscriptions, daily executed jobs, number of subscribers for eachorganization, and jobs frequency for each table. The usage metrics for yourshared data is retrieved by querying theINFORMATION_SCHEMA.SHARED_DATASET_USAGE view.

  • Use theINFORMATION_SCHEMA view. You can trackhow subscribers use your datasets by directly querying theINFORMATION_SCHEMA.SHARED_DATASET_USAGE view.

Use Sharing

To get the usage metrics for your shared data by using Sharing,follow these steps:

  1. In the Google Cloud console, go to theSharing (Analytics Hub) page.

    Go to Sharing (Analytics Hub)

  2. Click thedata exchangename that contains the listing for which you want to view the usage metrics.

  3. ClickUsage metrics, and then do the following:

    1. From theListings menu, select the listing.

    2. Set the time range.

The page displays the following usage metrics:

  • Total Subscriptions: the number of current subscriptions on the selectedlisting. You can view total subscriptions for up to 60 days.
  • Total Subscribers: the number of unique subscribers across allsubscriptions on the selected listing. You can view total subscribers for up to60 days.
  • Total jobs executed: the number of unique jobs run on each table of theselected listing.
  • Total bytes scanned: the total number of bytes scanned from all tables ofthe selected listing.
  • Daily Subscriptions: the chart that tracks the number of subscriptions forthe selected listing over a time period. You can view daily subscriptions forup to 60 days.
  • Subscribers per organization: lists the organizations and their number ofsubscribers that consume your selected listing.
  • Daily Executed Jobs: this chart displays the jobs consumption from theselected listing.
  • Tables' job frequency: the frequency at which the tables are accessed on theselected listing.
Note: You can also use theBigQuery sharing subscriber APIs to retrieve theTotal Subscriptions,Total Subscribers, andDaily Subscriptionsfields.

UseINFORMATION_SCHEMA view

If you are a data provider, you can track how subscribers use your datasets byquerying theINFORMATION_SCHEMA.SHARED_DATASET_USAGE view.Ensure that you have the required role to query this view.

To run the query against a project other than your default project, add theproject ID in the following format:

PROJECT_ID.region-REGION_NAME.INFORMATION_SCHEMA.SHARED_DATASET_USAGE

For example,myproject.region-us.INFORMATION_SCHEMA.SHARED_DATASET_USAGE.

The following examples describe how to view the usage metrics by querying theINFORMATION_SCHEMA view:

Get the total number of jobs executed on all shared tables

The following example calculates total jobs run bysubscribers for a project:

SELECTCOUNT(DISTINCTjob_id)ASnum_jobsFROM`region-us`.INFORMATION_SCHEMA.SHARED_DATASET_USAGE

The result is similar to the following:

+------------+| num_jobs   |+------------+| 1000       |+------------+

To check the total jobs run by subscribers, use theWHERE clause:

  • For datasets, useWHERE dataset_id = "...".
  • For tables, useWHERE dataset_id = "..." AND table_id = "...".

Get the most used table based on the number of rows processed

The following query calculates the most used table based on the number of rowsprocessed by subscribers.

SELECTdataset_id,table_id,SUM(num_rows_processed)ASusage_rowsFROM`region-us`.INFORMATION_SCHEMA.SHARED_DATASET_USAGEGROUPBY1,2ORDERBY3DESCLIMIT1

The output is similar to the following:

+---------------+-------------+----------------+| dataset_id    | table_id      | usage_rows     |+---------------+-------------+----------------+| mydataset     | mytable     | 15             |+---------------+-------------+----------------+

Find the top organizations that consume your tables

The following query calculates the top subscribers based on the number of bytesprocessed from your tables. You can also use thenum_rows_processed column asa metric.

SELECTsubscriber_org_number,ANY_VALUE(subscriber_org_display_name)ASsubscriber_org_display_name,SUM(total_bytes_processed)ASusage_bytesFROM`region-us`.INFORMATION_SCHEMA.SHARED_DATASET_USAGEGROUPBY1

The output is similar to the following:

+--------------------------+--------------------------------+----------------+|subscriber_org_number     | subscriber_org_display_name    | usage_bytes    |+-----------------------------------------------------------+----------------+| 12345                    | myorganization                 | 15             |+--------------------------+--------------------------------+----------------+

For subscribers without an organization, you can usejob_project_numberinstead ofsubscriber_org_number.

Get usage metrics for your data exchange

If yourdata exchangeand source dataset are in different projects, followthese step to view the usage metrics for your data exchange:

  1. Find alllistings thatbelong to your data exchange.
  2. Retrieve the source dataset attached to the listing.
  3. To view the usage metrics for your data exchange, use the following query:
SELECT*FROMsource_project_1.`region-us`.INFORMATION_SCHEMA.SHARED_DATASET_USAGEWHEREdataset_id='source_dataset_id'ANDdata_exchange_id="projects/4/locations/us/dataExchanges/x1"UNIONALLSELECT*FROMsource_project_2.`region-us`.INFORMATION_SCHEMA.SHARED_DATASET_USAGEWHEREdataset_id='source_dataset_id'ANDdata_exchange_id="projects/4/locations/us/dataExchanges/x1"

Get usage metrics for shared views

The following query displays the usage metrics for all of the shared viewspresent in a project:

SELECTproject_id,dataset_id,table_id,num_rows_processed,total_bytes_processed,shared_resource_id,shared_resource_type,referenced_tablesFROM`myproject`.`region-us`.INFORMATION_SCHEMA.SHARED_DATASET_USAGEWHEREshared_resource_type='VIEW'

The output is similar to the following:

+---------------------+----------------+----------+--------------------+-----------------------+--------------------+----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+|     project_id      |   dataset_id   | table_id | num_rows_processed | total_bytes_processed | shared_resource_id | shared_resource_type |                                                                                                              referenced_tables                                                                                                              |+---------------------+----------------+----------+--------------------+-----------------------+--------------------+----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+|     myproject       | source_dataset | view1    |                  6 |                    38 | view1              | VIEW                 | [{"project_id":"myproject","dataset_id":"source_dataset","table_id":"test_table","processed_bytes":"21"},{"project_id":"bq-dataexchange-exp","dataset_id":"other_dataset","table_id":"other_table","processed_bytes":"17"}]                 |+---------------------+----------------+----------+--------------------+-----------------------+--------------------+----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Get usage metrics for shared table valued functions

The following query displays the usage metrics for all of the shared tablevalued functions present in a project:

SELECTproject_id,dataset_id,table_id,num_rows_processed,total_bytes_processed,shared_resource_id,shared_resource_type,referenced_tablesFROM`myproject`.`region-us`.INFORMATION_SCHEMA.SHARED_DATASET_USAGEWHEREshared_resource_type='TABLE_VALUED_FUNCTION'

The output is similar to the following:

+---------------------+----------------+----------+--------------------+-----------------------+--------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------+|     project_id      |   dataset_id   | table_id | num_rows_processed | total_bytes_processed | shared_resource_id | shared_resource_type  |                                                  referenced_tables                                                  |+---------------------+----------------+----------+--------------------+-----------------------+--------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------+|     myproject       | source_dataset |          |                  3 |                    45 | provider_exp       | TABLE_VALUED_FUNCTION | [{"project_id":"myproject","dataset_id":"source_dataset","table_id":"test_table","processed_bytes":"45"}]           |+---------------------+----------------+----------+--------------------+-----------------------+--------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------+

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.