Hi we have a slack notification setup if there is ...
# ask-community
m
Hi we have a slack notification setup if there is a any failure in the ops trigger the notification, but we do want to get notifications on resource init failures not just ops failing, help is appreciated
🤖 1
s
you should be able to accomplish this with a failure sensor: https://docs.dagster.io/concepts/partitions-schedules-sensors/sensors#job-failure-sensor
m
ok I tried to use the make_slack_on_run_failure_sensor but it is not erroring out when during Initialization of resources
s
that's unexpected - does it error out if there's an error in an op?
m
yes
I wanted send the wrong env varibale in launch pad and then when I run this, it failed but it is not sending the message
and does this make_slack_on_run_failure_sensor should setup at repo.py? file
or job or op level?
If you could provide the example that would be great
Seems to be sensor is not being running
even after I ran the dagster-daemon run
how to enable it
s
you would include it on your repository, e.g.
Copy code
@repository
def repo():
    return [make_slack_on_run_failure_sensor(...), ...]
it won't fail if you try to use a configuration in the launchpad that's not supported by the schema of the job, because that happens before a run is even created. but it should fail if there's an error during resource initialization, because that happens within the run
m
ok I got it working
but how could link the job url in the slack message
?
it is currenty showing the bc360885
s
if you supply a value for the
dagit_base_url
parameter of
make_slack_on_run_failure_sensor
, then a link will show up in the message
m
ok thank you
150 Views