Sub topic 13
Building a recurring cost review process
This chapter assumes you can query the billing system tables, have tagged compute for attribution, and know what compute policies and budgets do. Controls such as policies and auto-termination slow cost growth, but they do not catch every change. Workloads grow, teams add jobs, and prices change. A short, regular review keeps the controls matched to how the platform is actually used.
What the review is for
The review answers three questions:
- Where did spend change since the last review, and why?
- Which spend can't be tied to a team or project?
- Which control (policy, budget, or tag rule) needs to change?
Keep it to 30 to 45 minutes. Run it weekly while you are getting started, then monthly once spend is stable.
Prepare the data before the meeting
Do the analysis ahead of time so the meeting is spent on decisions. Start with a daily DBU view by SKU. A jump in one SKU usually points to a specific compute type.
SELECT
usage_date,
sku_name,
SUM(usage_quantity) AS dbus
FROM system.billing.usage
WHERE usage_date >= date_sub(current_date(), 30)
AND usage_unit = 'DBU'
GROUP BY usage_date, sku_name
ORDER BY usage_date, dbus DESC;Then estimate cost by workspace and team tag.
SELECT
u.workspace_id,
u.custom_tags['team'] AS team,
SUM(u.usage_quantity * p.pricing.default) AS estimated_list_cost
FROM system.billing.usage u
JOIN system.billing.list_prices p
ON u.sku_name = p.sku_name
AND u.cloud = p.cloud
AND u.usage_unit = p.usage_unit
AND u.usage_end_time >= p.price_start_time
AND (p.price_end_time IS NULL OR u.usage_end_time < p.price_end_time)
WHERE u.usage_date >= date_sub(current_date(), 30)
GROUP BY u.workspace_id, u.custom_tags['team']
ORDER BY estimated_list_cost DESC;Rows where team is NULL are untagged spend. Track the share of untagged cost as a metric from review to review. It should fall over time.
Run the review
Walk through the same checklist each time so results are comparable.
| Step | Check | Typical action |
|---|---|---|
| Trend | Total and per-SKU DBUs against the last period | Investigate any SKU that grew sharply |
| Attribution | Share of cost with no `team` tag | Fix the job or cluster, or tighten the policy |
| Budgets | Budgets that fired or are close to firing | Raise, lower, or reassign the budget |
| Idle and oversized compute | Long-running all-purpose clusters, high `max_workers` | Lower auto-termination or worker caps |
| Compute choice | Scheduled work on all-purpose compute | Move it to jobs compute |
| Policies | Exceptions and policy violations | Update the policy, not just the one cluster |
The last column matters. Prefer a fix at the control level, such as a policy rule or a required tag, over a one-time cleanup. A one-time cleanup removes this month's waste and leaves the cause in place.
Assign owners and record decisions
Each finding needs an owner and a date. Keep a short log with the finding, the owner, the action, and the expected effect. At the next review, start by checking the log. If an action did not change the numbers, say so and try a different one.
Keep the process light
A review that takes too much effort stops happening. Put the queries in a saved dashboard so the data prepares itself. Send budget alerts to the team that owns the spend, not only to a central group. Invite the people who can change workloads, such as team leads, along with whoever owns the platform budget.
Common mistakes
- Reviewing only the total. A flat total can hide one team's growth offset by another's cuts.
- Treating list-price estimates as the final bill.
- Fixing individual clusters without changing the policy that allowed them.
- Skipping the review after a quiet month. Quiet periods are when untagged spend and idle compute build up.
Exercise
Your review shows total estimated cost is flat, but 25% of it has a NULL team tag, up from 10% last month. What should you do, and where should the fix go?
Show answer
Treat the rise in untagged cost as a finding even though the total is flat. Find the untagged usage by workspace and SKU, and identify the clusters or jobs that produced it. Assign owners to add the tag. Then fix the cause in the control: add or tighten a compute policy rule that fixes or requires the team custom tag, so new compute can't be created without it. Check the untagged share again at the next review.
Exercise
Why should the review start by checking the log of earlier actions?
Show answer
It shows whether past actions changed the numbers. If an action had no effect, the team can replace it with a different one instead of assuming the problem is solved.