- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2026 09:13 AM
My task is to make alert notification for prod target to pagerduty and e-mail, rest targets e-mail only.
It is very easy for job or pipeline. In target you may define something like:
databricks.yml
targets:
prod:
resources:
jobs:
main:
webhook_notifications:
on_failure:
- id: "${var.pagerduty_notification_id}"But same approach does not work for alert. Alert requires 5 more fields like name etc despite they already defined in another "resources/some_file.alert.yml"
Using empty string raises error "Expected UUID, found".
Is there any way to do that ?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2026 09:46 AM - edited 06-13-2026 09:48 AM
You can follow the same approach of using swapping out the subscriptions (alert subscriptions) based on the target for the alerts. You can follow below & change the alert subscriptions based on targets
Target Prod
alert_subscriptions:
- user_email: 'rvm@mosr.com'
- pager_destination_id: 'a18db8fa-36ed-46d9-a085-6c3517daf232'
Target Rest
alert_subscriptions:
- user_email: 'rvm@mosr.com'You can setup the alert as below. It stays completely target agnostic as it references the alert_subscriptions setup earlier
resources:
alerts:
aalerts:
display_name: aalerts
evaluation:
comparison_operator: EQUAL
source:
name: '1'
threshold:
value:
double_value: 2
notification:
notify_on_ok: false
subscriptions: ${var.alert_subscriptions}
query_text: select 2
schedule:
quartz_cron_schedule: '44 19 */1 * * ?'
timezone_id: Europe/Amsterdam
warehouse_id: 460a05edYou can use below to find UUID
w = WorkspaceClient()
destinations = w.notification_destinations.list()
for dest in destinations:
print(dest)Ensure the alert file containing alerts details is included under include in the yml. Ensure the UUID is sent for the pager duty as above to avoid the error "Expected UUID, found"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2026 03:32 AM
@balajij8 Thanks for the solution. Tested it and it's working. Totally forgot that variable can be list.