Hi,
I am trying to get cost of queries being running in background of looker studio dashboard, I tried using below query.
with looker_studio_job_info as (
select
job_id,
creation_time,
user_email as datasource_owner,
labels,
referenced_tables,
query,
from `region-eu`.INFORMATION_SCHEMA.JOBS
where (select l.value from unnest(labels) l where l.key = "requestor")="looker_studio"
and creation_time >= timestamp_add(current_timestamp, interval -10 day)
)
select
*,
round(bytes_processed / 1024 / 1024 / 1024, 2) as total_processed_bytes_gib,
date(creation_time) as creation_date
from looker_studio_job_info
left join (
select
job_id,
sum(total_bytes_processed) as bytes_processed
from `region-eu`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
where creation_time >= timestamp_add(current_timestamp, interval -10 day)
group by job_id) as job_bytes_processed on looker_studio_job_info.job_id = job_bytes_processed.job_id
In some of my projects referenced_tables field is giving mutliple project_id, table_id in referenced_tables field(obviously that they might be referring in some manner) , how to get cost specific to a gcp project, also how these queries would be charged since i have the bytes processed