Skip to main content 홈 크리에이터 comeonoliver skillshub databricks-webhooks-events
databricks-webhooks-events Configure Databricks job notifications, webhooks, and event handling.
Use when setting up Slack/Teams notifications, configuring alerts,
or integrating Databricks events with external systems.
Trigger with phrases like "databricks webhook", "databricks notifications",
"databricks alerts", "job failure notification", "databricks slack".
설치로 이동 Skills Marketplace 커뮤니티가 만든 AI 스킬을 발견하고 탐색하세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/ComeOnOliver/skillshub --skill databricks-webhooks-events명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Zip 다운로드 다운로드 중... 이 저장소의 다른 Skills Review product and feature risk before an AI coding agent starts implementation.
Use Xquik for X data and confirmation-gated X actions: tweet search, user lookup, follower export, media download, monitors, webhooks, MCP, and SDK workflows.
Canton Network open-source ecosystem guide covering DAML SDK, Canton runtime, and Splice applications. Use when working with Canton Network, DAML smart contracts, or building decentralized applications.
name databricks-webhooks-events description Configure Databricks job notifications, webhooks, and event handling.
Use when setting up Slack/Teams notifications, configuring alerts,
or integrating Databricks events with external systems.
Trigger with phrases like "databricks webhook", "databricks notifications",
"databricks alerts", "job failure notification", "databricks slack".
allowed-tools Read, Write, Edit, Bash(databricks:*) version 1.0.0 license MIT author Jeremy Longshore <jeremy@intentsolutions.io> compatible-with claude-code, codex, openclaw tags ["saas","databricks","webhooks"]
Databricks Webhooks & Events
Overview
Configure notifications and event-driven workflows for Databricks jobs. Covers notification destinations (Slack, Teams, PagerDuty, email, generic webhooks), job lifecycle events, SQL alerts with automated triggers, and system table queries for event auditing.
Prerequisites
Databricks workspace admin access (for notification destinations)
Webhook endpoint URL (Slack incoming webhook, Teams connector, etc.)
Job permissions for notification configuration
Instructions
Step 1: Create Notification Destinations
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.settings import (
CreateNotificationDestinationRequest,
SlackConfig, EmailConfig, GenericWebhookConfig,
)
w = WorkspaceClient()
slack = w.notification_destinations.create(
display_name="Engineering Slack" ,
config=SlackConfig(url="https://hooks.slack.com/services/T00/B00/xxxx" ),
)
email = w.notification_destinations.create(
display_name="Oncall Email" ,
config=EmailConfig(addresses=["oncall@company.com" , "data-team@company.com" ]),
)
pagerduty = w.notification_destinations.create(
display_name="PagerDuty" ,
config=GenericWebhookConfig(
url="https://events.pagerduty.com/integration/YOUR_KEY/enqueue" ,
),
)
print (f"Slack: {slack.id } , Email: {email.id } , PD: {pagerduty.id } " )
Step 2: Attach Notifications to Jobs
from databricks.sdk.service.jobs import (
JobEmailNotifications, WebhookNotifications, Webhook,
)
w.jobs.update(
job_id=123 ,
new_settings={
: JobEmailNotifications(
on_start=[ ],
on_success=[ ],
on_failure=[ , ],
no_alert_for_skipped_runs= ,
),
: WebhookNotifications(
on_start=[Webhook( =slack. )],
on_success=[Webhook( =slack. )],
on_failure=[Webhook( =slack. ), Webhook( =pagerduty. )],
),
},
)
"email_notifications"
"team@company.com"
"team@company.com"
"oncall@company.com"
"team@company.com"
True
"webhook_notifications"
id
id
id
id
id
id
id
id
Or declaratively in Asset Bundles:
resources:
jobs:
daily_etl:
email_notifications:
on_failure: ["oncall@company.com" ]
webhook_notifications:
on_failure:
- id: "<notification-destination-id>"
Step 3: Build Custom Webhook Handler Receive Databricks job events at your own endpoint.
from fastapi import FastAPI, Request
import httpx
app = FastAPI()
@app.post("/databricks/webhook" )
async def handle_event (request: Request ):
payload = await request.json()
event_type = payload.get("event_type" )
run_id = payload.get("run" , {}).get("run_id" )
job_name = payload.get("job" , {}).get("name" )
result = payload.get("run" , {}).get("result_state" )
error_msg = payload.get("run" , {}).get("state_message" , "" )
if result == "FAILED" :
await httpx.AsyncClient().post(
"https://events.pagerduty.com/v2/enqueue" ,
json={
"routing_key" : "YOUR_INTEGRATION_KEY" ,
"event_action" : "trigger" ,
"payload" : {
"summary" : f"Databricks job failed: {job_name} " ,
"severity" : "critical" ,
"source" : f"databricks-run-{run_id} " ,
"custom_details" : {"error" : error_msg, "run_id" : run_id},
},
},
)
return {"status" : "ok" }
Step 4: Monitor Events via System Tables Query system.access.audit for event monitoring without webhooks.
SELECT event_time, user_identity.email AS actor,
action_name, request_params.job_id, request_params.run_id,
response.status_code, response.error_message
FROM system.access.audit
WHERE service_name = 'jobs'
AND action_name IN ('runNow' , 'submitRun' , 'cancelRun' , 'repairRun' )
AND event_date >= current_date ()
AND event_time > current_timestamp () - INTERVAL 6 HOURS
ORDER BY event_time DESC ;
SELECT event_time, user_identity.email, action_name, request_params
FROM system.access.audit
WHERE action_name IN ('changeJobPermissions' , 'changeClusterPermissions' ,
'updatePermissions' , 'grantPermission' )
AND event_date >= current_date () - 7
ORDER BY event_time DESC ;
Step 5: SQL Alerts with Automated Triggers Create alerts that fire when query conditions are met.
SELECT COUNT (* ) AS failure_count,
COLLECT_LIST(DISTINCT job_name) AS failed_jobs
FROM (
SELECT j.name AS job_name
FROM system.lakeflow.job_run_timeline r
JOIN system.lakeflow.jobs j ON r.job_id = j.job_id
WHERE r.result_state = 'FAILED'
AND r.start_time > current_timestamp () - INTERVAL 1 HOUR
);
alert = w.alerts.create(
name="High Job Failure Rate" ,
query_id="<saved-query-id>" ,
options={"column" : "failure_count" , "op" : ">" , "value" : "3" },
rearm=900 ,
)
Step 6: Slack Message Formatter def format_slack_message (payload: dict ) -> dict :
"""Format Databricks job event as a rich Slack Block Kit message."""
run = payload.get("run" , {})
job = payload.get("job" , {})
status = run.get("result_state" , "UNKNOWN" )
emoji = {"SUCCESS" : ":white_check_mark:" , "FAILED" : ":x:" , "TIMED_OUT" : ":hourglass:" }.get(status, ":question:" )
duration_sec = run.get("execution_duration" , 0 ) // 1000
return {
"blocks" : [
{"type" : "header" , "text" : {"type" : "plain_text" , "text" : f"{emoji} {job.get('name' , 'Unknown' )} " }},
{"type" : "section" , "fields" : [
{"type" : "mrkdwn" , "text" : f"*Status:* {status} " },
{"type" : "mrkdwn" , "text" : f"*Run ID:* {run.get('run_id' )} " },
{"type" : "mrkdwn" , "text" : f"*Duration:* {duration_sec} s" },
{"type" : "mrkdwn" , "text" : f"*Error:* {run.get('state_message' , 'none' )[:200 ]} " },
]},
]
}
Output
Notification destinations registered (Slack, email, PagerDuty)
Job lifecycle notifications (on_start, on_success, on_failure)
Custom webhook handler for advanced routing
System table queries for event auditing
SQL alerts with automated triggers and destinations
Error Handling Error Cause Solution RESOURCE_DOES_NOT_EXIST for destinationDestination deleted or wrong workspace w.notification_destinations.list() to verifyWebhook not triggered URL unreachable from Databricks network Check firewall; Databricks needs outbound access to webhook URL Duplicate notifications Same destination on job AND task level Configure at job level only Alert never fires Query returns 0 rows or wrong column Test query in SQL Editor first System tables empty Unity Catalog not enabled Enable system tables in Account Console
Examples
List All Notification Destinations databricks notification-destinations list --output json | \
jq '.[] | {name: .display_name, type: .destination_type, id: .id}'
Resources
Next Steps For performance tuning, see databricks-performance-tuning.