SuperAPIAI Directory

dbu-waste-finder

github.com · AI developer platforms

DBU Waste Finder is a free, read-only Databricks tool consisting of a Notebook and an MCP server that identifies DBU (Databricks billing unit) waste from Databricks system tables and provides remediation recommendations. The Notebook can be imported directly into a workspace and run without installation, and data never leaves the workspace; the MCP server runs locally and lets AI clients such as Claude and Cursor answer "why did the bill go up" based on system tables, and propose remediation recommendations to an Asset Bundle as a diff (read-only, never applied automatically). The tool estimates waste amounts at list price and caps or flags low-confidence projections when the number of observed days is insufficient.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

Purpose

DBU Waste Finder is used to analyze DBU consumption in a Databricks workspace, identify resources that appear to be wasted, and provide actionable remediation recommendations. It only reads Databricks system tables and does not modify any resources.

Main components

The repository contains two parts:

  • notebook/: a free Notebook that can be imported into a workspace and run without installation, and does not send data outside the workspace.
  • mcp/: an MCP server that enables AI clients such as Claude and Cursor to answer "why did our bill jump" based on system tables and to propose remediation recommendations to an Asset Bundle as a diff; this process is read-only, and recommendations are never applied automatically.

Usage

  1. Import notebook/dbu_waste_finder.py into a workspace (File → Import).
  2. Attach to any compute resource (serverless is also fine); the running user needs USE CATALOG on system , and USE SCHEMA + SELECT privileges on system.billing、system.compute、system.lakeflow、system.query .
  3. Adjust the thresholds in the first cell, then Run all. Checks for schemas that are not enabled are skipped.

The MCP server runs on your local machine, uses your token to read system tables, and returns results to the AI client.

Projections and confidence

  • measured_saving_usd / measured_waste_dbu: waste found by checks within the analysis window (USD counts only items with pricing).
  • observation_days: the number of days of data actually covered by the window, from the earliest record within the lookback window to the current time, capped at the lookback days.
  • projected_30d_usd / projected_30d_dbu: extrapolated as "measured ÷ observed days × 30" only when observation_days ≥ 3; null when fewer than 3 days or unknown, with the reason stated.
  • low_confidence: true with a note when observed days < 7; projections are shown but flagged for 3–7 days; not flagged at exactly 7 days.

This projection is an extrapolation of past waste at list price and does not guarantee actual savings.

Use cases

  • Check for waste such as idle or oversized clusters, warehouses with long auto-stop times, and serverless jobs.
  • Quickly query cost summaries, main cost drivers, and waste items through an AI client.
  • Generate remediation recommendation diffs in an Asset Bundle for human review.

Limitations and notes

  • Costs use pricing.effective_list.default(list price), not contracted discounted prices.
  • Idle/oversized clusters are counted as 50% of cost as waste (adjustable via IDLE_SAVING_SHARE), and checks may overlap.
  • DBU/hour for idle warehouses is assumed based on Databricks SQL published rates.
  • system.billing.usage has a delay of several hours;system.compute and system.query are usually available earlier.
  • usage_metadata.job_id is not populated for jobs on all-purpose compute and must be detected via job_task_run_timeline.compute_ids .
  • system.billing is account-level, but system.compute and system.lakeflow cover only workspaces in the current region; cross-region cluster usage is listed in cluster_region_gap and warns that it must be run separately by region.
  • If a SKU has no record in system.billing.list_prices , the USD total only aggregates the priced portion, marks usd_complete = false, and lists the unpriced SKUs; DBU is always displayed.
  • The MCP server returns job/cluster/warehouse names and IDs, DBU, list price amounts, and owner email addresses to the AI client and its provider; it is recommended to use a read-only service principal and to connect only AI clients that can share this metadata.
  • Not affiliated with Databricks; MIT licensed.

Verification status

Actually run on a Databricks trial workspace (AWS, serverless only): all queries are executable; the idle warehouse check, the warehouse long auto-stop check, and the cost tools all return results. Classic cluster-related checks (all-purpose jobs, auto-termination, idle clusters) have not yet been verified in a real environment because the trial workspace cannot run classic clusters.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools