cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
Community Articles
Dive into a collaborative space where members like YOU can exchange knowledge, tips, and best practices. Join the conversation today and unlock a wealth of collective wisdom to enhance your experience and drive success.
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

How to set budgets and alerts on SQL warehouses so self-service never surprises Finance

Valeria_Koz_DBX
Databricks Employee
Databricks Employee

The quickest way to lose a self-service analytics programme is a bill nobody saw coming.

In my last post I covered chargeback: working out, after the fact, which team spent what. That answers "whose cost is this?" It doesn't answer the question Finance asks first: "Why didn't anyone tell us before month end?"

At a large UK bank's data platform team, chargeback gave us a clean monthly picture. But a month is a long time when one badly written dashboard query can run on a warehouse every five minutes. We needed the same attribution, turned into early warnings. Here's the step-by-step.

Step 1 — Agree with Finance what a "surprise" actually is

Before setting a single threshold, agree two numbers per team:

  • a monthly budget for SQL warehouse spend
  • a daily tolerance: how far above normal one day can go before someone should look

Without this, every alert is someone's opinion, and opinions get ignored.

Step 2 — Put guardrails on the warehouses themselves

The cheapest alert is the one you never need. On each SQL warehouse:

  • Auto-stop: short (5–10 minutes on serverless). Idle warehouses are the most common waste.
  • Scaling: set a sensible maximum number of clusters, not "as many as it takes."
  • Size: start small and size up based on evidence (queuing, slow queries), not fear.
  • Statement timeout: cap runaway queries so one mistake can't run all night.

Step 3 — Tag every warehouse with an owner

Give each warehouse custom tags, at minimum team, cost_centre and env. Tags flow through to system.billing.usage, which is what everything below is built on. Check what's untagged first:

ā€ƒStep 3 — Tag every warehouse with an owner.png

If that returns rows, fix them before building alerts. Untagged spend is spend nobody gets warned about.

Step 4 — Create an account budget per team

In the account console (Usage → Budgets), create one budget per team, filtered on the team tag, with email notifications at, for example, 50%, 80% and 100% of the monthly amount. Budgets give you the slow, monthly view: "we're on track to go over."

Step 5 — Build a daily cost query from the system tables

Budgets are monthly. For "something odd happened yesterday", query the system tables directly. Join usage to list prices for the period each price was valid:ā€ƒ

Step 5 — Build a daily cost query from the system tables.png

Step 6 — Turn it into two SQL alerts: a hard line and an unusual-day check

  • Alert A (hard line): yesterday's spend per team above the daily tolerance from Step 1.
  • Alert B (unusual day): yesterday is more than 1.5Ɨ the team's 30-day average. This catches the problem even when the absolute number still looks small.

Step 6 — Turn it into two SQL alerts.png

Save it as a query, create a SQL alert that triggers when it returns any rows, schedule it once a day in the morning, and send it to the team's channel, not just a platform inbox. Run alerts on a small serverless warehouse: alerts cost compute too.

Step 7 — Write the one-page runbook

An alert without a next step is just noise. Ours said who receives it (the team owner, with the platform team copied), and the first thing to check, the heaviest queries on that warehouse yesterday:

Step 7 — Write the one-page runbook.png

Usually the answer is one scheduled dashboard refresh or one query missing a filter: a five-minute fix, found days earlier than the invoice would have shown it.

Expected outcome

  • Finance hears about unusual spend the next morning, not at month end.
  • Every warning goes to a named team with a known first step.
  • Self-service stays open, because the people funding it can see it's being watched.

Common errors

  • Alerting on today's data. Billing records arrive with a delay of hours, so today always looks cheap. Alert on yesterday.
  • Treating list price as the invoice. list_prices doesn't include your discounts. Label numbers as "list estimate", or apply your contract rate.
  • Untagged warehouses. They fall outside every team budget. Run the Step 3 check monthly.
  • Treating budgets as caps. Budgets notify; they don't stop spend. Guardrails (Step 2) do the stopping.
  • Too many alerts. If people get one every day, they stop reading them. Start with the two in Step 6.
  • Alerts on a large always-on warehouse. The monitoring becomes a cost line of its own.

The takeaway

Chargeback tells you who spent it. Budgets and alerts tell you while you can still do something about it. Together they make the trade with Finance explicit: we open up self-service, and you never get a surprise.

What's your trigger for "someone should look at this": a fixed amount, a percentage over normal, or something smarter?

0 REPLIES 0