From c40ccf2613eac5521ceee6ede32e1a5f7a3f5a06 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Mon, 19 Jan 2026 13:35:52 +0100 Subject: [PATCH 1/7] Add example for refering to a file in alerts --- knowledge_base/alerts/databricks.yml | 12 ++++--- .../nyc_taxi_daily_revenue.alert.yml | 12 +++++++ ...yc_taxi_daily_revenue_as_file.dbalert.json | 35 +++++++++++++++++++ 3 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 knowledge_base/alerts/resources/nyc_taxi_daily_revenue_as_file.dbalert.json diff --git a/knowledge_base/alerts/databricks.yml b/knowledge_base/alerts/databricks.yml index d055bf1..5bbddd4 100644 --- a/knowledge_base/alerts/databricks.yml +++ b/knowledge_base/alerts/databricks.yml @@ -7,12 +7,14 @@ include: variables: # The "warehouse_id" variable is used to reference the warehouse used by the alert. warehouse_id: - lookup: - # Replace this with the name of your SQL warehouse. - warehouse: "Shared Unity Catalog Severless" + default: 49efc47d56d40c50 + # lookup: + # # Replace this with the name of your SQL warehouse. + # warehouse: "Shared Unity Catalog Severless" + +# workspace: + # host: https://myworkspace.databricks.com -workspace: - host: https://myworkspace.databricks.com targets: diff --git a/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml b/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml index 64c119b..5f14750 100644 --- a/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml +++ b/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml @@ -48,3 +48,15 @@ resources: pause_status: "UNPAUSED" quartz_cron_schedule: "0 0 8 * * ?" # Run daily at 8 AM UTC timezone_id: "UTC" + + # This is the same alert as above, but refers to a .dbalert.json file + # for the configuration. + nyc_taxi_daily_revenue_as_file: + permissions: + - level: CAN_MANAGE + user_name: user@company.com + display_name: "NYC Taxi Daily Revenue Alert as File" + warehouse_id: ${var.warehouse_id} + file_path: ./nyc_taxi_daily_revenue_as_file.dbalert.json + + diff --git a/knowledge_base/alerts/resources/nyc_taxi_daily_revenue_as_file.dbalert.json b/knowledge_base/alerts/resources/nyc_taxi_daily_revenue_as_file.dbalert.json new file mode 100644 index 0000000..270356d --- /dev/null +++ b/knowledge_base/alerts/resources/nyc_taxi_daily_revenue_as_file.dbalert.json @@ -0,0 +1,35 @@ +{ + "custom_summary": "Alert when NYC Taxi daily revenue exceeds threshold", + "evaluation": { + "source": { + "name": "amount", + "display": "amount", + "aggregation": "MAX" + }, + "comparison_operator": "GREATER_THAN", + "threshold": { + "value": { + "double_value": 1000000.0 + } + }, + "notification": { + "retrigger_seconds": 3600, + "notify_on_ok": false + } + }, + "schedule": { + "quartz_cron_schedule": "0 0 8 * * ?", + "timezone_id": "UTC" + }, + "query_lines": [ + "SELECT", + " to_date(tpep_pickup_datetime) as date,", + " SUM(fare_amount) as amount", + "FROM", + " `samples`.`nyctaxi`.`trips`", + "GROUP BY", + " ALL", + "ORDER BY", + " 1 DESC" + ] +} From f28a8f379274d320d9867abccb1035b109a20f89 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Mon, 19 Jan 2026 13:36:48 +0100 Subject: [PATCH 2/7] - --- knowledge_base/alerts/databricks.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/knowledge_base/alerts/databricks.yml b/knowledge_base/alerts/databricks.yml index 5bbddd4..f7dface 100644 --- a/knowledge_base/alerts/databricks.yml +++ b/knowledge_base/alerts/databricks.yml @@ -7,13 +7,12 @@ include: variables: # The "warehouse_id" variable is used to reference the warehouse used by the alert. warehouse_id: - default: 49efc47d56d40c50 - # lookup: - # # Replace this with the name of your SQL warehouse. - # warehouse: "Shared Unity Catalog Severless" + lookup: + # Replace this with the name of your SQL warehouse. + warehouse: "Shared Unity Catalog Severless" -# workspace: - # host: https://myworkspace.databricks.com +workspace: + host: https://myworkspace.databricks.com From 114e82f995499e887bbd537911a01dc700da6640 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Mon, 19 Jan 2026 13:37:14 +0100 Subject: [PATCH 3/7] - --- knowledge_base/alerts/databricks.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/knowledge_base/alerts/databricks.yml b/knowledge_base/alerts/databricks.yml index f7dface..d055bf1 100644 --- a/knowledge_base/alerts/databricks.yml +++ b/knowledge_base/alerts/databricks.yml @@ -15,7 +15,6 @@ workspace: host: https://myworkspace.databricks.com - targets: dev: default: true From 0ac7d5ea3e8e4f0e93d998a0a3f7671f4a61da37 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Mon, 19 Jan 2026 13:38:24 +0100 Subject: [PATCH 4/7] better documentation --- .../alerts/resources/nyc_taxi_daily_revenue.alert.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml b/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml index 5f14750..bd4e80b 100644 --- a/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml +++ b/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml @@ -49,8 +49,8 @@ resources: quartz_cron_schedule: "0 0 8 * * ?" # Run daily at 8 AM UTC timezone_id: "UTC" - # This is the same alert as above, but refers to a .dbalert.json file - # for the configuration. + # This alert is configured identically to the above alert, but it refers to a .dbalert.json file + # instead of inlining the configuration in YAML. nyc_taxi_daily_revenue_as_file: permissions: - level: CAN_MANAGE From 9b4e51649841c9bd132cebea7984c4f882dcd3c3 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Mon, 19 Jan 2026 13:38:49 +0100 Subject: [PATCH 5/7] remove unnecessary new lines --- .../alerts/resources/nyc_taxi_daily_revenue.alert.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml b/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml index bd4e80b..961364b 100644 --- a/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml +++ b/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml @@ -58,5 +58,3 @@ resources: display_name: "NYC Taxi Daily Revenue Alert as File" warehouse_id: ${var.warehouse_id} file_path: ./nyc_taxi_daily_revenue_as_file.dbalert.json - - From ad5ca1bc85b4d2778fe2ebaecf3192ea467c345b Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Mon, 19 Jan 2026 13:43:02 +0100 Subject: [PATCH 6/7] add some documentation --- .../alerts/resources/nyc_taxi_daily_revenue.alert.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml b/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml index 961364b..994049e 100644 --- a/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml +++ b/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml @@ -50,7 +50,10 @@ resources: timezone_id: "UTC" # This alert is configured identically to the above alert, but it refers to a .dbalert.json file - # instead of inlining the configuration in YAML. + # instead of inlining the configuration in YAML. We recommend inlining the configuration in YAML + # when you need to productionize the alert across different target (dev, staging, prod) and + # use a .dbalert.json file when you have a single target alert that you author in the Databricks UI + # or using the databricks bundle generate alert command. nyc_taxi_daily_revenue_as_file: permissions: - level: CAN_MANAGE From 3f6f5b570e7c3c45f7231cc4fa03e4542858a99c Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Mon, 19 Jan 2026 13:44:24 +0100 Subject: [PATCH 7/7] - --- .../alerts/resources/nyc_taxi_daily_revenue.alert.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml b/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml index 994049e..e107523 100644 --- a/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml +++ b/knowledge_base/alerts/resources/nyc_taxi_daily_revenue.alert.yml @@ -52,7 +52,7 @@ resources: # This alert is configured identically to the above alert, but it refers to a .dbalert.json file # instead of inlining the configuration in YAML. We recommend inlining the configuration in YAML # when you need to productionize the alert across different target (dev, staging, prod) and - # use a .dbalert.json file when you have a single target alert that you author in the Databricks UI + # using a .dbalert.json file when you have a single target alert that you author in the Databricks UI # or using the databricks bundle generate alert command. nyc_taxi_daily_revenue_as_file: permissions: