YALineo
EN
Install

The cost of a Databricks job, run by run

The billing system tables give the consumption of each job and each run. Here are the queries that turn it into a cost, the cases they do not cover, and what YALineo does.

Updated on 6 November 2026 · Abdouramane Youssouf

What the bill says about a job

Databricks consumption is in the system.billing.usage system table. For a job, the usage_metadata field carries job_id, the job, and job_run_id, the run the row bills. The cost of a row is its quantity (usage_quantity) times the list price of its SKU, read in system.billing.list_prices.

The cost of a run is the sum of its rows, and the cost of a job the sum of the rows that carry its job_id. These are measures: no sharing rule comes in.

According to the documentation, both fields are filled for serverless jobs and jobs on job compute, not for a job launched on an all-purpose cluster.

The system tables to join

Five system tables, all read only:

System tableWhat it brings
system.billing.usageThe consumption, row by row, with usage_metadata.job_id and usage_metadata.job_run_id
system.billing.list_pricesThe list price of each SKU on each date; the effective_list key holds the price used to calculate cost
system.lakeflow.jobsThe name of each job, one row per change (change_time)
system.lakeflow.job_run_timelineThe outcome of each run (result_state), its trigger (trigger_type) and the task that launched it (source_task_run_id)
system.lakeflow.job_task_run_timelineThe task runs, which give the launching job

Step 1: the cost of each run

The price used is the one in force at the end of the usage row, as in the join example of the documentation. Over the last 30 days:

SELECT u.workspace_id,
       u.usage_metadata.job_id AS job_id,
       u.usage_metadata.job_run_id AS run_id,
       SUM(u.usage_quantity * p.pricing.effective_list.default) AS list_price_cost
FROM system.billing.usage AS u
JOIN system.billing.list_prices AS p
  ON u.cloud = p.cloud
 AND u.sku_name = p.sku_name
 AND u.usage_unit = p.usage_unit
 AND u.usage_end_time >= p.price_start_time
 AND (p.price_end_time IS NULL OR u.usage_end_time < p.price_end_time)
WHERE u.usage_date >= date_sub(current_date(), 30)
  AND u.usage_metadata.job_run_id IS NOT NULL
GROUP BY ALL

Without the run_id column, and with COUNT(DISTINCT u.usage_metadata.job_run_id), the same query gives the cost of each job and its number of billed runs.

Step 2: the name of the job

system.lakeflow.jobs adds a row each time a job changes (an SCD2 table): the current name is the one of the most recent row.

SELECT workspace_id, job_id, name,
       ROW_NUMBER() OVER (PARTITION BY workspace_id, job_id ORDER BY change_time DESC) AS rn
FROM system.lakeflow.jobs
QUALIFY rn = 1

Join on workspace_id and job_id: a job_id is unique only within its workspace, and the table covers every workspace of the region. The bill also carries usage_metadata.job_name, filled for serverless jobs and, since September 2025, on job compute. A job created in another region, or very recently, can be missing from system.lakeflow.jobs.

Step 3: the outcome of each run

A row of system.lakeflow.job_run_timeline covers one hour at most, and only the last slice of a run carries result_state. Group by run before any join, otherwise a long run counts its cost once per slice:

SELECT workspace_id, job_id, run_id,
       max_by(result_state, period_end_time) AS outcome,
       MIN(period_start_time) AS run_start,
       MAX(period_end_time) AS run_end
FROM system.lakeflow.job_run_timeline
WHERE period_start_time >= date_sub(current_date(), 31)
GROUP BY ALL

Join to step 1 on workspace_id, job_id and run_id. The window starts one day earlier: a run billed on the first day may have started the day before. The Databricks examples count the outcomes FAILED, ERROR and TIMED_OUT as failures.

Step 4: jobs launched by another job

A run launched by a "Run Job" task carries trigger_type = 'RUN_JOB_TASK'. Its source_task_run_id column points to the task that launched it, a row of system.lakeflow.job_task_run_timeline that gives the launching job:

WITH launched AS (
  SELECT DISTINCT r.workspace_id, t.job_id AS launcher_job, r.job_id, r.run_id
  FROM system.lakeflow.job_run_timeline AS r
  JOIN system.lakeflow.job_task_run_timeline AS t
    ON r.workspace_id = t.workspace_id
   AND r.source_task_run_id = t.run_id
  WHERE r.trigger_type = 'RUN_JOB_TASK'
    AND r.period_start_time >= date_sub(current_date(), 30)
    AND t.period_start_time >= date_sub(current_date(), 31)
    AND t.job_id <> r.job_id
)
SELECT workspace_id, launcher_job, job_id AS launched_job, COUNT(*) AS runs
FROM launched
GROUP BY ALL

Their cost comes from joining launched with step 1 on workspace_id, job_id and run_id. According to the documentation, source_task_run_id is not filled for rows emitted before early December 2025: no older run is linked to its launcher. This cost is already on the launched job's row: adding it to the launcher would count it twice.

The traps

What YALineo does

YALineo runs these joins in your browser, with your Databricks permissions, read only, with no YALineo server. It prices each row as in step 1, corrections added up. A row with no list price is counted apart, never estimated.

The "Jobs and compute" page gives for each job its cost, its cost per month, its DBUs, its runs, its average cost per run, its failures in number and amount, and its 7-day trend. Failures are the outcomes FAILED, ERROR and TIMED_OUT, tied to their cost by job_run_id. In the Databricks jobs list, a badge gives the cost of each job next to its name.

The "Jobs launched" column shows, next to a job's own cost, what the jobs it launches through "Run Job" tasks cost, and how many. That amount enters no total. A job that only launches other jobs is listed at 0, and its badge shows that cost after "↳". Only the direct launcher counts.

The name comes from system.lakeflow.jobs, before the bill's. Failing that, YALineo takes the name of the latest run and says so; otherwise the id shows, with the reason. A job on an interactive cluster stays in the cluster's row, and YALineo points this out below the job list.

The period is chosen in days or between two dates, against the period before. A discount you enter applies to every amount. The share of each run that goes to the tables it writes is explained in the guide to the cost of a table. The rules are in the method: workloads, launched jobs, names. Step by step: Jobs and compute, the period.

Frequently asked questions

Why does a job show 0?

It runs on an interactive cluster, it only launches other jobs, or its usage rows are not published yet. In YALineo, a zero cost carries a "Why?" link that gives the reason.

Is the cost of a launched job counted twice?

No. It is counted once, under its own job_id. The amount shown next to the launching job is a pointer and is added to no total.

Do failed runs cost anything?

Yes: what they consumed before stopping is billed. YALineo gives their number and amount, and the cost overview totals them over the period.

Sources

Documentation read on 6 November 2026.