Using System Notifications with Webhooks
Databricks has added the functionality of adding WebHook on certain events of a Job. This functionality is really useful for monitoring the status of the different workloads that you can ran in Databricks.
In this guide you’ll learn how to setup one, and take a look at the different messages that you can receive.
Setup
To setup a notificatoin through a webhook in Databricks, first you need to create a new “system notification”. You can get there in different ways:
- From a job:
In the right panel, click in “Edit system notifications”
From the drop-down select “Create new Destination”. This will take you to the admin console.
- From the admin console: just click in Notifications destinations
From this menu, you'll be able to create a new Destination for your alert.
Select Webhook, fill the form and click on create.
The destination will now be available in the drop-down of the job.
When you select it, you will also be able to select what events you want to send.
Webhook events
Depending on the events that you have selected, you will receive the following messages:
- On Job Start
{
"event_type": "jobs.on_start",
"workspace_id": 123,
"run": {
"run_id": 1
},
"job": {
"job_id": 1,
"name": "job_name"
}
}
- On Job Success
{
"event_type": "jobs.on_success",
"workspace_id": 123,
"run": {
"run_id": 1
},
"job": {
"job_id": 1,
"name": "job_name"
}
}
- On Job Failure
{
"event_type": "jobs.on_failure",
"workspace_id": 123,
"run": {
"run_id": 1
},
"job": {
"job_id": 1,
"name": "job_name"
}
}
As you can imagine, this could be extremely helpful if you're designing an event based system, or you simply want to integrate this events with your existing infrastructure.
If you want to learn how you can write your own Webhook to listen for these events take a look at this other guides!