Skip to content

Commit

Permalink
job failure sensor -> run failure sensor in docs (dagster-io#9412)
Browse files Browse the repository at this point in the history
* job failure sensor -> run failure sensor in docs

* Update docs/content/concepts/ops-jobs-graphs/op-hooks.mdx

Co-authored-by: jamiedemaria <[email protected]>

Co-authored-by: jamiedemaria <[email protected]>
  • Loading branch information
sryza and jamiedemaria authored Aug 18, 2022
1 parent 44b5ed5 commit 32e9b31
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/content/concepts/ops-jobs-graphs/op-hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,4 @@ When you add a hook to a job, the hook will be added to every op in the job indi

You may find the need to set up job-level policies. For example, you may want to run some code for every job failure.

Dagster provides a way to create a sensor that reacts to job failure events. You can find details at [Job failure sensor](/concepts/partitions-schedules-sensors/sensors#job-failure-sensor) on the [Sensors](/concepts/partitions-schedules-sensors/sensors) page.
Dagster provides a way to create a sensor that reacts to job failure events. You can find details at [Run failure sensor](/concepts/partitions-schedules-sensors/sensors#run-failure-sensor) on the [Sensors](/concepts/partitions-schedules-sensors/sensors) page.
14 changes: 7 additions & 7 deletions docs/content/concepts/partitions-schedules-sensors/sensors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ height={1400}

## Run status sensors

If you want to act on the status of a job run, Dagster provides a way to create a sensor that reacts to run statuses. You can use <PyObject object="run_status_sensor" /> with a specified <PyObject object="DagsterRunStatus" /> to decorate a function that will run when the given status occurs. This can be used to launch runs of other jobs, send alerts to a monitoring service on job failure, or report a run success.
If you want to act on the status of a job run, Dagster provides a way to create a sensor that reacts to run statuses. You can use <PyObject object="run_status_sensor" /> with a specified <PyObject object="DagsterRunStatus" /> to decorate a function that will run when the given status occurs. This can be used to launch runs of other jobs, send alerts to a monitoring service on run failure, or report a run success.

Here is an example of a run status sensor that launches a run of `status_reporting_job` if a run is successful

Expand Down Expand Up @@ -439,9 +439,9 @@ def my_repository():
return my_jobs + [my_slack_on_run_success]
```

### Job failure sensor
### Run failure sensor

Dagster provides a set of special run status sensor decorators for defining sensors that monitor job failure events. You can use <PyObject object="run_failure_sensor" /> to decorate a function that will run when a run fails.
Dagster provides a set of special run status sensor decorators for defining sensors that monitor run failure events. You can use <PyObject object="run_failure_sensor" /> to decorate a function that will run when a run fails.

```python file=concepts/partitions_schedules_sensors/sensors/run_status_run_requests.py startafter=start_job_failure endbefore=end_job_failure
@run_failure_sensor(request_job=status_reporting_job)
Expand All @@ -452,7 +452,7 @@ def report_failure_sensor(context):
return RunRequest(run_key=None, run_config=run_config)
```

This job failure sensor sends a slack message when it runs:
This run failure sensor sends a slack message when it runs:

```python file=/concepts/partitions_schedules_sensors/sensors/sensor_alert.py startafter=start_alert_sensor_marker endbefore=end_alert_sensor_marker
import os
Expand All @@ -470,10 +470,10 @@ def my_slack_on_run_failure(context: RunFailureSensorContext):
)
```

**Dagster also provides the following out-of-box job failure sensors:**
**Dagster also provides the following out-of-box run failure sensors:**

<PyObject module="dagster_slack" object="make_slack_on_run_failure_sensor" /> helps
you create a job failure sensor that will message a given Slack channel:
you create a run failure sensor that will message a given Slack channel:

```python file=/concepts/partitions_schedules_sensors/sensors/sensor_alert.py startafter=start_slack_marker endbefore=end_slack_marker
from dagster_slack import make_slack_on_run_failure_sensor
Expand All @@ -483,7 +483,7 @@ slack_on_run_failure = make_slack_on_run_failure_sensor(
)
```

<PyObject object="make_email_on_run_failure_sensor" /> helps you create a job failure
<PyObject object="make_email_on_run_failure_sensor" /> helps you create a run failure
sensor that will send emails via the SMTP protocol:

```python file=/concepts/partitions_schedules_sensors/sensors/sensor_alert.py startafter=start_email_marker endbefore=end_email_marker
Expand Down
5 changes: 5 additions & 0 deletions docs/next/util/redirectUrls.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,5 +573,10 @@
"source": "/deployment/guides/ecs",
"destination": "/deployment/guides/aws#deploying-in-ecs",
"permanent": true
},
{
"source": "/concepts/partitions-schedules-sensors/sensors#job-failure-sensor",
"destination": "/concepts/partitions-schedules-sensors/sensors#run-failure-sensor",
"permanent": true
}
]

0 comments on commit 32e9b31

Please sign in to comment.