Monitoring billing for tenants

All tenants are billed as part of their Identity Platform project. This document explains how to export billing data and monitor the cost of individual tenants.

Before you begin

To export tenant billing data, you'll need to be granted the IAM Owner role (roles/owner) on the following:

  • An Identity Platform project with multi-tenancy enabled.
  • The billing account linked to your project.

Enabling billing export to BigQuery

To make billing data available in BigQuery, follow the steps in Export billing data to BigQuery.

You only need to complete the step once per project.

Querying billing data

  1. Open the BigQuery page in the Google Cloud console.
    Go to the BigQuery page

  2. Select the table containing your project's billing information.

  3. Click Compose Query to open the query editor.

  4. Enter a query.

    To list the total cost for each tenant, use the following, replacing dataset-name.table-name with the name of the billing dataset and table you exported in step 1:

    SELECTlabels.valueasTenant,SUM(cost)asTenantCost
    FROM[dataset-name.table-name]
    WHERElabels.key="goog-identitytoolkit-tenant"
    GROUPBY1
    

    All monthly active user reports have a start time at the beginning of the month. You can use WHERE usage_start_time and the first day of the month (expressed in Pacific Time) to filter on a monthly basis. For example, to list the cost of each tenant for August 2019:

    SELECTlabels.valueasTenant,SUM(cost)asTenantCost
    FROM[dataset-name.table-name]
    WHERElabels.key="goog-identitytoolkit-tenant"
    ANDusage_start_time="2019-08-01 00:00:00 -07:00"
    GROUPBY1
    

    You can also get the costs for one specific tenant. Replace tenant-id with the ID of your tenant in the following example:

    SELECTlabels.valueasTenant,SUM(cost)asTenantCost
    FROM[dataset-name.table-name]
    WHERElabels.key="goog-identitytoolkit-tenant"
    ANDlabels.value="tenant-id"
    GROUPBY1
    
  5. Click Run query to execute it.

You should see a billing breakdown specific to one particular tenant.

What's next

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

Last updated 2026年01月02日 UTC.