Why this matters
A Google Cloud bill is organized by project, service and SKU. That tells you where money went in the platform's terms, not in yours. Labels close the gap. Put a cost center, an owner, an environment and an app name on resources, and those keys show up in Cloud Billing reports and in the BigQuery billing export next to every line of cost.
Labels are the only resource-level mechanism that reaches the billing data. Resource Manager tags, the ones you attach through the Resource Manager API and use in IAM conditions and organization policy, do not appear in cost exports. Teams set up tags, wait a month, and find nothing. Use labels for money and tags for policy.
Once labels are in the data, questions get cheap to answer: which team owns this spend, what would we save by turning off dev on weekends, how much of the shared network belongs to each product. Without them, people guess from project names, and project names lie after the first reorg.
Before you start
Write the label dictionary before you touch the console. Pick four to six keys and stop: cost-center, owner, env, app and, if you bill customers, customer. Google Cloud label keys and values use lowercase letters, numbers, underscores and dashes, up to 63 characters. Decide the allowed values as a closed list. Free text breaks grouping within a week.
Assume nothing is inherited. Project labels land in the export as their own field, project.labels, and resource labels land in a labels array. Folders contribute nothing to cost data. A VM in a labeled project does not pick up the project's labels, so decide per resource type whether the project or the resource is the right place to record the fact.
Check permissions. You need Billing Account Administrator or Billing Account Costs Manager to turn on the export, BigQuery Data Editor on the target dataset, and BigQuery Job User for whoever runs queries. People who only read reports need a billing role that can view costs, plus read access to the dataset.
Keep the dictionary in a repository and treat label changes like code changes. Labels are mutable, but a change only affects usage recorded after it, so drift between environments shows up as strange months rather than errors.
How to do it
Roll it out in one billing account first. Change the keys after finance builds a report and you will rebuild the report. The order below starts with definitions, gets the data flowing, then fixes the resources that carry the most cost.
Nothing here is retroactive. The BigQuery export starts at the moment you enable it, and labels attached today do not rewrite last month's rows. If you need history, you rebuild it from invoices and a one time manual split, which is why the definitions come first.
- Write the label dictionary. List four to six keys and the allowed values for each, then store the list in your repo. Include an owner value that maps to a real team, not a person who may leave. Publish it where engineers already look.
- Turn on the detailed usage cost export. In the console go to Billing, Billing export, then BigQuery export, and choose your dataset and project. Pick Detailed usage cost, which carries resource level labels, and note the table name it creates. It lands as gcp_billing_export_resource_v1_ followed by the billing account ID.
- Grant narrow access to the dataset. Give finance BigQuery Data Viewer on the dataset and BigQuery Job User on the querying project. Keep write access for a service account only. Share dashboards from a controlled folder so a stray link does not become the leak.
- Label projects first. Use IAM and Admin, Manage resources in the console, or run gcloud projects update PROJECT_ID with update-labels. Projects are the coarsest slice and the easiest to fix. Do it for every project that shows spend in the last full month.
- Label the resources that carry the cost. Start with Compute Engine instances and disks, Cloud Storage buckets, Cloud SQL instances and GKE clusters. BigQuery datasets and Pub/Sub topics take labels too. Leave the long tail until the top spend is covered.
- Put labels in your templates. Set labels in Terraform or your Config Controller manifests so new resources arrive labeled. The Google Terraform provider's default_labels argument sets a baseline, though it applies to everything that provider creates. Override per resource where the default is wrong.
- Handle shared costs with a mapping table. Label shared items such as the host project network, log buckets and shared storage with shared=true. Keep a small BigQuery table that maps each shared item to the teams that consume it, with a split percentage. Join it in your cost query instead of arguing each month.
- Enforce required labels on creation. Organization Policy custom constraints can check resource.labels for some resource types and refuse creation when a key is missing. Test with a dry run on one project first. Then enforce at the folder level for the resource types that matter.
- Review unlabeled spend monthly. Query the export for lines with no labels and send the top items to their owners. Track the unlabeled share, not the labeled share, because the labeled number always looks good. Put it on the monthly cost review agenda so it does not drop off.
How to check it worked
Start with the simple check: open Billing, Reports, group by Label, and pick your cost-center key. If the chart is one large blank slice, either nothing was labeled or the export has not caught up.
Then query the export directly. This finds spend with no resource labels: SELECT SUM(cost) FROM your_dataset.gcp_billing_export_resource_v1_XXXX WHERE ARRAY_LENGTH(labels) = 0. Run it per project and per service. Networking and logging usually top the unlabeled list because nobody thinks to label a load balancer.
Look for value variants with a group by on the key. If you see prod, Prod and production in the same column, enforcement is not working. Reconcile the total against the invoice for the same period, comparing the usage subtotal rather than the amount due, since credits, taxes and late adjustments sit outside it. Then open one resource you know and confirm its labels match what the export says.
Mistakes to avoid
Attaching both tags and labels and assuming the cost report follows the tags. It does not. Pick labels for cost and keep tags for access and policy, then say so in your internal docs so the next team does not repeat the mistake.
Expecting project labels to cover a project that runs three apps. The project slice will be correct and useless. Either split the project or label the resources themselves. The same goes for shared services: a host project network with one label gives you a number nobody can charge back until you add a split rule.
Forgetting credits and discounts. Raw cost and net cost tell different stories, and an unlabeled credit can make a labeled project look cheaper than it is. Report on both fields and note which one your finance team reconciles.
Letting the dictionary grow without an owner. Six keys become twenty, half of them empty, and the reports stop being read. Name one person who approves new keys. If the internal work keeps slipping, outside help is an option: the Cloud cost audit at $4,500/month covers tagging and budget alert fixes in a two week read only review, and hiring a contractor for a few weeks is another path.
Frequently asked questions
Do Google Cloud tags work for cost allocation?
No. Resource Manager tags exist for policy and IAM conditions and never appear in billing exports or cost reports. Labels are the field the billing system records. Use labels for anything money related and keep tags for access control.
Can I relabel costs I already incurred?
No. A label applies to usage from the moment it is set, and past line items keep the labels they had. Turning on the BigQuery export does not import older data either. Plan for one clean month after rollout before you trust the reports.
How many labels can one resource have?
Up to 64 labels per resource, with keys and values up to 63 characters using lowercase letters, numbers, underscores and dashes. Most teams need four to six. A small set keeps reports readable and makes enforcement simpler.