Is it possible to track the cost of bigquery queries using the configuration.labels
attribute on a query request? I have specified some labels and I do find it in the job definition as you can see here:
{
"configuration": {
"labels": {
"label1": "tomas",
"label2": "yolo"
},
"query": {
"allowLargeResults": false,
"createDisposition": "CREATE_IF_NEEDED",
"destinationTable": {
"datasetId": "dataset",
"projectId": "project name",
"tableId": "label "
},
"priority": "INTERACTIVE",
"query": "a select query",
"useLegacySql": false,
"writeDisposition": "WRITE_TRUNCATE"
...
}
I have also enabled billing export under billing, but when I look at the exported data I can’t find my labels.
Labeling works fine when applied to dataset and tables, but I can't get it to work with queries. Are these labels for queries something else and doesn't show up in the billing?
I have not been able to query or filter on specific labels, but can at least display them with this...
SELECT service.description, cost, labels
FROM `PROJECTNAME.billing_report.gcp_billing_export_v1_016D47_E84908_9F5AB5`
WHERE cost > 0
LIMIT 1000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With