1

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?

GuziQ
  • 111
  • 6
  • As far as i understand BigQuery is reached by and API call from datastudio much like any other query. – Anant Feb 21 '22 at 12:39
  • @Anant yes. I have the data and I am refreshing the report in Data Studio. However, I would like to see the cost of such queries in the logs, which I do not have yet. – GuziQ Feb 21 '22 at 13:57
  • I am not quite sure if you can do that. although you could estimate the cost of a individual queries in the logs. – Anant Feb 21 '22 at 18:30

1 Answers1

1

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.

Sakshi Gatyan
  • 1,903
  • 7
  • 13
  • I download logs like this. However, queries that refresh the report in Data Studio are not taken into account there, and I don't know why. – GuziQ Feb 23 '22 at 15:21
  • 1
    Hi @GuziQ, would recommend asking your query in Data Studio [community](https://support.google.com/datastudio/community?hl=en) for more information on this. – Sakshi Gatyan Mar 06 '22 at 12:06