I have already setup billing exports as described in this link for billing analysis.
For the resources like dataset etc labels are set from console and I can do analyse resources billing in Data studio report for those labels.
However now I want to assign labels to bigquery queryjobconfig for analysis. Below is the code.
from google.cloud import bigquery
client = bigquery.Client()
sql='SELECT sum(col_name) FROM `my-project.table`'
query = (sql)
job_config = bigquery.QueryJobConfig()
job_config.labels = {'team':'development'}
query_job = client.query(
query,
location='US',
job_config=job_config )
for row in query_job:
print(row[0])
The query is executed successfully and I can see logs in stackdriver also. But its been 48 hours I don't see entry for queryjobconfig labels in billing export tables.
Can somebody suggest what is the correct way to set label?