Skip to main content
Metrics type: Supporting MetricsCategory: Jobs & Workflows

At a glance

The count of Databricks jobs currently running past their expected duration, where “long” is defined as still in RUNNING state for more than one hour. For a platform team this is the single clearest early-warning sign of a cost-runaway: a job stuck in a retry loop, blocked on a lock, scanning far more data than usual, or spinning up an over-sized cluster that never finishes. A long-running job burns DBU every minute it stays alive, so this card is as much a budget control as an operational one. The headline shows how many runs are over the threshold right now; the drill-down lists each one with its elapsed time and cluster.

Calculation

For every job run currently reported by the Jobs API as RUNNING (or PENDING that has since started), Vortex IQ computes elapsed time as:
The raw count of runs where long_running is true is the technical value. The card then applies an expectation filter so the headline reflects unexpected long runs only. Each job can carry an expected-duration baseline, taken from the trailing median of its own recent successful runs (or an explicit override set in the connector). A run that exceeds one hour but is still inside its own historical norm (for example, a nightly model-training job that always takes 90 minutes) is counted as expected and excluded from the alerting headline, though it remains visible in the drill-down. This two-layer design matters: a flat “over 1h” count would constantly flag legitimate heavy jobs and train the team to ignore the card. By comparing each run to its own baseline, the alert fires only when a job is behaving abnormally for itself, which is the genuine cost-runaway signal.

Worked example

A platform team runs roughly 140 scheduled jobs against an ecommerce lakehouse. Most finish inside 20 minutes; a handful of back-fills run an hour or more by design. Snapshot taken on 22 Apr 26 at 14:10 UTC. The raw “over 1h” count is 3, but the headline shows 1 unexpected long-running job: silver-orders-merge, normally a 12-minute incremental merge, has been running for 142 minutes. The platform engineer drills in.
The root cause turns out to be a MERGE whose source side lost its partition pruning after a schema change, so it now full-scans a 4 TB target instead of touching one day’s partition. The engineer’s decisions, in order:
  1. Cancel the run. A 21x overspend with no end in sight is not worth waiting out. Cancelling stops the DBU bleed immediately; the merge is idempotent and can re-run once fixed.
  2. Fix the predicate, not the timeout. Lengthening the job timeout would only let the runaway burn longer. The real fix is restoring the partition filter in the MERGE ... ON clause.
  3. Set an explicit max-duration guard. Adding a timeout of, say, 30 minutes to this specific job means a future regression self-cancels at roughly 2.5x normal rather than running to the 4-hour ceiling.
Two things to remember:
  1. The expected-duration filter is what makes this card usable. Without it, the two genuinely-long jobs would have hidden the one runaway in plain sight. Always read the “unexpected” headline, then use the drill-down for the full picture.
  2. A long run and a cost spike are the same event seen from two angles. The same incident will lift DBU Burned (24h) and, if it recurs across the week, Avg DBU per Job Run. Treat this card as the live trigger and those as the trend.

Sibling cards

Reconciling against the source

Where to look in Databricks:
Open Workflows → Jobs → Job runs and sort by Start time ascending; the active runs at the top are the longest-lived. Each run shows elapsed time and the cluster. Run SELECT * FROM system.lakeflow.job_run_timeline WHERE result_state IS NULL (where the system schema is enabled) for an account-wide list of in-flight runs. For a single run, the Spark UI and the cluster’s Metrics tab show whether the run is CPU-busy or stalled. The Jobs CLI / REST runs/list --active-only returns the same active set programmatically.
Why our number may legitimately differ from the Databricks UI: Cross-connector reconciliation:

Known limitations / FAQs

My nightly training job always runs over an hour. Will it alert every night? No. The expected-duration filter compares each run to its own trailing median. A job that habitually runs 90 minutes is counted as expected and stays out of the alerting headline. It still appears in the drill-down so you have full visibility, but it will not page you. If you want to suppress it entirely, add it to the connector’s long-job allow-list. Does this card cover continuous (streaming) jobs? No. Structured-streaming jobs and other continuously-running workloads are designed never to finish, so a “running over 1h” rule would always trip. They are excluded from this card. Monitor streaming health through pipeline lag and cluster utilisation instead. Why one hour as the threshold and not the job’s own baseline alone? One hour is the floor below which the card does not even consider a run “long”, to avoid noise from the many short jobs. Above that floor, the per-job baseline decides whether it is unexpected. So a 12-minute job that runs 70 minutes is flagged; a 5-minute job that runs 8 minutes is not, even though it tripled. A run shows high elapsed time but low CPU. Is it a cost-runaway? It is still costing DBU, but the cause is different. Low CPU on a long run usually means the job is blocked: waiting on a table lock, a slow external source, a MERGE serialising on concurrent writers, or an under-provisioned upstream API. Cancelling stops the spend, but the fix is to remove the contention, not to add compute. Pair with Avg Cluster CPU Utilisation %. Should I just set a global job timeout and stop watching this card? A per-job timeout is a good safety net and we recommend it, but it is a blunt instrument. A timeout only fires at the ceiling, by which point significant DBU is already spent, and it gives no early signal that a job is drifting. This card flags the drift while it is happening, so you can intervene before the timeout (and the bill) is reached. Can a long run be a sign of an under-sized cluster rather than a fault? Yes. If a job’s input has grown steadily and its runtime has crept up with it, the run is not stuck, it is simply doing more work on too little compute. The tell is high, sustained CPU and a runtime that scales with input volume rather than spiking suddenly. The fix there is right-sizing or autoscaling the cluster, not cancelling. Does cancelling a long run risk data corruption? For Delta writes, no: Delta operations are atomic, so a cancelled MERGE or INSERT either committed or it did not, with no partial state. Non-Delta side effects (external API calls, writes to other systems) are the exception and depend on the job’s own idempotency. Confirm the job is safe to re-run before cancelling, which well-built ETL almost always is.

Tracked live in Vortex IQ Nerve Centre

Long-Running Jobs (>1h) is one of hundreds of KPI pulses Vortex IQ tracks across Databricks and 70+ other ecommerce connectors. Nerve Centre runs the detection layer; Vortex Mind investigates the cause when something moves; Ask Viq lets you interrogate any number in plain English. Start for free or book a demo to see this metric running on your own data.