What each level gives you
“Right away” means your cloud billing export (AWS CUR, Azure Cost Management, or GCP BigQuery billing) is already connected to Costory, with no Databricks setup.system.compute.node_timeline and related tables, matches each instance id to the cluster and job that held it (hour by hour on AWS and GCP, day by day on Azure), and rolls VM spend together with DBUs from Level 1. You can trace a spike on an EC2 line back to a job run, see pool idle separately from active work, and build dashboards on total Databricks cost per team or tag, not DBUs alone.
That enrichment is not the same as Enrichments, which are lookup files you publish from git. The export notebook supports include_compute=true for the compute tables Level 2 uses.
How the data flows
Pick storage you own
Run a daily export job
Grant Costory read-only access
GetObject / ListBucket (AWS), Storage Blob Data Reader (Azure), or roles/storage.objectViewer (GCP) on the prefix you use. That is the only credential Costory holds for Databricks.Costory ingests and keeps history
Key terms used in this article
- Level 1 (Billing): DBU usage from
system.billing.usage, priced from yoursystem.billing.list_pricesexport (or split from your cloud bill if you pay through a marketplace). - Level 2 (Enrichment): Cloud VM lines gain Databricks cluster, job, and job run dimensions by matching instance ids, so DBU cost and VM cost describe the same workload.
- System tables: Databricks-managed tables under
system.billing,system.access, andsystem.compute. You enable the schemas, then the export job reads them. - Unity Catalog external location: The landing path your export job writes to, backed by storage credentials in your cloud account.
Prerequisites
- A Costory account.
- A Unity Catalog admin (plan about 30 to 60 minutes for first-time setup).
- A storage location you control, in the same cloud as the workspace.
- For Level 2: AWS, GCP, or Azure billing already in Costory, and on GCP the detailed (resource-level) billing export to BigQuery.
- Manual setup
- Terraform
Enable system schemas
billing and access. For Level 2, also enable compute. See Databricks system tables.Create the storage location
Import and schedule the export notebook
- First run:
lookback_days=365to load up to 12 months of history. - Daily run:
lookback_days=3(rewrites the last few ingestion dates so Databricks corrections land correctly). - Set
include_billing=truein one workspace only (billing data is account-wide). - For Level 2: set
include_compute=truein one workspace per region, withinclude_billing=falseon those jobs, and setregionto a label such aseu-west-1.
Grant Costory read-only access
Send Costory your connection details
- The billing root path (for example
gs://<bucket>/costory/billing/orgs://<bucket>/costory/databricks/billing/). - How you pay for Databricks: direct contract (Databricks invoice) or marketplace (AWS, Azure, or GCP).
- For a direct contract, your optional discount % if you want paid-cost metrics to apply it (list price stays visible for comparison).
Level 1: Databricks DBU billing
- Databricks as a provider in Costory, with spend by product (Jobs, SQL, All-Purpose, DLT, Model Serving, Apps, and similar lines), SKU, and workspace.
- Breakdowns by cluster, job, job run, SQL warehouse, DLT pipeline, serving endpoint, notebook, app, and instance pool, from Databricks usage metadata.
- Custom tags from Databricks become dimensions you can use in allocation, dashboards, alerts, and reports.
- Serverless workloads are fully covered at Level 1. They run in Databricks’ account, and the DBU price already includes the compute. There are no VMs in your cloud bill for them.
- Corrections: Databricks retractions and restatements in
system.billing.usageare ingested as-is. Costory nets them so you always see net usage, not only original rows. - Freshness: Usage usually appears in Costory within about 12 hours after your daily export. See Data refresh.
- History: Run the notebook once with
lookback_days=365to load up to 12 months.
system.access.workspaces_latest. If the access schema is not enabled yet, you still get workspace_id.
How DBUs are priced
Costory uses the most accurate price available and does not count DBUs twice.Level 2: VM enrichment
Level 2 shows the full price of each workload: you see DBUs and cloud VMs on the same cluster, job, and job run instead of reconciling two bills by hand. Costory ties every billable instance id in your cloud account to the Databricks cluster, job, and job run that used it, then adds those VM dollars to the DBUs you already see from Level 1. In Explorer you can:- Group total cost (DBUs + VMs) by job name, cluster, workspace, or your Databricks custom tags
- Open a job run and see both DBU lines and the EC2 / Azure VM / Compute Engine lines for the nodes that executed it
- Compare DBU-only spend to infrastructure spend for the same cluster (useful when VM waste or instance type choice dominates)
- Split instance pool idle from time pools spent on real workloads
- Matching uses instance ids from Databricks compute system tables, not cloud cost allocation tags. It works on history, including dates before you activated tags on AWS.
- When an instance moves between clusters, its cost is split by the minutes or hours it spent on each: hour by hour on AWS and GCP, day by day on Azure (Azure cost exports are daily).
- Instances in pools are attributed to the cluster or job that pulled them. Time an instance sits ready but unassigned is pool idle on that pool, so idle pool capacity is visible instead of disappearing into anonymous VM spend.
- Setup: one export job per Databricks region with
include_compute=true, plus cloud billing already in Costory. On GCP, enable the detailed billing export so Costory can read VM resource ids. - History follows what Databricks retains in
system.computetables.
What is not covered
Export notebook
Each run rewrites only the last few days of partitioned tables and fully refreshes small reference tables, so storage stays small and nothing is duplicated.system.billing.usage can include an identity_metadata column (for example user emails). Costory does not need it for DBU billing or allocation by cluster, job, or custom tags. You can drop that column in the export query if your security policy requires it.Job parameters
Output layout
<target_path>/billing/). You can use any prefix layout (such as costory/billing/ or costory/databricks/billing/). Costory is configured with the path you provide.
Export notebook (Python)
Export notebook (Python)
FAQ
Why does Costory not connect to the Databricks API?
Why does Costory not connect to the Databricks API?
Workspace names show as ids only
Workspace names show as ids only
system.access schema and include workspaces in the export (the notebook does this when include_billing=true). Until then, group and filter by workspace_id.Will I be double-charged if I also pay Databricks through GCP or AWS?
Will I be double-charged if I also pay Databricks through GCP or AWS?
list_prices plus an optional discount %.How much does the export job cost?
How much does the export job cost?
Can I delete old files in my bucket?
Can I delete old files in my bucket?
