Operations

How to bill a shared BigQuery reservation to the projects that use it

BigQuery editions can now charge reservation compute to the projects that ran the queries. What the preview setting moves, what stays behind, and how to trial it.

The Cloud Practice2 min readOperations

A shared BigQuery reservation has always produced the same invoice: one large compute line on the administration project and $0 beside every project that ran the queries. Chargeback, where it existed, was a query against the jobs view and a spreadsheet.

On November 9 Google added an opt-in that moves the billed compute onto the query projects. It is in Preview. We would trial it this quarter and not build policy on it yet.

What the setting moves

Per the reservation monitoring docs, compute charges shift to each query project by the slot hours its queries consumed. Autoscaler slots go to the projects that triggered them. Storage does not move; it was always billed where the datasets live.

Three things stay on the administration project: unused baseline capacity, unassigned commitments, and autoscaler slots that were provisioned and never used. That remainder is the useful number. It is the price of capacity nobody consumed, on a line of its own for the first time, and it belongs to whoever sized the reservation.

The trial, in four steps

Start with what is already on the bill. Each project carries an informational line item, Analysis Slots Attribution, that shows slot hours with no cost attached. Export last month's by project. That is the shape of the split, and looking is free.

Check billing accounts. Attribution only works when the administration project and the query project sit on the same Cloud Billing account. A project on any other account stays on the central line, so list those before anyone promises finance a clean split.

Warn the budget owners. Projects that have always shown $0 compute are about to show real money, and every budget alert tuned to the old shape will fire.

Then switch one region. A BigQuery Administrator on the administration project runs:

ALTER PROJECT `ADMIN_PROJECT_ID`
SET OPTIONS (
  `region-LOCATION.reservation_attribution_mode` = 'RESERVATION_ATTRIBUTION_MODE_PROJECT_LEVEL'
);

The change appears from the next billing day, and billing days start at midnight Pacific. Run it on the last day of a month, so no invoice carries both models.

What we would not do yet

Rewrite the chargeback policy around it. The docs describe Preview features as available as is, with limited support. Keep the spreadsheet for one more quarter and compare its split with the invoice's. Where the two disagree, find out why before finance does.

Save the last full invoice in the old shape as well, for the reason we give for any cost baseline: after the switch, the per-project lines have no earlier months to be compared against.