Sub topic 6
Usage dashboards and budget alerts
This chapter assumes you can query the billing system tables from the previous chapters, that Unity Catalog is enabled, and that you have account admin access, or have been granted SELECT on the system.billing schema. You will turn those queries into a dashboard and set up budgets that warn you before spend gets out of hand.
Why dashboards and budgets
Queries against system.billing.usage answer a question once. A dashboard answers it every day without anyone asking. A budget goes one step further and notifies people when spend crosses a threshold. Together they catch cost growth in days instead of at month end.
Use the built-in usage dashboard first
Databricks provides a prebuilt usage dashboard that you can import from the account console. It reads the billing system tables and covers common views: spend by SKU, workspace, and custom tag over time. Start with it before you build anything. Customize it only when it cannot answer a question your team keeps asking.
Build your own dashboard
For a custom dashboard, create an AI/BI dashboard and add datasets that read the system tables. Keep each dataset narrow, with a date filter, so the dashboard stays fast and cheap to run on a SQL warehouse.
A useful first dataset is daily DBUs by SKU:
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;Add a second dataset for estimated 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;Remember that this cost uses list prices. It ignores negotiated discounts and the cloud provider's infrastructure charges, so treat it as a relative measure for comparing teams and spotting trends, not as your invoice.
Good widgets for these datasets:
- A stacked bar chart of daily DBUs by SKU, to spot a new or growing SKU.
- A table of estimated cost by team, with a row for untagged usage.
- A line chart of 7-day totals, to separate real growth from daily noise.
Schedule the dashboard to refresh daily and share it with the people who own the spend.
Set up budgets
A budget tracks spend against a monthly amount you choose and sends email alerts to the addresses you list. You create budgets in the account console, under the usage section, and need account admin rights to do so.
When you define a budget, you choose:
- A name and a monthly amount. Pick a number tied to a plan, such as last month's spend plus an allowance for growth.
- A scope. Apply it to the whole account, or filter it to specific workspaces or custom tags. Tag-based scopes only work for usage that is tagged, which is why the tagging chapter comes first.
- Recipients. Add a team mailbox or distribution list so alerts do not depend on one person.
Budgets are notifications. They do not stop clusters or block jobs. If you need a hard limit, use compute policies, covered in a later chapter.
Common errors
- Dashboard totals that do not match the invoice. List prices exclude discounts and cloud charges. Compare trends, not absolute numbers.
- Empty or partial tag views. Usage without a
teamtag appears asNULL. Show it as its own row so untagged spend stays visible. - Slow or costly dashboards. Always filter by
usage_date, and avoid refreshing more often than the data changes. Billing data updates through the day, not instantly. - Alerts nobody reads. Send them to a shared address and name an owner who responds.
Exercise
Your dashboard shows estimated cost by team, but 30% of the spend appears under a NULL team. What does this mean, and what are two ways to fix it?
Show answer
The usage came from compute that has no team custom tag, so it cannot be attributed. Fix it by enforcing the tag with a compute policy (for example a fixed or required custom_tags.team), and by adding the tag to existing jobs and clusters. Until then, keep the NULL row visible on the dashboard.
Exercise
A budget is set to $10,000 per month and the account passes that amount. What happens to running clusters?
Show answer
Nothing stops. A budget only sends email notifications to its recipients. To limit spend you need controls such as compute policies, auto-termination, or cluster size caps.