What you will be able to do
- Send alert notifications to users and to admin-configured destinations such as Slack, Microsoft Teams or webhooks
- Explain who can create a notification destination and how a Slack webhook destination is set up
- Configure Notify on OK and a repeating notification frequency
- Customize the notification subject and body with template variables in the standard or Markdown editor
1.Users and notification destinations
A threshold that nobody hears about is not much use, so the Notifications section of the alert editor sets who is told. An alert can notify individual users, found by searching for their username, or notification destinations, which are shared channels such as a Slack channel or a webhook endpoint. Users receive alerts by email.
Only a workspace admin can create a destination, and once it exists every user can pick it. Analysts therefore cannot add a Slack channel themselves. If the channel is missing from the list, an admin has to add it under Settings → Notifications → Manage → +Add destination, choose a type, configure it and click Create. After that it appears for every alert author in the workspace. The admin can check the setup from the destination's three-dot menu with Test, which sends a sample notification.
| Destination type | Setup notes |
|---|---|
| The default; notifications go to user email addresses unless another destination is configured | |
| Slack | Generate an incoming webhook URL in Slack and paste it into the destination, or use the Databricks Genie app (Beta) |
| Microsoft Teams | Can be connected through the Databricks Genie app (Beta), which supports SQL alerts |
| Webhook | HTTPS endpoint with a certificate from a trusted certificate authority; optional OAuth authentication (Beta) |
| PagerDuty | Selected as a destination type when adding a destination |
Slack can be connected in two ways. The webhook route requires nothing beyond an incoming webhook URL from Slack. The Genie app route is in Beta. An admin must enable it on the Previews page, install the app and add it to the target channel before that channel can be selected. Webhook destinations have network requirements too. Databricks only sends over HTTPS, and the receiving endpoint must allowlist the workspace's control plane and data plane outbound IP addresses. If that allowlist is missing, the endpoint rejects the notifications.
Checkpoint 1 of 5· Check yourself
An analyst is building an alert and wants it to post to the team's Slack channel. The channel does not appear when they search in the alert's Notifications section. What has to happen before the analyst can pick it?
Only a workspace admin can create notification destinations. Once an admin has set up the Slack destination, for example with an incoming webhook URL, every user can select it in their alerts. Analysts can't add a channel themselves through the alert, warehouse permissions or the template.
“You must be a Databricks workspace admin to manage notification destinations. After a destination is configured, it is available to all users.”Source: docs.databricks.com
Checkpoint 2 of 5· Exam question
An analyst is setting up a Databricks SQL alert and wants failures to post directly into a team's Slack channel, but no Slack destination currently appears in the alert's Destination drop-down menu for the workspace. What must happen before the analyst can select a Slack option for this alert?
Correct answer: A — A workspace admin must create a new Slack system destination using an incoming webhook URL, after which it becomes available for any user to select from the Destination drop-down for their alerts.
- A. Notification destinations are workspace-level objects that only an admin can add; once a Slack destination backed by an incoming webhook exists, it appears in the Destination drop-down for any alert.
- B. The condition threshold field is used for the operator and numeric threshold value, not for routing configuration, so pasting a URL there does nothing to register a Slack destination.
- C. SQL warehouse permissions control who can run queries on that compute resource; they have no relationship to which notification destinations are registered for a workspace's alerts.
- D. Databricks does not require vendor-side approval of a Slack workspace domain to send alert notifications; destinations are configured locally by a workspace admin, not through Databricks support.
Sources1
2.When notifications are sent
By default, a notification goes out when the alert triggers. In the tutorial alert, a Test condition result of OK means no notification is sent. Two settings change this. Notify on OK in Advanced settings sends a second message when the alert returns to OK. This tells the on-call channel the problem has cleared, so nobody has to open the alert page to check. Notification frequency in the Notifications section sends the triggered message again at an interval until the alert returns to OK.
Choose based on how the alert will be used. A repeat frequency suits a condition someone has to act on, such as a failing data quality check, because it keeps sending until someone fixes it. For a noisy metric that recovers on its own, a single trigger plus Notify on OK gives a clear start and end without a flood of repeats. In the webhook payload and in bundle configuration, these settings appear together in a notification object holding notify_on_ok and the retrigger interval.
Checkpoint 3 of 5· Check yourself
A data quality alert fires when a table has rows with null customer IDs. The team wants the on-call channel to keep getting reminders until someone fixes the data. Which setting does this?
Notification frequency sends the triggered message again at an interval until the alert returns to OK, which suits a problem someone has to fix. Notify on OK sends one message when the alert recovers. Empty result state only covers queries that return no rows, and the template only formats the message.
“Optionally, set a notification frequency to repeat notifications until the alert returns to OK.”Source: docs.databricks.com
3.Customizing the notification template
Notifications use a default template unless you choose Customize template in Advanced settings. There are two editors. In the standard editor, you write variables as {{VARIABLE_NAME}} in the subject and body, for example Alert "{{ALERT_NAME}}" changed status to {{ALERT_STATUS}}., and you can use a fixed list of HTML tags. The Markdown editor has a formatting toolbar. There you write variables as @VARIABLE_NAME, and typing @ opens a variable picker.
| Variable | Contains | Markdown editor |
|---|---|---|
| ALERT_NAME | The alert name | Yes |
| ALERT_STATUS | The evaluated alert status | Yes |
| ALERT_CONDITION | The alert condition operator | Yes |
| ALERT_THRESHOLD | The alert threshold | Yes |
| ALERT_COLUMN | The alert column name | Yes |
| ALERT_URL | The alert page URL | Yes |
| QUERY_RESULT_TABLE | The query result HTML table, first 100 rows | Yes |
| QUERY_RESULT_VALUE | The query result value | No |
| QUERY_RESULT_ROWS | The query result rows | No |
| QUERY_RESULT_COLS | The query result columns | No |
How the message renders depends on the destination. HTML is rendered only by email destinations. A carefully built <table> will look fine in an inbox and arrive differently in Slack or at a webhook. Preview confirms that the variables are filled in. It does not show what a given destination will actually display.
Aggregation also limits what the template can show. When the alert sums or averages a column, the query that actually runs is the wrapping aggregate. QUERY_RESULT_ROWS and QUERY_RESULT_COLS then hold only that final result, not the per-store breakdown. If recipients need the detail rows, compute the total inside the query and check it with the first-value setting. That way the original rows remain the result the template sees.
Checkpoint 4 of 5· Check yourself
A custom template in the standard editor builds an HTML table from {{ALERT_COLUMN}} and {{ALERT_THRESHOLD}}. Preview shows the variables filled in. The alert sends to one email user, a Slack destination and a webhook destination. What will the recipients see?
Only email destinations render HTML, so the table appears only in the inbox. Preview only confirms that the variables are filled in. It does not show how a given destination will display the notification.
“The standard editor also supports HTML for formatting. Only email notification destinations can render HTML.”Source: docs.databricks.com
4.What a webhook destination receives
When an alert changes state, a webhook destination receives a JSON body. The service that sends a notification defines its payload, so the SQL alert payload is different from the payloads jobs send. The fields mirror the condition set in the editor, which is why the payload is useful for routing logic on the receiving side.
| Field | Meaning |
|---|---|
| comparison_operator | The operator, such as GREATER_THAN, EQUAL, or IS_NULL |
| threshold | The value or query result column the source is compared against |
| empty_result_state | State used when the query returns no rows; omitted if not defined |
| notification | Retrigger interval, notify-on-OK setting, and destination IDs |
| state | The state that caused the notification: TRIGGERED, OK, or ERROR |
| last_triggered_at | Last triggered time in epoch milliseconds; omitted if never triggered |
Treat the receiving endpoint as sensitive. The payload can include the alert's SQL query, the owner's identity and any custom notification text. Anyone who can read stored payloads learns all of that, so restrict access to the endpoint and to its logs.
Checkpoint 5 of 5· Match them up
Match each field of the SQL alert webhook payload to the alert setting or outcome it carries, so a receiving service can route on it.
Tap a term, then the definition that fits it.
The payload fields mirror what was set in the alert editor. The Condition settings map to comparison_operator and threshold, Advanced settings to empty_result_state, and the Notifications settings to the notification object. state reports which evaluation result sent the message.
“The retrigger interval, notify-on-OK setting, and notification destination IDs.”Source: docs.databricks.com
Practise it for real
Create an alert on the sample NYC taxi data that triggers when the summed fare amount exceeds 4000 and notifies you every 5 minutes
1.Click Alerts in the sidebar, click Create Alert, paste a query over
samples.nyctaxi.tripsthat groups SUM(fare_amount) AS amount by pickup date, and run it.Why: The alert owns its query, so you write it in the alert editor.
You should see: One row per date with an amount column, newest date first.
2.In the compute selector, pick a SQL warehouse.
Why: The selected warehouse runs the alert query on every evaluation.
You should see: The status indicator shows whether the warehouse is running.
3.In Condition, choose Sum as the data value, amount as the column, > as the operator, and Static value 4000 as the threshold.
Why: Sum aggregates all rows of amount, so the comparison uses the total rather than the newest day only.
You should see: The condition reads as the sum of amount greater than 4000.
4.Click Test condition.
Why: It checks whether the alert would trigger on the current data before you save it.
You should see: The test shows the alert as triggered.
5.In Notifications, search for and select your username. Then open Edit schedule, set Every 5 minutes from 0 minutes past the hour, save, and click View alert.
Why: This sets who is notified and how often the alert is evaluated.
You should see: The alert page opens with an evaluation history, and because the sample data is static, you get an email notification on each run.
Stuck? Get a nudge
Change the aggregation from Sum to the first value and test again. This shows that only the top row is compared when no aggregation is set.
Sources
(4)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“You must be a Databricks workspace admin to manage notification destinations. After a destination is configured, it is available to all users.”
↩︎ Users and notification destinations“Paste the generated URL into your Databricks notification destination.”
↩︎ Users and notification destinations“Databricks enforces the use of HTTPS for security.”
↩︎ Users and notification destinations“The service that sends a notification defines the webhook payload.”
↩︎ What a webhook destination receives“You must be a Databricks workspace admin to manage notification destinations. After a destination is configured, it is available to all users.”
↩︎ Exam trap 1 - 2.
“Notify on OK: Send a notification when the alert returns as OK.”
↩︎ When notifications are sent“Optionally, set a notification frequency to repeat notifications until the alert returns to OK.”
↩︎ When notifications are sent“In the standard editor, reference variables in the subject and body with {{VARIABLE_NAME}}.”
↩︎ Customizing the notification template“In the Markdown editor, reference variables with @VARIABLE_NAME.”
↩︎ Customizing the notification template“Only email notification destinations can render HTML.”
↩︎ Exam trap 2“The standard editor also supports HTML for formatting. Only email notification destinations can render HTML.”
↩︎ Checkpoint - 3.
“The retrigger interval, notify-on-OK setting, and notification destination IDs.”
↩︎ When notifications are sent“The payload can contain sensitive workspace metadata, including the SQL query, the alert owner's identity, and custom notification content.”
↩︎ What a webhook destination receives“The retrigger interval, notify-on-OK setting, and notification destination IDs.”
↩︎ Checkpoint - 4.
“those variables will only display the final, post-aggregation query result.”
↩︎ Customizing the notification template