When a Databricks job fails, how quickly you detect and respond to it determines your operational quality. Situations like "I came in this morning and all the overnight batches had failed" or "we noticed the incident hours late" are usually caused by inadequate notification setups.
This article covers the notification channels available in Databricks Jobs (Email/Slack/Teams/PagerDuty/Webhook), how to configure webhooks with implementation examples, an end-to-end automation flow from failure detection to ticket creation, and how to monitor job runs using System Tables.
Databricks Jobs lets you configure notifications for events such as job start, success, failure, timeout, and retry. Here is a comparison of the available notification channels.
| Notification Channel | Immediacy | Rich Formatting | Ease of Setup | Best Used For |
|---|---|---|---|---|
| Medium (depends on mail delivery timing) | Low (text-based) | High (email address only) | Individual notifications and audit records | |
| Slack (via webhook) | High (instant push) | High (Block Kit supported) | Medium (requires obtaining a webhook URL) | Instant team-wide notifications |
| Microsoft Teams (via webhook) | High (instant push) | Medium (Adaptive Cards supported) | Medium (requires Incoming Webhook setup) | Team notifications in Microsoft environments |
| PagerDuty | Highest (alerts plus escalation) | High (full details in PagerDuty UI) | Medium (requires Integration Key setup) | On-call response for production incidents |
| Generic Webhook | High (instant POST) | Depends on customization | Low (receiver-side implementation required) | Automatic ticket creation and custom flows |
In practice, it is common to combine multiple channels. For example, you might configure "successes go to email (for records)" and "failures go to Slack + PagerDuty (for immediate response)".
Job notifications can be configured individually for each of the following events.
| Event | Trigger Timing | Recipients to Notify |
|---|---|---|
| on_start | When a job run starts | Confirming start of long-running jobs |
| on_success | When a job completes successfully | Records and triggers for downstream processing |
| on_failure | When a job fails | Operations team and on-call engineers |
| on_duration_warning_threshold_exceeded | When run duration exceeds the threshold | Stuck-job detection and performance monitoring |
| on_streaming_backlog_exceeded | When streaming backlog exceeds the threshold | Streaming pipeline monitoring |
Job notification settings can be made via the UI, REST API, or DABs YAML. Here is an example using the REST API.
# ジョブ作成時に通知を設定
curl -X POST \
"https://<workspace-url>/api/2.1/jobs/create" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "nightly_etl_pipeline",
"tasks": [...],
"email_notifications": {
"on_start": [],
"on_success": ["[email protected]"],
"on_failure": ["[email protected]", "[email protected]"],
"no_alert_for_skipped_runs": true
},
"webhook_notifications": {
"on_failure": [
{
"id": "<notification-destination-id>"
}
]
},
"notification_settings": {
"no_alert_for_skipped_runs": true,
"no_alert_for_canceled_runs": false
}
}'Notifications to Webhook, Slack, Microsoft Teams, and PagerDuty work by pre-registering them as Notification Destinations and referencing them from the job by ID.
# Slack Notification Destinationの作成
curl -X POST \
"https://<workspace-url>/api/2.0/notification-destinations" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"display_name": "Data Platform Slack Channel",
"config": {
"slack": {
"url": "https://hooks.slack.com/services/T00000000/B00000000/XXXX"
}
}
}'
# PagerDuty Notification Destinationの作成
curl -X POST \
"https://<workspace-url>/api/2.0/notification-destinations" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"display_name": "Data Platform PagerDuty",
"config": {
"pagerduty": {
"integration_key": "xxxx-xxxx-xxxx-xxxx"
}
}
}'To notify systems other than Slack/Teams/PagerDuty, use a generic webhook. Databricks sends a POST request and the receiver processes the payload to perform any action you define.
# 汎用Webhook Notification Destinationの作成
curl -X POST \
"https://<workspace-url>/api/2.0/notification-destinations" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"display_name": "Custom Ticket System Webhook",
"config": {
"generic_webhook": {
"url": "https://automation.example.com/databricks-webhook",
"username": "databricks",
"password": "secure-password"
}
}
}'The webhook payload includes information such as the job ID, job name, run ID, run status, and start/end times. The receiver can parse this information to create tickets, update dashboards, trigger downstream jobs, and more.
Here is the ideal automation flow when a production ETL job fails.
With this setup, a ticket is created and the on-call engineer is alerted within seconds of a job failure. Manual incident detection is eliminated entirely, so overnight batch failures can be addressed immediately.
Databricks System Tables store job run history and audit logs as Delta tables. Combined with webhook notifications, they enable more sophisticated monitoring and analysis.
-- 過去7日間で失敗したジョブの一覧
SELECT
job_id,
run_id,
result_state,
start_time,
end_time,
TIMESTAMPDIFF(MINUTE, start_time, end_time) AS duration_minutes
FROM system.lakeflow.job_run_timeline
WHERE result_state = 'FAILED'
AND start_time > CURRENT_TIMESTAMP() - INTERVAL 7 DAYS
ORDER BY start_time DESC-- ジョブごとの失敗率(過去30日)
SELECT
job_id,
COUNT(*) AS total_runs,
SUM(CASE WHEN result_state = 'FAILED' THEN 1 ELSE 0 END) AS failed_runs,
ROUND(
SUM(CASE WHEN result_state = 'FAILED' THEN 1 ELSE 0 END) * 100.0 / COUNT(*),
1
) AS failure_rate_pct
FROM system.lakeflow.job_run_timeline
WHERE start_time > CURRENT_TIMESTAMP() - INTERVAL 30 DAYS
GROUP BY job_id
HAVING failed_runs > 0
ORDER BY failure_rate_pct DESC-- 実行時間の異常検知(平均の2倍以上かかったジョブ)
WITH stats AS (
SELECT
job_id,
AVG(TIMESTAMPDIFF(MINUTE, start_time, end_time)) AS avg_duration,
STDDEV(TIMESTAMPDIFF(MINUTE, start_time, end_time)) AS stddev_duration
FROM system.lakeflow.job_run_timeline
WHERE result_state = 'SUCCESS'
AND start_time > CURRENT_TIMESTAMP() - INTERVAL 30 DAYS
GROUP BY job_id
)
SELECT
t.job_id,
t.run_id,
TIMESTAMPDIFF(MINUTE, t.start_time, t.end_time) AS duration_minutes,
s.avg_duration AS avg_minutes,
s.avg_duration + 2 * s.stddev_duration AS threshold_minutes
FROM system.lakeflow.job_run_timeline t
JOIN stats s ON t.job_id = s.job_id
WHERE t.start_time > CURRENT_TIMESTAMP() - INTERVAL 7 DAYS
AND TIMESTAMPDIFF(MINUTE, t.start_time, t.end_time) > s.avg_duration + 2 * s.stddev_duration
ORDER BY t.start_time DESCBy combining System Tables queries with Databricks SQL Alerts, you can build proactive monitoring such as "notify when the failure rate exceeds a threshold" or "detect jobs whose runtime is abnormally long".
When you define jobs with Databricks Asset Bundles (DABs), you can declaratively specify notification settings inside the YAML.
# databricks.yml
resources:
jobs:
nightly_etl:
name: "nightly_etl_pipeline"
email_notifications:
on_failure:
- "[email protected]"
on_success:
- "[email protected]"
webhook_notifications:
on_failure:
- id: "${var.slack_notification_destination_id}"
notification_settings:
no_alert_for_skipped_runs: true
tasks:
- task_key: "ingest"
notebook_task:
notebook_path: "./notebooks/ingest.py"When managed through DABs, notification settings become subject to code review and version control, making it possible to track "who changed the notification settings and when".
Workflow Management
問題 1
You operate production overnight ETL batches (50+ jobs). When a job fails, you want to (1) instantly notify a Slack channel, (2) automatically create a Jira ticket, and (3) immediately escalate severe incidents to an on-call engineer via PagerDuty. Which is the most appropriate configuration?
正解: A
The standard pattern is to register Slack and PagerDuty as Notification Destinations and reference them from the job's notification settings. Jira integration is not a built-in Databricks feature, so it's handled via generic webhook → relay service → Jira API. Email forwarding suffers from delivery delays and formatting issues, making it unsuitable for instant notifications. System Tables polling requires manual intervention and lacks real-time responsiveness. Notebook-level try-except requires implementation in every notebook (high maintenance burden) and can miss task-level failures entirely.
How do I configure Slack notifications for Databricks jobs?
There are two approaches. (1) Register a Slack channel email address (obtained via Slack's "send to channel by email" feature) in the job's Email Notifications. This is no-code but produces email-formatted notifications. (2) Configure a Slack Incoming Webhook URL in the job's webhook notifications. This sends rich notifications using Slack message formats like Block Kit. Both can be configured via the job definition UI, REST API, or DABs YAML.
Can I automatically create a Jira ticket when a job fails?
Databricks does not offer direct Jira integration in its job notifications, but you can achieve this by relaying webhook notifications. A common pattern is to send the on-failure webhook to a generic webhook receiver (Zapier, n8n, Azure Logic Apps, AWS Lambda, etc.) and have it call the Jira REST API to create the ticket. The webhook payload includes the job ID, run ID, and failure status, so you can automatically populate the ticket fields.
How are webhook notifications tested on the Databricks certification exam?
It appears in the "Workflow Management and Operations" domain of the Data Engineer Professional exam. Common question patterns include configuring on-failure notifications, choosing between multiple notification channels, and monitoring job runs via System Tables. Questions rarely require writing specific webhook JSON; instead, they test your understanding of notification strategy design (what to notify, who to notify, and when).
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Databricks Certifications: All 7 Exams, Difficulty & Study Plan (2026)
Complete guide to all 7 Databricks certifications — Data Eng...
Databricks Exam Difficulty Ranking: All 7 Certs Compared (2026)
Every Databricks certification ranked by difficulty, with st...
Databricks Study Guide: Fastest Pass Route & Time Estimates (2026)
How to pass Databricks certifications efficiently. Official ...
Databricks Data Engineer Associate: Complete Guide (2026)
Domain-by-domain breakdown of the Databricks Certified Data ...
Databricks Data Engineer Professional: Complete Guide (2026)
Tactics for the Databricks Certified Data Engineer Professio...