Databricks Cost Optimization
Router skill — detects intent and loads the appropriate sub-skill.
Prerequisites
- Databricks CLI authenticated — run
databricks auth describeto verify. If auth fails, switch to thedatabricks-cli-installskill. - Account admin or workspace admin — needed for billing system tables, compute policies, and budgets. Some steps work with lesser privileges.
- Unity Catalog enabled — required for
system.billing.usagequeries.
Intent Detection
| Intent | Triggers | Load |
|---|---|---|
| Cost Monitoring & Governance | billing, tagging, budget, chargeback, cost dashboard, cost audit, system.billing.usage, untagged resources, cost attribution, spending alerts | cost-monitoring-governance/SKILL.md |
| Cluster Compute | job compute, all-purpose, autoscaling, auto termination, compute policy, instance type, right-size, Photon cost, spot instances, fleet, cluster cost, expensive cluster | cluster-compute/SKILL.md |
| SQL Warehouses | SQL warehouse, warehouse sizing, serverless warehouse, classic warehouse, IWM, SQL cost, warehouse idle, warehouse scaling | sql-warehouses/SKILL.md |
| Streaming & Workloads | streaming cost, always-on, triggered streaming, availableNow, Delta optimization, OPTIMIZE, VACUUM, Z-ORDER, runtime version, batch vs streaming | streaming-workloads/SKILL.md |
| ML & GPU Compute | GPU cost, unnecessary GPU, ML training cost, model serving cost, deep learning cost, GPU audit, GPU instance | ml-gpu-compute/SKILL.md |
| Full Audit | full cost audit, reduce overall spend, cost optimization review | Load cost-monitoring-governance/SKILL.md first, then route to other sub-skills based on findings |
Workflow
Start
↓
Ask user: What do you want to optimize?
↓
├─→ Cost monitoring / tagging / budgets → Load cost-monitoring-governance/SKILL.md
├─→ Cluster compute costs → Load cluster-compute/SKILL.md
├─→ SQL warehouse costs → Load sql-warehouses/SKILL.md
├─→ Streaming / workload costs → Load streaming-workloads/SKILL.md
├─→ ML / GPU costs → Load ml-gpu-compute/SKILL.md
└─→ Full audit → Load cost-monitoring-governance/SKILL.md
then route based on findings
⚠️ MANDATORY STOPPING POINT: Ask the user which area to focus on before loading any sub-skill. If the user wants a full audit, start with cost monitoring to identify the biggest cost drivers, then route accordingly.
Stopping Points
- ✋ Before loading any sub-skill: confirm focus area with user
- ✋ After full audit assessment: confirm which areas to optimize
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
system.billing.usage not found |
Unity Catalog not enabled or no access | Enable UC or request system catalog access from admin |
| Compute policy errors | Insufficient privileges | Need workspace admin role to create/edit policies |
| Missing tags on resources | Tags never applied | Start with cost-monitoring-governance sub-skill to set up tagging |
| Budget API errors | Account-level feature | Budgets require account admin; workspace admin is not enough |
Output
Each sub-skill produces its own deliverables. For a full audit, the combined output is:
- Cost assessment report — 30-day spend breakdown by SKU, workspace, and tag
- Optimization recommendations — prioritized list with estimated savings
- Implementation plan — specific changes with before/after cost projections
- Monitoring setup — tags, budgets, and dashboards for ongoing control