Monitoring with the API, CLI, SDK, and SQL alerts
Databricks Data Engineer Professional · Lesson 13 of 21 · 1:45:30
YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗
Learning with these videos? Subscribe for new courses and exam-style questions.
Subscribe on YouTube (opens in a new tab)In this lesson
Prepare for the Databricks Certified Data Engineer Professional exam. In this lesson: monitoring with the REST API, the Databricks CLI, and the Databricks SDK, SQL alerts, and the Jobs UI with its matrix view. Includes three original practice questions.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
Watching by hand
Every morning, an engineer at Quayside Eats opens each job to check last night's runs, and copies the failures into a report. Operations also wants an email when late deliveries climb, and the team wants to see at a glance which task of a long job fails most often. This lesson covers the REST API, the CLI, and the SDK for monitoring, SQL alerts, and the Jobs UI.
API, CLI, and SDK
The Jobs REST API lists the runs of a job with runs list, describes one run with runs get, and returns the output of a notebook task with runs get output. The Databricks CLI wraps the same calls: jobs list-runs, with a job ID and filters, and get-run, for the details of one run. The Python SDK, with a WorkspaceClient, offers the jobs list_runs method, and returns typed objects that are easy to filter in a script. The SDK is in beta, but supported for production use, so pin its version in your requirements. And pipelines have their own API, with updates and events, so a script can follow them the same way.
SQL alerts
Databricks SQL alerts run a query on a schedule, evaluate a condition on its result, and send a notification when the condition is met, with a history of past evaluations. An alert can watch a business metric from a Unity Catalog metric view, a cost trend from system tables, or a data quality result. Paired with anomaly detection, which checks the freshness and completeness of the tables in a schema, alerts warn the team when a table goes stale or shrinks. As a task in a Lakeflow job, an alert checks its condition during the run, and downstream tasks can branch on the result. So alerts turn any query into a watch that runs by itself.
The Jobs UI
In the Jobs UI, the Runs tab of a job has a matrix view, which shows the history of its runs, including each task. Each cell shows the status of a task by its color, like green for success and red for failure, and the height of the bars shows the duration. A run that takes longer than the expected completion time shows a warning, and a duration threshold on a task triggers an event when it is exceeded. Opening a run shows its tasks as a graph, a timeline, or a list that can be sorted by duration. And job notifications send an email, or a message to another destination, when a run fails or runs too long.
Recap
Let's recap. The Jobs REST API, the CLI, and the Python SDK list and describe runs, with list-runs in the CLI and list_runs in the SDK. Pin the SDK version, since it is in beta, and use the Pipelines API for updates and events. SQL alerts run a query on a schedule, check a condition, and notify, on metric views, system tables, or data quality. As a task in a job, an alert lets downstream tasks branch on its result. And the matrix view of the Runs tab shows each task across runs, with its status and duration.
Quick checks for this lesson
The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.
A shell script must list the runs of the nightly job from the last day, from a terminal, without writing HTTP calls by hand. Which command fits?
- databricks jobs get
- databricks jobs run-now
- databricks jobs list-runs
- databricks jobs reset
Show the answer
databricks jobs list-runs
Jobs list-runs returns the runs of a job, and the script can filter them. “databricks jobs get” would return the settings of the job, not its runs. “databricks jobs run-now” would start a new run. And “databricks jobs reset” would overwrite all the settings of the job.
Operations wants an email when the share of late deliveries, defined in a governed metric view, goes above 10%, checked every hour. What should the data engineer create?
- A SQL alert on a query of the metric view
- An expect_or_fail rule in the gold pipeline
- A dashboard refreshed every hour
- A For each task over the deliveries
Show the answer
A SQL alert on a query of the metric view
A SQL alert runs a query of the metric view every hour, and emails operations when the condition is met. “An expect_or_fail rule in the gold pipeline” would stop the pipeline, and would not send an email to operations. “A dashboard refreshed every hour” would show the figure, but nobody would be told when it crosses the limit. And “A For each task over the deliveries” would loop over items, and has no condition or notification.
A job has twelve tasks, and the team wants to see at a glance which task failed most often over the recent runs. Where should it look?
- The query profile of a SQL warehouse
- system.billing.usage
- The event log of a pipeline
- The matrix view of the job’s Runs tab
Show the answer
The matrix view of the job’s Runs tab
The matrix view shows each task across the recent runs, colored by status, so a task that fails often stands out. “The query profile of a SQL warehouse” describes one query on a SQL warehouse, not the tasks of a job. “system.billing.usage” holds consumption and cost. And “The event log of a pipeline” belongs to Lakeflow pipelines, not to the tasks of a job.