Skip to content

Commit 0964337

Browse files
authored
Document on_streaming_backlog_exceeded in email/webhook notifications in databricks_job (#4660)
## Changes <!-- Summary of your changes that are easy to understand --> Resolves #4659 ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [x] relevant change in `docs/` folder
1 parent 41317f3 commit 0964337

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
* Document `performance_target` in `databricks_job` ([#4651](https://github.com/databricks/terraform-provider-databricks/pull/4651))
1515
* Add more examples for `databricks_model_serving` ([#4658](https://github.com/databricks/terraform-provider-databricks/pull/4658))
16+
* Document `on_streaming_backlog_exceeded` in email/webhook notifications in `databricks_job` ([#4660](https://github.com/databricks/terraform-provider-databricks/pull/4660))
1617
* Refresh `spark_python_task` option in `databricks_job` ([#4666](https://github.com/databricks/terraform-provider-databricks/pull/4666))
1718

1819
### Exporter

docs/resources/job.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ This block can be configured on both job and task levels for corresponding effec
458458
* `on_success` - (Optional) (List) list of emails to notify when the run completes successfully.
459459
* `on_failure` - (Optional) (List) list of emails to notify when the run fails.
460460
* `on_duration_warning_threshold_exceeded` - (Optional) (List) list of emails to notify when the duration of a run exceeds the threshold specified by the `RUN_DURATION_SECONDS` metric in the `health` block.
461+
* `on_streaming_backlog_exceeded` - (Optional) (List) list of emails to notify when any streaming backlog thresholds are exceeded for any stream.
461462

462463
The following parameter is only available for the job level configuration.
463464

@@ -471,6 +472,7 @@ Each entry in `webhook_notification` block takes a list `webhook` blocks. The fi
471472
* `on_success` - (Optional) (List) list of notification IDs to call when the run completes successfully. A maximum of 3 destinations can be specified.
472473
* `on_failure` - (Optional) (List) list of notification IDs to call when the run fails. A maximum of 3 destinations can be specified.
473474
* `on_duration_warning_threshold_exceeded` - (Optional) (List) list of notification IDs to call when the duration of a run exceeds the threshold specified by the `RUN_DURATION_SECONDS` metric in the `health` block.
475+
* `on_streaming_backlog_exceeded` - (Optional) (List) list of notification IDs to call when any streaming backlog thresholds are exceeded for any stream.
474476

475477
Note that the `id` is not to be confused with the name of the alert destination. The `id` can be retrieved through the API or the URL of Databricks UI `https://<workspace host>/sql/destinations/<notification id>?o=<workspace id>`
476478

jobs/resource_job.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,13 @@ func sortWebhookNotifications(wn *jobs.WebhookNotifications) {
170170
return
171171
}
172172

173-
notifs := [][]jobs.Webhook{wn.OnStart, wn.OnFailure, wn.OnSuccess}
173+
notifs := [][]jobs.Webhook{wn.OnStart, wn.OnFailure, wn.OnSuccess,
174+
wn.OnDurationWarningThresholdExceeded, wn.OnStreamingBacklogExceeded}
174175
for _, ns := range notifs {
175176
sort.Slice(ns, func(i, j int) bool {
176177
return ns[i].Id < ns[j].Id
177178
})
178179
}
179-
180-
sort.Slice(wn.OnDurationWarningThresholdExceeded, func(i, j int) bool {
181-
return wn.OnDurationWarningThresholdExceeded[i].Id < wn.OnDurationWarningThresholdExceeded[j].Id
182-
})
183-
184180
}
185181

186182
// CronSchedule contains the information for the quartz cron expression
@@ -908,7 +904,8 @@ func gitSourceSchema(s map[string]*schema.Schema, prefix string) {
908904
}
909905

910906
func fixWebhookNotifications(s map[string]*schema.Schema) {
911-
for _, n := range []string{"on_start", "on_failure", "on_success", "on_duration_warning_threshold_exceeded"} {
907+
for _, n := range []string{"on_start", "on_failure", "on_success",
908+
"on_duration_warning_threshold_exceeded", "on_streaming_backlog_exceeded"} {
912909
common.MustSchemaPath(s, "webhook_notifications", n).DiffSuppressFunc = nil
913910
}
914911
}

0 commit comments

Comments
 (0)