简体   繁体   中英

BigQuery and Data Studio usage (cost)

I wanted to view the BigQuery costs in my project. I am downloading logs to the table according to the following function:

resource.type = "bigquery_resource"
protoPayload.methodName = "jobservice.jobcompleted"

However, when I view the data, the information about refreshing the table in Data Studio does not reflect here. This data appears during the filter:

protoPayload.serviceName = "bigquerybiengine.googleapis.com"

However, at this point there is no use, only information about the access to the data range. How can I read the data consumption data when refreshing reports in Data Studio?

To analyze the cost of Data Studio report and query costs you can use Cloud Audit Log for Bigquery, making use of event data and export it to BigQuery to analyze it.

  • Create a sink from cloud logging, this will output all BigQuery query_job_completed log events from Cloud Audit Logging service into your Bigquery table.
  • When you have the BigQuery event data flowing into your dataset, you can create a view and query it. You will get totalBilledBytes per query which can be used to calculate the cost of queries.

You can refer to this documentation for further information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM