Weekly Databricks cost digest to catch spend spikes

By General Input

Every Monday, get a plain-language recap of last week's Databricks spend in Slack, with the top cost drivers and any spending spikes flagged for you.

Integrations

  • Databricks
  • Slack Bot

Type

Agentic Task

Categories

  • Finance
  • Engineering

Every Monday at 8am, summarize last week's Databricks spend and post a plain-language cost digest to Slack so finance and platform leads can catch cost spikes early. Run this on a cron schedule (Mondays at 8:00am in our timezone).

Use the Databricks Execute SQL Statement operation to query the Unity Catalog billing usage system table (system.billing.usage) for DBU consumption over the last 7 days versus the prior 7 days. Provide the warehouse_id of a running SQL warehouse to run the statement. Break the results down three ways: by SKU (the billed product, such as Jobs Compute or SQL warehouse usage), by workspace, and by job or warehouse. Compute two windows so week-over-week change can be calculated per group: the current 7-day window (day -7 through today) and the prior 7-day window (day -14 through day -7). Note that system.billing.usage records DBU quantities; if the workspace also exposes system.billing.list_prices, join to it to translate DBUs into an estimated dollar amount, otherwise report spend in DBUs. The workspace personal access token must have access to the system.billing schema.

After submitting the statement, poll the Databricks Get SQL Statement operation until status.state is SUCCEEDED. Keep waiting and re-checking while the state is PENDING or RUNNING, and treat FAILED or CANCELED as an error to report in the digest rather than failing silently. If the result set is paged into multiple chunks, fetch the remaining chunks so you have the complete data before analyzing.

Once the full data is back, have the agent reason over it rather than dumping the table. Identify the top cost drivers (the SKUs, workspaces, and jobs or warehouses consuming the most DBUs or dollars this week), the biggest week-over-week changes in both directions, and any anomalies (for example a job that suddenly appears with no prior baseline, or a large jump concentrated in one workspace). Flag any job or warehouse whose spend jumped more than a configurable threshold percentage (default 30%) week over week, naming it and showing the prior amount, the current amount, and the percent change.

Post the recap to Slack using the Slack Bot Send a Message operation (posted as the bot) to a configurable channel such as #databricks-costs. Write it in business terms: a short headline with total spend and the week-over-week direction, a few bullets naming the top cost drivers and notable movers, and a clearly labeled section for any threshold breaches and anomalies. Use Slack mrkdwn formatting (single asterisks for bold) and keep it skimmable for a non-technical finance or platform lead. Make the threshold percentage, the target channel, and the schedule easy to change.

Related prompts

Explore more prompts
A brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasonLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsLinkedIn Ads budget pacing dashboard for every client accountGive your team Looker numbers without buying more seatsPause marketing emails to escalated customers, then restore them