Pré-requis
Il est possible de créer plusieurs tables de billing sur BigQuery. ces tables ont toutes un historique de 180 jours.
Vous disposez de 4 tables de données de jobs (dérouler pour afficher leur schema) :
INFORMATION_SCHEMA.JOBS
Anciennement nommée INFORMATION_SCHEMA.JOBS_BY_PROJECT, la vue INFORMATION_SCHEMA.JOBS contient des métadonnées en temps quasi réel sur toutes les tâches BigQuery du projet actuel.
Column name | Data type | Value |
bi_ engine_ statistics | RECORD | If the project is configured to use the BI Engine SQL Interface, then this field contains BiEngineStatistics. Otherwise NULL . |
cache_ hit | BOOLEAN | Whether the query results of this job were from a cache. If you have a multi-query statement job, cache_ hit for your parent query is NULL . |
creation_ time | TIMESTAMP | (Partitioning column) Creation time of this job. Partitioning is based on the UTC time of this timestamp. |
destination_ table | RECORD | Destination table for results, if any. |
dml_ statistics | RECORD | If the job is a query with a DML statement, the value is a record with the following fields:
• inserted_row_count : The number of rows that were inserted.
• deleted_row_count : The number of rows that were deleted.
• updated_row_count : The number of rows that were updated.For all other jobs, the value is NULL .This column is present in the INFORMATION_ SCHEMA. JOBS_ BY_ USER and INFORMATION_ SCHEMA. JOBS_ BY_ PROJECT views. |
end_ time | TIMESTAMP | End time of this job. |
error_ result | RECORD | Details of any errors as ErrorProto objects. |
job_ id | STRING | The ID of the job. For example, bquxjob_ 1234 . |
job_ stages | RECORD | Query stages of the job. |
job_ type | STRING | The type of the job. Can be QUERY , LOAD , EXTRACT , COPY , or NULL . A NULL value indicates an internal job, such as a script job statement evaluation or a materialized view refresh. |
labels | RECORD | Array of labels applied to the job as key-value pairs. |
parent_ job_ id | STRING | ID of the parent job, if any. |
principal_ subject | STRING | (Clustering column) The principal identifier of the user who ran the job. |
priority | STRING | The priority of this job. Valid values include INTERACTIVE and BATCH . |
project_ id | STRING | (Clustering column) The ID of the project. |
project_ number | INTEGER | The number of the project. |
query | STRING | SQL query text. Only the JOBS_ BY_ PROJECT view has the query column. |
referenced_ tables | RECORD | Array of tables referenced by the job. Only populated for query jobs. |
reservation_ id | STRING | Name of the primary reservation assigned to this job, in the format RESERVATION_ ADMIN_ PROJECT:RESERVATION_ LOCATION. RESERVATION_ NAME .In this output:
• RESERVATION_ADMIN_PROJECT : the name of the Google Cloud project that administers the reservation
• RESERVATION_LOCATION : the location of the reservation
• RESERVATION_NAME : the name of the reservation |
session_ info | RECORD | |
start_ time | TIMESTAMP | Start time of this job. |
state | STRING | Running state of the job. Valid states include PENDING , RUNNING , and DONE . |
statement_ type | STRING | The type of query statement. For example, DELETE , INSERT , SCRIPT , SELECT , or UPDATE . See QueryStatementType for list of valid values. |
timeline | RECORD | Query timeline of the job. Contains snapshots of query execution. |
total_ bytes_ billed | INTEGER | If the project is configured to use on-demand pricing, then this field contains the total bytes billed for the job. If the project is configured to use flat-rate pricing, then you are not billed for bytes and this field is informational only.
Note: This column's values are empty for queries that read from tables with row-level access policies. For more information, see best practices for row-level security in BigQuery. |
total_ bytes_ processed | INTEGER | Total bytes processed by the job. |
total_ modified_ partitions | INTEGER | The total number of partitions the job modified. This field is populated for LOAD and QUERY jobs. |
total_ slot_ ms | INTEGER | Slot milliseconds for the job over its entire duration. |
transaction_ id | STRING | ID of the transaction in which this job ran, if any. (Preview) |
user_ email | STRING | (Clustering column) Email address or service account of the user who ran the job. |
query_ info. resource_ warning | STRING | The warning message that appears if the resource usage during query processing is above the internal threshold of the system.A successful query job can have the resource_ warning field populated. With resource_ warning , you get additional data points to optimize your queries and to set up monitoring for performance trends of an equivalent set of queries by using query_ hashes . |
query_ info. query_ hashes. normalized_ literals | RECORD | Contains the hashes of the query. normalized_ literals is a hexadecimal STRING hash that ignores comments, parameter values, UDFs, and literals.This field appears for successful GoogleSQL queries that are not cache hits. |
transferred_ bytes | INTEGER | Total bytes transferred for cross-cloud queries, such as BigQuery Omni cross-cloud transfer jobs. |
INFORMATION_SCHEMA.JOBS_BY_USER
La vue INFORMATION_SCHEMA.JOBS_BY_USER contient des métadonnées en temps quasi réel sur les tâches BigQuery soumises par l'utilisateur actuel dans le projet en cours.
Column name | Data type | Value |
bi_ engine_ statistics | RECORD | If the project is configured to use the BI Engine SQL Interface, then this field contains BiEngineStatistics. Otherwise NULL . |
cache_ hit | BOOLEAN | Whether the query results of this job were from a cache. If you have a multi-query statement job, cache_ hit for your parent query is NULL . |
creation_ time | TIMESTAMP | (Partitioning column) Creation time of this job. Partitioning is based on the UTC time of this timestamp. |
destination_ table | RECORD | Destination table for results, if any. |
dml_ statistics | RECORD | If the job is a query with a DML statement, the value is a record with the following fields:
• inserted_row_count : The number of rows that were inserted.
• deleted_row_count : The number of rows that were deleted.
• updated_row_count : The number of rows that were updated.For all other jobs, the value is NULL .This column is present in the INFORMATION_ SCHEMA. JOBS_ BY_ USER and INFORMATION_ SCHEMA. JOBS_ BY_ PROJECT views. |
end_ time | TIMESTAMP | End time of this job. |
error_ result | RECORD | Details of any errors as ErrorProto objects. |
job_ id | STRING | The ID of the job. For example, bquxjob_ 1234 . |
job_ stages | RECORD | Query stages of the job. |
job_ type | STRING | The type of the job. Can be QUERY , LOAD , EXTRACT , COPY , or NULL . A NULL value indicates an internal job, such as a script job statement evaluation or a materialized view refresh. |
labels | RECORD | Array of labels applied to the job as key-value pairs. |
parent_ job_ id | STRING | ID of the parent job, if any. |
principal_ subject | STRING | (Clustering column) The principal identifier of the user who ran the job. |
priority | STRING | The priority of this job. Valid values include INTERACTIVE and BATCH . |
project_ id | STRING | (Clustering column) The ID of the project. |
project_ number | INTEGER | The number of the project. |
query | STRING | SQL query text. Only the JOBS_ BY_ PROJECT view has the query column. |
referenced_ tables | RECORD | Array of tables referenced by the job. Only populated for query jobs. |
reservation_ id | STRING | Name of the primary reservation assigned to this job, in the format RESERVATION_ ADMIN_ PROJECT:RESERVATION_ LOCATION. RESERVATION_ NAME .In this output:
• RESERVATION_ADMIN_PROJECT : the name of the Google Cloud project that administers the reservation
• RESERVATION_LOCATION : the location of the reservation
• RESERVATION_NAME : the name of the reservation |
session_ info | RECORD | |
start_ time | TIMESTAMP | Start time of this job. |
state | STRING | Running state of the job. Valid states include PENDING , RUNNING , and DONE . |
statement_ type | STRING | The type of query statement. For example, DELETE , INSERT , SCRIPT , SELECT , or UPDATE . See QueryStatementType for list of valid values. |
timeline | RECORD | Query timeline of the job. Contains snapshots of query execution. |
total_ bytes_ billed | INTEGER | If the project is configured to use on-demand pricing, then this field contains the total bytes billed for the job. If the project is configured to use flat-rate pricing, then you are not billed for bytes and this field is informational only.
Note: This column's values are empty for queries that read from tables with row-level access policies. For more information, see best practices for row-level security in BigQuery. |
total_ bytes_ processed | INTEGER | Total bytes processed by the job. |
total_ modified_ partitions | INTEGER | The total number of partitions the job modified. This field is populated for LOAD and QUERY jobs. |
total_ slot_ ms | INTEGER | Slot milliseconds for the job over its entire duration. |
transaction_ id | STRING | ID of the transaction in which this job ran, if any. (Preview) |
user_ email | STRING | (Clustering column) Email address or service account of the user who ran the job. |
query_ info. resource_ warning | STRING | The warning message that appears if the resource usage during query processing is above the internal threshold of the system.A successful query job can have the resource_ warning field populated. With resource_ warning , you get additional data points to optimize your queries and to set up monitoring for performance trends of an equivalent set of queries by using query_ hashes . |
query_ info. query_ hashes. normalized_ literals | RECORD | Contains the hashes of the query. normalized_ literals is a hexadecimal STRING hash that ignores comments, parameter values, UDFs, and literals.This field appears for successful GoogleSQL queries that are not cache hits. |
transferred_ bytes | INTEGER | Total bytes transferred for cross-cloud queries, such as BigQuery Omni cross-cloud transfer jobs. |
INFORMATION_SCHEMA.JOBS_BY_FOLDER
La vue INFORMATION_SCHEMA.JOBS_BY_FOLDER contient des métadonnées en temps quasi réel sur tous les travaux soumis dans le dossier parent du projet en cours, y compris les travaux dans les sous-dossiers sous celui-ci
Column name | Data type | Value |
bi_ engine_ statistics | RECORD | If the project is configured to use the BI Engine SQL Interface, then this field contains BiEngineStatistics. Otherwise NULL . |
cache_ hit | BOOLEAN | Whether the query results of this job were from a cache. If you have a multi-query statement job, cache_ hit for your parent query is NULL . |
creation_ time | TIMESTAMP | (Partitioning column) Creation time of this job. Partitioning is based on the UTC time of this timestamp. |
destination_ table | RECORD | Destination table for results, if any. |
end_ time | TIMESTAMP | End time of this job. |
error_ result | RECORD | Details of any errors as ErrorProto objects. |
folder_ numbers | REPEATED INTEGER | Google Accounts and ID Administration (GAIA) IDs of folders in a project's ancestry, in order starting with the leaf folder closest to the project. This column is only populated in JOBS_ BY_ FOLDER . |
job_ id | STRING | The ID of the job. For example, bquxjob_ 1234 . |
job_ stages | RECORD | Query stages of the job. |
job_ type | STRING | The type of the job. Can be QUERY , LOAD , EXTRACT , COPY , or NULL . A NULL value indicates an internal job, such as a script job statement evaluation or a materialized view refresh. |
labels | RECORD | Array of labels applied to the job as key-value pairs. |
parent_ job_ id | STRING | ID of the parent job, if any. |
principal_ subject | STRING | (Clustering column) The principal identifier of the user who ran the job. |
priority | STRING | The priority of this job. Valid values include INTERACTIVE and BATCH . |
project_ id | STRING | (Clustering column) The ID of the project. |
project_ number | INTEGER | The number of the project. |
query | STRING | SQL query text. Only the JOBS_ BY_ PROJECT view has the query column. |
referenced_ tables | RECORD | Array of tables referenced by the job. Only populated for query jobs. |
reservation_ id | STRING | Name of the primary reservation assigned to this job, in the format RESERVATION_ ADMIN_ PROJECT:RESERVATION_ LOCATION. RESERVATION_ NAME .In this output:
• RESERVATION_ADMIN_PROJECT : the name of the Google Cloud project that administers the reservation
• RESERVATION_LOCATION : the location of the reservation
• RESERVATION_NAME : the name of the reservation |
session_ info | RECORD | |
start_ time | TIMESTAMP | Start time of this job. |
state | STRING | Running state of the job. Valid states include PENDING , RUNNING , and DONE . |
statement_ type | STRING | The type of query statement. For example, DELETE , INSERT , SCRIPT , SELECT , or UPDATE . See QueryStatementType for list of valid values. |
timeline | RECORD | Query timeline of the job. Contains snapshots of query execution. |
total_ bytes_ billed | INTEGER | If the project is configured to use on-demand pricing, then this field contains the total bytes billed for the job. If the project is configured to use flat-rate pricing, then you are not billed for bytes and this field is informational only.
Note: This column's values are empty for queries that read from tables with row-level access policies. For more information, see best practices for row-level security in BigQuery. |
total_ bytes_ processed | INTEGER | Total bytes processed by the job. |
total_ modified_ partitions | INTEGER | The total number of partitions the job modified. This field is populated for LOAD and QUERY jobs. |
total_ slot_ ms | INTEGER | Slot milliseconds for the job over its entire duration. |
transaction_ id | STRING | ID of the transaction in which this job ran, if any. (Preview) |
user_ email | STRING | (Clustering column) Email address or service account of the user who ran the job. |
query_ info. resource_ warning | STRING | The warning message that appears if the resource usage during query processing is above the internal threshold of the system.A successful query job can have the resource_ warning field populated. With resource_ warning , you get additional data points to optimize your queries and to set up monitoring for performance trends of an equivalent set of queries by using query_ hashes . |
query_ info. query_ hashes. normalized_ literals | RECORD | Contains the hashes of the query. normalized_ literals is a hexadecimal STRING hash that ignores comments, parameter values, UDFs, and literals.This field appears for successful GoogleSQL queries that are not cache hits. |
transferred_ bytes | INTEGER | Total bytes transferred for cross-cloud queries, such as BigQuery Omni cross-cloud transfer jobs. |
INFORMATION_SCHEMA.JOBS_BY_ORGANIZATION
Column name | Data type | Value |
bi_ engine_ statistics | RECORD | If the project is configured to use the BI Engine SQL Interface, then this field contains BiEngineStatistics. Otherwise NULL . |
cache_ hit | BOOLEAN | Whether the query results of this job were from a cache. If you have a multi-query statement job, cache_ hit for your parent query is NULL . |
creation_ time | TIMESTAMP | (Partitioning column) Creation time of this job. Partitioning is based on the UTC time of this timestamp. |
destination_ table | RECORD | Destination table for results, if any. |
end_ time | TIMESTAMP | End time of this job. |
error_ result | RECORD | Details of any errors as ErrorProto objects. |
job_ id | STRING | The ID of the job. For example, bquxjob_ 1234 . |
job_ stages | RECORD | Query stages of the job. |
job_ type | STRING | The type of the job. Can be QUERY , LOAD , EXTRACT , COPY , or NULL . A NULL value indicates an internal job, such as a script job statement evaluation or a materialized view refresh. |
labels | RECORD | Array of labels applied to the job as key-value pairs. |
parent_ job_ id | STRING | ID of the parent job, if any. |
principal_ subject | STRING | (Clustering column) The principal identifier of the user who ran the job. |
priority | STRING | The priority of this job. Valid values include INTERACTIVE and BATCH . |
project_ id | STRING | (Clustering column) The ID of the project. |
project_ number | INTEGER | The number of the project. |
query | STRING | SQL query text. Only the JOBS_ BY_ PROJECT view has the query column. |
referenced_ tables | RECORD | Array of tables referenced by the job. Only populated for query jobs. |
reservation_ id | STRING | Name of the primary reservation assigned to this job, in the format RESERVATION_ ADMIN_ PROJECT:RESERVATION_ LOCATION. RESERVATION_ NAME .In this output:
• RESERVATION_ADMIN_PROJECT : the name of the Google Cloud project that administers the reservation
• RESERVATION_LOCATION : the location of the reservation
• RESERVATION_NAME : the name of the reservation |
session_ info | RECORD | |
start_ time | TIMESTAMP | Start time of this job. |
state | STRING | Running state of the job. Valid states include PENDING , RUNNING , and DONE . |
statement_ type | STRING | The type of query statement. For example, DELETE , INSERT , SCRIPT , SELECT , or UPDATE . See QueryStatementType for list of valid values. |
timeline | RECORD | Query timeline of the job. Contains snapshots of query execution. |
total_ bytes_ billed | INTEGER | If the project is configured to use on-demand pricing, then this field contains the total bytes billed for the job. If the project is configured to use flat-rate pricing, then you are not billed for bytes and this field is informational only.
Note: This column's values are empty for queries that read from tables with row-level access policies. For more information, see best practices for row-level security in BigQuery. |
total_ bytes_ processed | INTEGER | Total bytes processed by the job. |
total_ modified_ partitions | INTEGER | The total number of partitions the job modified. This field is populated for LOAD and QUERY jobs. |
total_ slot_ ms | INTEGER | Slot milliseconds for the job over its entire duration. |
transaction_ id | STRING | ID of the transaction in which this job ran, if any. (Preview) |
user_ email | STRING | (Clustering column) Email address or service account of the user who ran the job. |
query_ info. resource_ warning | STRING | The warning message that appears if the resource usage during query processing is above the internal threshold of the system.A successful query job can have the resource_ warning field populated. With resource_ warning , you get additional data points to optimize your queries and to set up monitoring for performance trends of an equivalent set of queries by using query_ hashes . |
query_ info. query_ hashes. normalized_ literals | RECORD | Contains the hashes of the query. normalized_ literals is a hexadecimal STRING hash that ignores comments, parameter values, UDFs, and literals.This field appears for successful GoogleSQL queries that are not cache hits. |
transferred_ bytes | INTEGER | Total bytes transferred for cross-cloud queries, such as BigQuery Omni cross-cloud transfer jobs. |
Et 3 tables de données de facturation :
Standard data export
Field | Type | Description |
billing_ account_ id | String | The Cloud Billing account ID that the usage is associated with.
For resellers: For usage costs generated by a Cloud Billing subaccount, this is the ID of the subaccount, not the ID of the parent reseller Cloud Billing account. |
invoice. month | String | The year and month (YYYYMM) of the invoice that includes the cost line items. For example: "201901" is equivalent to January, 2019.
You can use this field to get the total charges on the invoice. See Cloud Billing Export to BigQuery Query Examples.Note: The first full month of data with this field is June 2018.Be aware: The invoice month may differ from the usage month. For example, some product usage at the very end of a month may be charged to the next month's invoice. Also, the invoice month for Cloud Billing adjustments and associated taxes reflects the month the adjustment was issued; the adjustment could be applied to a different month than the issue month. Refer to errors and adjustments for more information. |
cost_ type | String | The type of cost this line item represents: regular, tax, adjustment, or rounding error.Notes:
• The first full month of data with this field is January 2019.
• Starting on September 1, 2020, you see a separate line item for taxes, for each of your projects. |
service. id | String | The ID of the service that the usage is associated with. |
service. description | String | The Google Cloud service that reported the Cloud Billing data. |
sku. id | String | The ID of the resource used by the service. For the full list of SKUs, see Google Cloud SKUs.Note: You can use the sku.id column to map each of your line items to the list prices published on the Google Cloud pricing pages, in the Pricing Table report, and through the Cloud Billing Catalog API. |
sku. description | String | A description of the resource type used by the service. For example, a resource type for Cloud Storage is Standard Storage US. |
usage_ start_ time | Timestamp | The start time of the hourly usage window within which the given cost was calculated. The usage/costs for all services is displayed with hourly granularity, which means long running service usage is spread across multiple hourly windows.For more information, see the BigQuery documentation on timestamp data types. See also, Differences between exported data and invoices below. |
usage_ end_ time | Timestamp | The end time of the hourly usage window within which the given cost was calculated. The usage/costs for all services is displayed with hourly granularity, which means long running service usage is spread across multiple hourly windows.For more information, see the BigQuery documentation on timestamp data types. See also, Differences between exported data and invoices below. |
project | Struct | project contains fields that describe the Cloud Billing project, such as ID, number, name, ancestry_numbers, and labels.Be aware: For newly created projects, project information might not be present on usage that occurs within 24 hours of project creation. |
project. id | String | The ID of the Google Cloud project that generated the Cloud Billing data. |
project. number | String | An internally-generated, anonymized, unique identifier for the Google Cloud project that generated the Cloud Billing data. In your support cases and other customer communication, Google will refer to your projects by this project number.Note: The first full day of data for this field is October 29, 2020.
For examples of how to manage your Cloud Billing data exports to BigQuery after the schema update, see Handling schema changes to BigQuery export data tables. |
project. name | String | The name of the Google Cloud project that generated the Cloud Billing data. |
project. ancestry_ numbers | String | The ancestors in the resource hierarchy for the project identified by the specified project. id (for example, my-project-123).
For example: /ParentOrgNumber/ParentFolderNumber/. Learn more about the Resource Hierarchy.Note: During Cloud Billing data export, project ancestry is recorded based on the time of usage. Organization and folder numbers are immutable, however, a project's ancestry is not. Over time, you might move projects and folders around in your resource hierarchy. The first full month of data with this field is January 2019. |
project. ancestors | Struct | This field describes the structure and value of the resource hierarchy of a cost line item, including projects, folders, and organizations. Ancestors are ordered from node to root (project, folder, then organization).Note: The first full month of data for this field is April 2022. |
project. ancestors. resource_ name | String | The relative resource name for each ancestor in the format 'resourceType/resourceNumber'. Using project. ancestors. resource_ name will offer a more complete view of project. ancestry_ numbers . |
project. ancestors. display_ name | String | The name that you have created for your resource in your console. |
project. labels. key | String | If labels are present, the key portion of the key:value pair that comprises the label on the Google Cloud project where the usage occurred. For more information about using labels, see Using Labels. |
project. labels. value | String | If labels are present, the value portion of the key:value pair that comprises the label on the Google Cloud project where the usage occurred. For more information about using labels, see Using Labels. |
labels. key | String | If labels are present, the key portion of the key:value pair that comprises the label on the Google Cloud resource where the usage occurred. For more information about using labels, see Using Labels. |
labels. value | String | If labels are present, the value portion of the key:value pair that comprises the label on the Google Cloud resource where the usage occurred. For more information about using labels, see Using Labels. |
system_ labels. key | String | If system labels are present, the key portion of the key:value pair that comprises the system-generated label on the resource where the usage occurred. See also, Available system labels.Note: The first full day of data with this field is September 18, 2018. |
system_ labels. value | String | If system labels are present, the value portion of the key:value pair that comprises the system-generated label on the resource where the usage occurred. See also, Available system labels.Note: The first full day of data with this field is September 18, 2018. |
location. location | String | Location of usage at the level of a multi-region, country, region, or zone; or global for resources that have no specific location. For more information, see Geography and regions and Google Cloud locations.Note: The first full day of data with this field is September 18, 2018. |
location. country | String | When location. location is a country, region, or zone, this field is the country of usage, e.g. US . For more information, see Geography and regions and Google Cloud locations.Note: The first full day of data with this field is September 18, 2018. |
location. region | String | When location. location is a region or zone, this field is the region of usage, e.g. us-central1 . For more information, see Geography and regions and Google Cloud locations.Note: The first full day of data with this field is September 18, 2018. |
location. zone | String | When location. location is a zone, this field is the zone of usage, e.g. us-central1-a . For more information, see Geography and regions and Google Cloud locations.Note: The first full day of data with this field is September, 18 2018. |
cost | Float | The cost of the usage before any credits, to a precision of up to six decimal places. To get the total cost including credits, any credits. amount should be added to cost. See this example query for more information. |
currency | String | The currency that the cost is billed in. For more information, see Local Currency for Billing and Payments. |
currency_ conversion_ rate | Float | The exchange rate from US dollars to the local currency. That is, cost ÷ currency_ conversion_ rate is the cost in US dollars.Note: When Google charges in local currency, we convert prices into applicable local currency pursuant to the conversion rates published by leading financial institutions. |
usage. amount | Float | The quantity of usage. unit used. |
usage. unit | String | The base unit in which resource usage is measured. For example, the base unit for standard storage is byte-seconds. |
usage. amount_ in_ pricing_ units | Float | The quantity of usage. pricing_ unit used.Note: The first full day of data with this field is January 22, 2018. |
usage. pricing_ unit | String | The unit in which resource usage is measured, according to the Cloud Billing Catalog API.Note: The first full day of data with this field is January 22, 2018. |
credits | Struct | credits contains fields that describe the structure and value of the credits associated with Google Cloud and Google Maps Platform SKUs. |
credits. id | String | If present, indicates that a credit is associated with the product SKU. credits. id values are either an alphanumeric unique identifier (for example, 12-b34-c56-d78), or a description of the credit type (such as Committed Usage Discount: CPU).
If the credits.id field is empty, then the product SKU is not associated with a credit.Note: The first full day of data with this field is September 10, 2020. |
credits. full_ name | String | The name of the credit associated with the product SKU. This is a human-readable description of an alphanumeric credits. id . Examples include Free trial credit or Spend-based committed use discount.
credits.full_name values are only present for SKUs with an alphanumeric credits.id . If the value of the credits.id is a description of the credit type (such as Committed Usage Discount: CPU), then the credits.full_name field will be empty.Note: The first full day of data with this field is September 10, 2020. |
credits. type | String | This field describes the purpose or origin of the credits. id . Credit types include:
• COMMITTED_USAGE_DISCOUNT : Resource-based committed use contracts purchased for Compute Engine in return for deeply discounted prices for VM usage.
• COMMITTED_USAGE_DISCOUNT_DOLLAR_BASE : Spend-based committed use contracts purchased for services in exchange for your commitment to spend a minimum amount.
• DISCOUNT : The discount credit type is used for credits earned after a contractual spending threshold is reached. Note that in the Cloud Billing reports available in the Google Cloud console, the discount credit type is listed as Spending based discounts (contractual).
• FREE_TIER : Some services offer free resource usage up to specified limits. For these services, credits are applied to implement the free tier usage.
• PROMOTION : The promotion credit type includes Google Cloud Free Trial and marketing campaign credits, or other grants to use Google Cloud. When available, promotional credits are considered a form of payment and are automatically applied to reduce your total bill.
• RESELLER_MARGIN : If you are a reseller, the reseller margin credit type indicates the Reseller Program Discounts earned on every eligible line item.
• SUBSCRIPTION_BENEFIT : Credits earned by purchasing long-term subscriptions to services in exchange for discounts.
• SUSTAINED_USAGE_DISCOUNT : The sustained use discounts credit type is an automatic discount that you earn for running specific Compute Engine resources for a significant portion of the billing month.Note: The first full day of data with this field is September 10, 2020. |
credits. name | String | A description of the credit applied to the Cloud Billing account. |
credits. amount | Float | The amount of the credit applied to the usage. |
adjustment_ info | Struct | adjustment_ info contains fields that describe the structure and value of an adjustment to cost line items associated with a Cloud Billing account.
adjustment_info values are only present if the cost line item was generated for a Cloud Billing modification. A modification can happen for correction or non-correction reasons. The adjustment_info type contains details about the adjustment, whether it was issued for correcting an error or other reasons.Note: The first full day of data for this field is October 29, 2020.
For examples of how to manage your Cloud Billing data exports to BigQuery after the schema update, see Handling schema changes to BigQuery export data tables. |
adjustment_ info. id | String | If present, indicates that an adjustment is associated with a cost line item. adjustment_ info. id is the unique ID for all the adjustments associated caused by an issue. |
adjustment_ info. description | String | A description of the adjustment and its cause. |
adjustment_ info. type | String | The type of adjustment.
Types include:
• USAGE_CORRECTION : A correction due to incorrect reported usage.
• PRICE_CORRECTION : A correction due to incorrect pricing rules.
• METADATA_CORRECTION : A correction to fix metadata without changing the cost.
• GOODWILL : A credit issued to the customer for goodwill.
• SALES_BASED_GOODWILL : A credit issued to the customer for goodwill, as part of a contract.
• SLA_VIOLATION : A credit issued to the customer due to a service-level objective (SLO) violation.
• BALANCE_TRANSFER : An adjustment to transfer funds from one payment account to another.
• ACCOUNT_CLOSURE : An adjustment to bring a closed account to a zero balance.
• GENERAL_ADJUSTMENT : A general billing account modification. |
adjustment_ info. mode | String | How the adjustment was issued.
Modes include:
• PARTIAL_CORRECTION : The correction partially negates the original usage and cost.
• COMPLETE_NEGATION_WITH_REMONETIZATION : The correction fully negates the original usage and cost, and issues corrected line item(s) with updated usage and cost.
• COMPLETE_NEGATION : The correction fully negates the original usage and cost, and no further usage is remonetized.
• MANUAL_ADJUSTMENT : The adjustment is allocated to cost and usage manually. |
export_ time | Timestamp | A processing time associated with an append of Cloud Billing data. This will always increase with each new export.Note: Use the export_time column to understand when the exported billing data was last updated.See also, Differences between exported data and invoices below. |
tags | Struct | Fields that describe the tag, such as key, value, and namespace.Note: The first full month of data with these tags is October 2022. |
tags. key | String | The short name or display name of the key associated with this particular tag. |
tags. value | String | The resources attached to a tags.key . At any given time, exactly one value can be attached to a resource for a given key. |
tags. inherited | Boolean | Indicates whether a tag binding is inherited (Tags Inherited = True) or direct/non-inherited (Tags Inherited = False). You can create a tag binding to a parent resource in the resource hierarchy. |
tags. namespace | String | Represents the resource hierarchy that define tag key and values. Namespace can be combined with tag key and tag value short names to create a globally unique, fully qualified name for the tag key or tag value. |
Detailed data export
Field | Type | Description |
billing_ account_ id | String | The Cloud Billing account ID that the usage is associated with.
For resellers: For usage costs generated by a Cloud Billing subaccount, this is the ID of the subaccount, not the ID of the parent reseller Cloud Billing account. |
invoice. month | String | The year and month (YYYYMM) of the invoice that includes the cost line items. For example: "201901" is equivalent to January, 2019.
You can use this field to get the total charges on the invoice. See Cloud Billing Export to BigQuery Query Examples.Note: The first full month of data with this field is June 2018.Be aware: The invoice month may differ from the usage month. For example, some product usage at the very end of a month may be charged to the next month's invoice. Also, the invoice month for Cloud Billing adjustments and associated taxes reflects the month the adjustment was issued; the adjustment could be applied to a different month than the issue month. Refer to errors and adjustments for more information. |
cost_ type | String | The type of cost this line item represents: regular, tax, adjustment, or rounding error.Notes:
• The first full month of data with this field is January 2019.
• Starting on September 1, 2020, you see a separate line item for taxes, for each of your projects. |
service. id | String | The ID of the service that the usage is associated with. |
service. description | String | The Google Cloud service that reported the Cloud Billing data. |
sku. id | String | The ID of the resource used by the service. For the full list of SKUs, see Google Cloud SKUs.Note: You can use the sku.id column to map each of your line items to the list prices published on the Google Cloud pricing pages, in the Pricing Table report, and through the Cloud Billing Catalog API. |
sku. description | String | A description of the resource type used by the service. For example, a resource type for Cloud Storage is Standard Storage US. |
usage_ start_ time | Timestamp | The start time of the hourly usage window within which the given cost was calculated. The usage/costs for all services is displayed with hourly granularity, which means long running service usage is spread across multiple hourly windows.For more information, see the BigQuery documentation on timestamp data types. See also, Differences between exported data and invoices below. |
usage_ end_ time | Timestamp | The end time of the hourly usage window within which the given cost was calculated. The usage/costs for all services is displayed with hourly granularity, which means long running service usage is spread across multiple hourly windows.For more information, see the BigQuery documentation on timestamp data types. See also, Differences between exported data and invoices below. |
project | Struct | project contains fields that describe the Cloud Billing project, such as ID, number, name, ancestry_numbers, and labels.Be aware: For newly created projects, project information might not be present on usage that occurs within 24 hours of project creation. |
project. id | String | The ID of the Google Cloud project that generated the Cloud Billing data. |
project. number | String | An internally-generated, anonymized, unique identifier for the Google Cloud project that generated the Cloud Billing data. In your support cases and other customer communication, Google will refer to your projects by this project number.Note: The first full day of data for this field is October 29, 2020.
For examples of how to manage your Cloud Billing data exports to BigQuery after the schema update, see Handling schema changes to BigQuery export data tables. |
project. name | String | The name of the Google Cloud project that generated the Cloud Billing data. |
project. ancestry_ numbers | String | The ancestors in the resource hierarchy for the project identified by the specified project. id (for example, my-project-123).
For example: /ParentOrgNumber/ParentFolderNumber/. Learn more about the Resource Hierarchy.Note: During Cloud Billing data export, project ancestry is recorded based on the time of usage. Organization and folder numbers are immutable, however, a project's ancestry is not. Over time, you might move projects and folders around in your resource hierarchy. The first full month of data with this field is January 2019. |
project. ancestors | Struct | This field describes the structure and value of the resource hierarchy of a cost line item, including projects, folders, and organizations. Ancestors are ordered from node to root (project, folder, then organization).Note: The first full month of data for this field is April 2022. |
project. ancestors. resource_ name | String | The relative resource name for each ancestor in the format 'resourceType/resourceNumber'. Using project. ancestors. resource_ name will offer a more complete view of project. ancestry_ numbers . |
project. ancestors. display_ name | String | The name that you have created for your resource in your console. |
project. labels. key | String | If labels are present, the key portion of the key:value pair that comprises the label on the Google Cloud project where the usage occurred. For more information about using labels, see Using Labels. |
project. labels. value | String | If labels are present, the value portion of the key:value pair that comprises the label on the Google Cloud project where the usage occurred. For more information about using labels, see Using Labels. |
labels. key | String | If labels are present, the key portion of the key:value pair that comprises the label on the Google Cloud resource where the usage occurred. For more information about using labels, see Using Labels. |
labels. value | String | If labels are present, the value portion of the key:value pair that comprises the label on the Google Cloud resource where the usage occurred. For more information about using labels, see Using Labels. |
system_ labels. key | String | If system labels are present, the key portion of the key:value pair that comprises the system-generated label on the resource where the usage occurred. See also, Available system labels.Note: The first full day of data with this field is September 18, 2018. |
system_ labels. value | String | If system labels are present, the value portion of the key:value pair that comprises the system-generated label on the resource where the usage occurred. See also, Available system labels.Note: The first full day of data with this field is September 18, 2018. |
location. location | String | Location of usage at the level of a multi-region, country, region, or zone; or global for resources that have no specific location. For more information, see Geography and regions and Google Cloud locations.Note: The first full day of data with this field is September 18, 2018. |
location. country | String | When location. location is a country, region, or zone, this field is the country of usage, e.g. US . For more information, see Geography and regions and Google Cloud locations.Note: The first full day of data with this field is September 18, 2018. |
location. region | String | When location. location is a region or zone, this field is the region of usage, e.g. us-central1 . For more information, see Geography and regions and Google Cloud locations.Note: The first full day of data with this field is September 18, 2018. |
location. zone | String | When location. location is a zone, this field is the zone of usage, e.g. us-central1-a . For more information, see Geography and regions and Google Cloud locations.Note: The first full day of data with this field is September, 18 2018. |
cost | Float | The cost of the usage before any credits, to a precision of up to six decimal places. To get the total cost including credits, any credits. amount should be added to cost. See this example query for more information. |
currency | String | The currency that the cost is billed in. For more information, see Local Currency for Billing and Payments. |
currency_ conversion_ rate | Float | The exchange rate from US dollars to the local currency. That is, cost ÷ currency_ conversion_ rate is the cost in US dollars.Note: When Google charges in local currency, we convert prices into applicable local currency pursuant to the conversion rates published by leading financial institutions. |
usage. amount | Float | The quantity of usage. unit used. |
usage. unit | String | The base unit in which resource usage is measured. For example, the base unit for standard storage is byte-seconds. |
usage. amount_ in_ pricing_ units | Float | The quantity of usage. pricing_ unit used.Note: The first full day of data with this field is January 22, 2018. |
usage. pricing_ unit | String | The unit in which resource usage is measured, according to the Cloud Billing Catalog API.Note: The first full day of data with this field is January 22, 2018. |
credits | Struct | credits contains fields that describe the structure and value of the credits associated with Google Cloud and Google Maps Platform SKUs. |
credits. id | String | If present, indicates that a credit is associated with the product SKU. credits. id values are either an alphanumeric unique identifier (for example, 12-b34-c56-d78), or a description of the credit type (such as Committed Usage Discount: CPU).
If the credits.id field is empty, then the product SKU is not associated with a credit.Note: The first full day of data with this field is September 10, 2020. |
credits. full_ name | String | The name of the credit associated with the product SKU. This is a human-readable description of an alphanumeric credits. id . Examples include Free trial credit or Spend-based committed use discount.
credits.full_name values are only present for SKUs with an alphanumeric credits.id . If the value of the credits.id is a description of the credit type (such as Committed Usage Discount: CPU), then the credits.full_name field will be empty.Note: The first full day of data with this field is September 10, 2020. |
credits. type | String | This field describes the purpose or origin of the credits. id . Credit types include:
• COMMITTED_USAGE_DISCOUNT : Resource-based committed use contracts purchased for Compute Engine in return for deeply discounted prices for VM usage.
• COMMITTED_USAGE_DISCOUNT_DOLLAR_BASE : Spend-based committed use contracts purchased for services in exchange for your commitment to spend a minimum amount.
• DISCOUNT : The discount credit type is used for credits earned after a contractual spending threshold is reached. Note that in the Cloud Billing reports available in the Google Cloud console, the discount credit type is listed as Spending based discounts (contractual).
• FREE_TIER : Some services offer free resource usage up to specified limits. For these services, credits are applied to implement the free tier usage.
• PROMOTION : The promotion credit type includes Google Cloud Free Trial and marketing campaign credits, or other grants to use Google Cloud. When available, promotional credits are considered a form of payment and are automatically applied to reduce your total bill.
• RESELLER_MARGIN : If you are a reseller, the reseller margin credit type indicates the Reseller Program Discounts earned on every eligible line item.
• SUBSCRIPTION_BENEFIT : Credits earned by purchasing long-term subscriptions to services in exchange for discounts.
• SUSTAINED_USAGE_DISCOUNT : The sustained use discounts credit type is an automatic discount that you earn for running specific Compute Engine resources for a significant portion of the billing month.Note: The first full day of data with this field is September 10, 2020. |
credits. name | String | A description of the credit applied to the Cloud Billing account. |
credits. amount | Float | The amount of the credit applied to the usage. |
adjustment_ info | Struct | adjustment_ info contains fields that describe the structure and value of an adjustment to cost line items associated with a Cloud Billing account.
adjustment_info values are only present if the cost line item was generated for a Cloud Billing modification. A modification can happen for correction or non-correction reasons. The adjustment_info type contains details about the adjustment, whether it was issued for correcting an error or other reasons.Note: The first full day of data for this field is October 29, 2020.
For examples of how to manage your Cloud Billing data exports to BigQuery after the schema update, see Handling schema changes to BigQuery export data tables. |
adjustment_ info. id | String | If present, indicates that an adjustment is associated with a cost line item. adjustment_ info. id is the unique ID for all the adjustments associated caused by an issue. |
adjustment_ info. description | String | A description of the adjustment and its cause. |
adjustment_ info. type | String | The type of adjustment.
Types include:
• USAGE_CORRECTION : A correction due to incorrect reported usage.
• PRICE_CORRECTION : A correction due to incorrect pricing rules.
• METADATA_CORRECTION : A correction to fix metadata without changing the cost.
• GOODWILL : A credit issued to the customer for goodwill.
• SALES_BASED_GOODWILL : A credit issued to the customer for goodwill, as part of a contract.
• SLA_VIOLATION : A credit issued to the customer due to a service-level objective (SLO) violation.
• BALANCE_TRANSFER : An adjustment to transfer funds from one payment account to another.
• ACCOUNT_CLOSURE : An adjustment to bring a closed account to a zero balance.
• GENERAL_ADJUSTMENT : A general billing account modification. |
adjustment_ info. mode | String | How the adjustment was issued.
Modes include:
• PARTIAL_CORRECTION : The correction partially negates the original usage and cost.
• COMPLETE_NEGATION_WITH_REMONETIZATION : The correction fully negates the original usage and cost, and issues corrected line item(s) with updated usage and cost.
• COMPLETE_NEGATION : The correction fully negates the original usage and cost, and no further usage is remonetized.
• MANUAL_ADJUSTMENT : The adjustment is allocated to cost and usage manually. |
export_ time | Timestamp | A processing time associated with an append of Cloud Billing data. This will always increase with each new export.Note: Use the export_time column to understand when the exported billing data was last updated.See also, Differences between exported data and invoices below. |
tags | Struct | Fields that describe the tag, such as key, value, and namespace.Note: The first full month of data with these tags is October 2022. |
tags. key | String | The short name or display name of the key associated with this particular tag. |
tags. value | String | The resources attached to a tags.key . At any given time, exactly one value can be attached to a resource for a given key. |
tags. inherited | Boolean | Indicates whether a tag binding is inherited (Tags Inherited = True) or direct/non-inherited (Tags Inherited = False). You can create a tag binding to a parent resource in the resource hierarchy. |
tags. namespace | String | Represents the resource hierarchy that define tag key and values. Namespace can be combined with tag key and tag value short names to create a globally unique, fully qualified name for the tag key or tag value. |
Additional fields available to detailed usage cost data export | ||
resource | Struct | The fields that describe the structure and value of information relevant to service resources (like a virtual machine or a SSD) that generate service usage. |
resource. global_ name | String | A globally unique service identifier for the resource that generated relevant usage. |
resource. name | String | A service-specific identifier for the resource that generated relevant usage. This can be input generated by the user.Note: The first full day of data with this field is August 11, 2021. |
price | Struct | Fields that describe the structure and value related to the prices charged for usage.Note: The first full day of data with price fields is April 13, 2023. |
price. effective_ price | Numeric | The price charged for usage of the Google Cloud or Google Maps Platform SKUs and SKU pricing tiers. If your Cloud Billing account has custom, contract pricing, this is your billing-account-specific price; otherwise, this is the list price of the SKU or SKU tier.Note: The first full day of data with this field is April 13, 2023. |
price. tier_ start_ amount | Numeric | The lower bound number of units for a SKU's pricing tier. For example, a SKU with three pricing tiers such as 0-100 units, 101-1000 units, and 1001+ units, will display three pricing rows for the SKU, with 0, 101, and 1001 in the price.tier_start_amount field representing the starting unit quantity for the SKU's pricing tiers.Note: The first full day of data with this field is April 13, 2023.Learn more about pricing tiers. |
price. unit | String | The unit of usage in which the pricing is specified and resource usage is measured (such as gibibyte, tebibyte, month, year, gibibyte hour, gibibyte month, or count). The value in the price.unit field matches the value in the usage.pricing_unit field.Note: The first full day of data with this field is April 13, 2023. |
price. pricing_ unit_ quantity | Numeric | The SKU's pricing tier unit quantity. For example, if the tier price is $1 per 1000000 Bytes, then this column will show 1000000.Note: The first full day of data with this field is April 13, 2023. |
Pricing data export
Field | Type | Description |
export_ time | Timestamp | A processing time associated with an append of Cloud Billing data. This will always increase with each new export.Note: Use the export_time column to understand when the exported billing data was last updated. |
pricing_ as_ of_ time | Timestamp | The pricing data applicable to your Cloud Billing account is generated once each day to prepare it for export to BigQuery. This is the daily timestamp of when the pricing data was generated.Note: The pricing data is current as of this date, but the same pricing data could have been in effect before this date. |
billing_ account_ id | String | The Cloud Billing account ID that the pricing is associated with. |
billing_ account_ name | String | The name of the Cloud Billing account that the pricing is associated with. |
business_ entity_ name | String | The name of the Google service family for the service which offers the SKU. Values include GCP (Google Cloud) or Maps (Google Maps Platform). |
service. id | String | The ID of the Google Cloud service or Google Maps Platform API that reported the Cloud Billing data. For example, 6F81-5844-456A. |
service. description | String | The description of the Google Cloud service or Google Maps Platform API that reported the Cloud Billing data. For example, Compute Engine. |
sku. id | String | The unique identifier for the resource SKU used by the service. For example, 2E27-4F75-95CD. For the full list of SKUs, see Google Cloud SKUs.Note: You can use the sku.id column to map each of your line items to the list prices published on the Google Cloud pricing pages, in the Pricing Table report, and through the Cloud Billing Catalog API. |
sku. description | String | A human-readable description of the resource SKU used by the service. For example, N1 Predefined Instance Core running in Americas. |
sku. destination_ migration_ mappings | Array of Strings | The destination SKU(s) names which this SKU is being migrated to. |
product_ taxonomy | Array of Strings | List of product categories that apply to the SKU, such as Serverless, Cloud Run, TaskQueue, VMs On Demand, Cores: Per Core, and others.Warning: Taxonomy content is in Beta and subject to change. We are providing taxonomy information to help you with your analysis, but be aware that the current format of the product_taxonomy fields and data might change over time. |
geo_ taxonomy | Struct | Geographic metadata that applies to the SKU, such as regions and multi-regions like us-east4 the European Union.Warning: Taxonomy content is in Beta and subject to change. We are providing taxonomy information to help you with your analysis, but be aware that the current format of the geo_taxonomy fields and data might change over time. |
geo_ taxonomy. type | String | The type of geographic metadata associated with the SKU. Valid values are:
• GLOBAL – has no regions
• REGIONAL – has 1 region
• MULTI_REGION – has 2 or more regionsWarning: geo_taxonomy content is in Beta and subject to change. |
geo_ taxonomy. regions | Array of Strings | The Google Cloud regions associated with the SKU. For example, Europe-west2 or US .
A region is a specific geographic place, such as London. A multi-region is a large geographic area, such as the United States, that contains two or more geographic places.Note: If the geo_taxonomy.type is GLOBAL this field will be null.Warning: geo_taxonomy content is in Beta and subject to change. |
pricing_ unit | String | The shorthand for the unit of usage in which the pricing is specified (such as GiBy.mo). |
pricing_ unit_ description | String | The human-readable description of the unit of usage (such as gibibyte month). |
account_ currency_ code | String | The currency that the Cloud Billing account is configured to operate in, using a 3-letter currency code defined in ISO 4217. For more information, see Local currency for billing and automatic payments. |
currency_ conversion_ rate | String | The exchange rate from US dollars to the local currency the Cloud Billing account is configured to operate in. If the currency of the Cloud Billing account is USD, the exchange rate defaults to 1.0.
If your Cloud Billing costs are billed in a non-USD currency, you can convert your usage costs to USD using this formula: cost ÷ currency_conversion_rate = usage cost in US dollars.
Note that when Google charges in local currency, we convert prices into applicable local currency pursuant to the conversion rates published by leading financial institutions. This includes any surcharge collected for billing in non-USD currency. We use the rates that are in effect on the pricing_as_of_time . |
list_ price | Struct | The list price of the Google Cloud or Google Maps Platform SKUs and SKU pricing tiers, in effect as of the pricing_as_of_time .
list_price contains fields that describe the structure and value of the list price, including:
• aggregation_info
• tiered_rates
List prices can be found at list_price.tiered_rates.usd_amount
The list price data is generated and exported for all customers. If your Cloud Billing account has custom, contract pricing, billing-account-specific pricing data is exported as well. |
billing_ account_ price | Struct | If you have contract pricing, this is your custom SKU price from the contract that is linked to your Cloud Billing account.
billing_account_price contains fields that describe the structure and value of the custom contract pricing for Google Cloud and Google Maps Platform SKUs and SKU pricing tiers. The billing_account_price includes:
• price_info
• aggregation_info
• tiered_rates
Your contracted prices (if applicable to your Cloud Billing account) can be found at billing_account_price.tiered_rates.usd_amount Note: If you do not have contract pricing, fields with billing_account_price will be null. |
price_ info | Struct | Background information about the contract price.Note: This field is only applicable for Cloud Billing accounts associated with contract pricing. Otherwise, the field is null. |
price_ info. price_ reason | String | Background information on the origin of the contract price.
Reasons include:
• DEFAULT_PRICE : The default price is the current list price for the SKU.
• FIXED_PRICE : A set fixed price for the SKU applicable during the terms of the contract agreement.
• FIXED_DISCOUNT : Percentage of discount off the list price price, anchored to the list price as of a fixed date.
• FLOATING_DISCOUNT : Percentage of discount off the current list price (not anchored to a list price as of a specific date).
• MIGRATED_PRICE : This is applicable for prices that were migrated from other SKUs.
• MERGED_PRICE : SKU price after merging from multiple sources. For example, with merged tiers, each individual tier can be from a different source with different discount types.
• LIST_PRICE_AS_CEILING : This is an optional contract feature, available to new contracts after March 21, 2022. When active, if the current list price drops lower than the custom fixed price, the list price (DEFAULT_PRICE) is used for the SKU price. Applies to all fixed price SKUs in the contract, including FIXED_PRICE, FIXED_DISCOUNT, MIGRATED_PRICE, and MERGED_PRICE.
• CONTRACTED_PRICE_PROTECTION : This is applicable for SKUs that are price protected in your contract. This is rarely used.Note: This field is only applicable for Cloud Billing accounts associated with contract pricing. Otherwise, the field is null. |
price_ info. discount_ percent | Numeric | For contract pricing that is the result of a percent discount ( FIXED_ DISCOUNT or FLOATING_ DISCOUNT ), this is the percentage of the discount used.Note: This field is only applicable for Cloud Billing accounts associated with contract pricing. Otherwise, the field is null. |
price_ info. discount_ percent_ fixed_ date | Date | For contact pricing with a percent discount that is anchored to a specific date ( FIXED_ DISCOUNT ), this is the date used.Note: This field is only applicable for Cloud Billing accounts associated with contract pricing. Otherwise, the field is null. |
price_ info. discount_ migrated_ from | String | For contract pricing discounts that were migrated from other SKUs ( MIGRATED_ PRICE ), this is the source SKU of the discount. Sometimes when a SKU is split into two, the discount is migrated from the old SKU to the new SKU(s).Note: This field is only applicable for Cloud Billing accounts associated with contract pricing. Otherwise, the field is null. |
aggregation_ info | Struct | Represents the aggregation level and interval for the pricing tiers of a single SKU. |
aggregation_ info. aggregation_ level | String | The level at which usage is aggregated to compute cost for pricing tiers.
Levels include:
• ACCOUNT : Indicates a SKU with multi-tiered pricing; SKU usage for the pricing tiers is aggregated across all projects in a single Cloud Billing account.
• PROJECT : Indicates a SKU with multi-tiered pricing; SKU usage for the pricing tiers is aggregated per project.
• UNKNOWN_AGGREGATION_LEVEL : Indicates a SKU with single-tier pricing; this is the default value for SKUs with non-tiered pricing. |
aggregation_ info. aggregation_ interval | String | The interval at which usage is aggregated to compute cost for pricing tiers.
Intervals include:
• ONE_DAY : Indicates a SKU with multi-tiered pricing; SKU usage for the pricing tiers is aggregated every day.
• ONE_MONTH : Indicates a SKU with multi-tiered pricing; SKU usage for the pricing tiers is aggregated every month.
• UNKNOWN_AGGREGATION_INTERVAL : Indicates a SKU with single-tier pricing; this is the default value for SKUs with non-tiered pricing. |
tiered_ rates | Array of Strings | Information about the pricing tier including the SKU's price in USD and the SKU's price in the currency the Cloud Billing account is configured to use.
Some SKUs have only one pricing tier. If a SKU has multiple pricing tiers, each pricing tier will appear as a different row. You can identify SKUs with multiple pricing tiers using the tiered_rates.start_usage_amount . |
tiered_ rates. pricing_ unit_ quantity | Float | The SKU's pricing tier unit quantity. For example, if the tier price is $1 per 1000000 Bytes, then this column will show 1000000. |
tiered_ rates. start_ usage_ amount | Float | Lower bound amount for a given pricing tier, in pricing units. For example, a SKU with three pricing tiers such as 0-100 units, 101-1000 units, and 1001+ units, would display three pricing rows, with 0, 101, and 1001 as the [tiered_rates].start_usage_amount values.Note: If a SKU has multiple pricing tiers, each pricing tier will appear as a different row. You can identify SKUs with multiple pricing tiers using the tiered_rates.start_usage_amount . |
tiered_ rates. usd_ amount | Numeric | The price for the SKU, in US dollars.Note: If a SKU has multiple pricing tiers, each pricing tier will appear as a different row. You can identify SKUs with multiple pricing tiers using the tiered_rates.start_usage_amount . |
tiered_ rates. account_ currency_ amount | Numeric | The SKU's tier price converted from USD to the currency the Cloud Billing account is configured to use, using the currency_conversion_rate .
This converted price is calculated using the following formula: tiered_rates.usd_amount * currency_conversion_rate = tiered_rates.account_currency_amount .
When Google charges in local currency, we convert prices into applicable local currency pursuant to the conversion rates published by leading financial institutions. This includes any surcharge collected for billing in non-USD currency. We use the rates that are in effect on the pricing_as_of_time . |
🔓
Pour obtenir l'autorisation dont vous avez besoin pour interroger la vue INFORMATION_SCHEMA.JOBS, demandez à votre administrateur de vous accorder le rôle IAM BigQuery Resource Viewer (roles/bigquery.resourceViewer) sur votre projet.
Ce rôle contient l'autorisation bigquery.jobs.listAll requise.
De quoi avons-nous besoin ?
Pour calculer finement le coût BigQuery par dashboard Looker Studio et par utilisateur du dashboard, vous aurez besoin des colonnes suivantes :
creation_time
: la date et l'heure de création du job.
user_email
: l'adresse e-mail de l'utilisateur qui a soumis le job.
total_bytes_processed
: le nombre total d'octets lus ou écrits par le job.
total_slot_ms
: le nombre total de millisecondes de slot utilisées par le job.
total_compute_units
: le nombre total d'unités de calcul utilisées par le job.
dashboard_id
: le nombre total d'unités de calcul utilisées par le job.
- Taux de facturation : votre coût par téraoctet qui dépend du projet, de la localisation de la table et qui varie tout le temps !
Détail et explication des colonnes
user_email
La colonne
job_user_email
est disponible dans la table INFORMATION_SCHEMA.JOBS
de BigQuery et fait référence à l'utilisateur qui a soumis la requête BigQuery qui a été exécutée pour alimenter les visualisations dans Looker Studio. En d'autres termes, il s'agit de l'utilisateur qui a effectué l'action qui a déclenché le job BigQuery.💡
Le créateur de la connexion entre BigQuery et Looker Studio peut être différent de l'utilisateur qui soumet la requête BigQuery à partir de Looker Studio. En effet, plusieurs utilisateurs ont accès à la même connexion BigQuery et peuvent soumettre des requêtes qui seront ensuite exécutées par BigQuery.
dashboard_id
Le
dashboard_id
correspond à l’identification de votre dashboard Looker Studio. - Sur Looker Studio, vous pouvez le trouver dans l’URL. Il s’agit généralement d’une suite de chiffre séparée par des tirets https://<nom de domaine Looker>/reporting/<dashboard_id>
- Sur BigQuery, le
dashboard_id
n'est pas directement disponible dans les tablesINFORMATION_SCHEMA.JOBS
. Vous pouvez établir une correspondance entre les jobs BigQuery et les dashboards Looker Studio en utilisant les informations disponibles dans la colonnejob_config.labels
des tablesINFORMATION_SCHEMA.JOBS
. - Exécutez une requête BigQuery sur la table
INFORMATION_SCHEMA.JOBS_BY_PROJECT
pour extraire les informations sur les jobs BigQuery qui ont été exécutés. - Filtrez les résultats de la requête pour ne récupérer que les jobs qui ont une étiquette
looker_dashboard_id
dans la colonnejob_config.labels
. Vous pouvez le faire en utilisant la syntaxe suivante dans votre requête : - Ensuite, pour récupérer le
dashboard_id
correspondant à chaque job, vous pouvez utiliser la requête suivante :Cette requête renvoie lejob_id
et ledashboard_id
correspondant pour chaque job BigQuery qui a été exécuté pour alimenter un dashboard Looker Studio.
Etape à suivre pour trouver le dashboard ID sur BigQuery
Voici les étapes à suivre pour trouver le
dashboard_id
en utilisant les tables INFORMATION_SCHEMA.JOBS
:sqlWHERE job_config.labels.looker_dashboard_id IS NOT NULL
sqlSELECT job_id, job_config.labels.looker_dashboard_id AS dashboard_id FROM `project.region.INFORMATION_SCHEMA.JOBS_BY_PROJECT` WHERE job_config.labels.looker_dashboard_id IS NOT NULL
En suivant ces étapes, vous devriez être en mesure de trouver le
dashboard_id
pour chaque job BigQuery qui a été exécuté pour alimenter un dashboard Looker Studio.Billing rate ou Taux de facturation
Le billing rate sur BigQuery est le coût facturé par Google Cloud pour l'utilisation des ressources BigQuery, exprimé en dollars par téraoctet (USD/TB). Le billing rate est déterminé par le type de stockage des données et le type d'utilisation de la requête.
Le stockage des données dans BigQuery peut être facturé de différentes manières en fonction de l'option de stockage choisie:
- Le stockage natif (standard) de BigQuery est facturé à un taux fixe de 0,02 USD/TB/mois.
- Le stockage en colonnes (columnar storage) est facturé à un taux plus élevé de 0,04 USD/TB/mois.
Pour les requêtes, le coût est basé sur la quantité de données analysées. La tarification de BigQuery est conçue pour être transparente et prévisible, ce qui signifie que vous ne paierez que pour les données que vous utilisez réellement et le temps de traitement des requêtes. Le coût des requêtes peut varier en fonction de facteurs tels que le type de requête (standard ou legacy SQL), le nombre de requêtes simultanées et la complexité de la requête.
Où trouver le taux de facturation sur son compte BigQuery ?
Le taux de facturation (billing rate) sur votre compte BigQuery peut être trouvé dans la console Google Cloud Platform (GCP). Voici les étapes à suivre pour y accéder :
- Connectez-vous à votre compte Google Cloud Platform (GCP).
- Accédez à la console BigQuery en sélectionnant le produit BigQuery dans le menu de navigation de la console GCP.
- Dans la console BigQuery, sélectionnez le projet pour lequel vous souhaitez connaître le taux de facturation.
- Cliquez sur l'icône d'engrenage dans le coin supérieur droit de la fenêtre BigQuery et sélectionnez "Paramètres de facturation".
- Dans la page "Paramètres de facturation", vous devriez voir le taux de facturation actuel de votre compte BigQuery. Le taux de facturation est exprimé en dollars par téraoctet (USD/TB).
⚠️
Il est important de noter que le taux de facturation peut varier en fonction de l'option de stockage choisie et du type de requête. Si vous utilisez des options de stockage telles que le stockage en colonnes ou si vous utilisez des requêtes complexes qui nécessitent plus de ressources de traitement, votre taux de facturation peut être plus élevé que le taux de facturation standard. Par conséquent, il est important de comprendre comment le coût est calculé pour éviter les surprises en matière de facturation.
Comment calculer le coût d’une requête BigQuery ?
Le taux de facturation (billing rate) n'est pas directement disponible dans les tables INFORMATION_SCHEMA.JOBS de BigQuery.
Cependant, il est possible de calculer le coût de chaque requête à l'aide des informations disponibles dans ces tables :
- nombre de téraoctets analysés : obtenu à partir de la colonne
total_bytes_processed
dans la table INFORMATION_SCHEMA.JOBS
- durée de la requête en secondes : obtenu à partir des colonnes
total_slot_ms
ettotal_compute_units
dans la table INFORMATION_SCHEMA.JOBS
- tarif de traitement par seconde : Le tarif de traitement par seconde dépend du type de requête et du nombre de ressources allouées à la requête.
- taux de facturation : Le taux de facturation doit être récupéré à partir de la console, comme expliqué précédemment.
Pour calculer le coût d'une requête à partir des informations disponibles dans les tables INFORMATION_SCHEMA.JOBS, vous pouvez utiliser la formule suivante :
coût de la requête = (nombre de téraoctets analysés x taux de facturation) + (durée de la requête en secondes x tarif de traitement par seconde)
⚠️
Cette formule peut fournir une estimation approximative du coût réel de la requête, car le taux de facturation peut varier en fonction de l'option de stockage choisie et du type de requête. Par conséquent, il est important de surveiller régulièrement les coûts d'utilisation de BigQuery pour éviter les surprises en matière de facturation.