ジョブイベントのEメールとシステム通知を追加する

ジョブの実行とそのジョブの一部であるタスクをモニタリングするには、実行が開始、成功、失敗、またはその期間が設定されたしきい値を超えたときの通知を設定します。 通知は、1つ以上のEメールアドレスまたはSlack、 Microsoft Teams、PagerDuty、または任意のWebhookベースのサービスなどのシステム宛先に送信できます。

システム通知を構成する

注:

  • ジョブまたはタスクごとに、通知イベントの種類ごとに最大 3 つのシステム宛先を設定できます。

  • 管理者は、システムの宛先を構成する必要があります。 システムの宛先を構成するには、[ システム通知の編集] ダイアログまたは 管理者設定ページで [ 新しい宛先の作成] を選択します。

  • Notifications you set at the job level are not sent when failed tasks are retried. To receive a failure notification after every failed task (including every failed retry), use task notifications instead. To add system notifications for task runs, click + Add next to Notifications in the task panel when you add or edit a job task.

  • Succeeded with failures状態で完了したジョブは、成功した状態と見なされます。この状態で完了したジョブのアラートを受信するには、通知を構成するときに [成功] を選択する必要があります。

システム通知は、次のような一般的な通知ツールと統合されています。

このジョブの実行に通知可能なイベント(ジョブの開始、完了、失敗など)がある場合に、1つ以上のシステム通知を追加するには、次のようにします。

  1. ジョブ のジョブ詳細 パネルで、[ 通知の編集] をクリックします。

  2. [ 通知の追加 ] をクリックし、[ 宛先] でシステムの宛先を選択します。

  3. システム送信先の選択」で送信先を選択し、その送信先に送信する各通知タイプのチェック・ボックスをクリックします。

  4. 別の宛先を追加するには、もう一度 [通知を追加 ] をクリックします。

  5. [確認]をクリックします。

重要

The content of Slack and Microsoft Teams messages might change in future releases. You should not implement clients or processing that depend on the specific content or formatting of these messages. If you require a specific schema or formatting for notifications, Databricks recommends configuring a user-defined webhook.

Eメール通知を構成する

注:

  • Notifications you set at the job level are not sent when failed tasks are retried. To receive a failure notification after every failed task (including every failed retry), use task notifications instead. To add email notifications for task runs, click + Add next to Notifications in the task panel when you add or edit a job task.

  • Succeeded with failures状態で完了したジョブは、成功した状態と見なされます。この状態で完了したジョブのアラートを受信するには、通知を構成するときに [成功] を選択する必要があります。

このジョブの実行が開始、完了、または失敗したときに通知する 1 つ以上の Eメール アドレスを追加するには:

  1. ジョブ のジョブ詳細 パネルで、[ 通知の編集] をクリックします。

  2. [通知の追加] をクリックし、[宛先] で [Eメール アドレス] を選択します。

  3. Eメール アドレスを入力し、そのアドレスに送信する各通知タイプのチェックボックスをクリックします。

  4. 通知用に別のEメール アドレスを入力するには、[ 通知の追加] をもう一度クリックします。

  5. [確認]をクリックします。

Eメール notifications を使用して、 Amazon SES や SNS などのツールと統合できます。

実行速度の遅いジョブや遅延したジョブの通知を構成する

ジョブの予想期間を設定している場合、ジョブが設定された期間を超えた場合に、Eメールまたはシステム通知を追加できます。期間のしきい値を超えたジョブの通知を受け取るには、通知を追加または編集するときに [期間の警告 ] のチェックボックスをクリックします。

スキップまたはキャンセルされた実行の通知を除外する

You can reduce the number of notifications sent by filtering out notifications when a run is skipped or canceled. To filter notifications, check Mute notifications for skipped runs or Mute notifications for canceled runs when you add or modify email notifications or system notifications.

注:

スキップされた実行の通知をミュートする、またはジョブのキャンセルされた実行の通知をミュートするを選択しても、ジョブタスクに設定された通知は除外されません。スキップまたはキャンセルされた実行のすべての通知をフィルター処理するには、構成したタスク レベルの通知もフィルターで除外する必要があります。

HTTP Webhook ペイロード

HTTP Webhook を使用して通知を送信する場合、Databricks によって構成されたエンドポイントに送信されるペイロードの例を次に示します。

ジョブ実行開始イベントの通知:

{
  "event_type": "jobs.on_start",
  "workspace_id": "your_workspace_id",
  "run": {
    "run_id": "run_id"
  },
  "job": {
    "job_id": "job_id",
    "name": "job_name"
  }
}

タスク実行開始イベントの通知:

{
  "event_type": "jobs.on_start",
  "workspace_id": "your_workspace_id",
  "task": {
    "task_key": "task_name"
  },
  "run": {
    "run_id": "run_id_of_task"
    "parent_run_id": "run_id_of_parent_job_run"
  },
  "job": {
    "job_id": "job_id",
    "name": "job_name"
  }
}

宛先を設定する場合、Webhook は次のイベントタイプに対して設定できます。

イベントコード

いつ送信されますか?

jobs.on_start

実行が開始されます。

jobs.on_success

実行は停止し、成功または失敗して成功した状態で完了します。

jobs.on_failure

実行が失敗した状態で停止しました。

jobs.on_duration_warning_threshold_exceeded

実行が、構成された予想期間を超えて実行されています。