https://dagster.io/ logo
#ask-community
Title
# ask-community
m

Manga Dhatrika

08/17/2022, 2:23 PM
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

sandy

08/17/2022, 5:47 PM
you should be able to accomplish this with a failure sensor: https://docs.dagster.io/concepts/partitions-schedules-sensors/sensors#job-failure-sensor
m

Manga Dhatrika

08/18/2022, 6:53 PM
ok I tried to use the make_slack_on_run_failure_sensor but it is not erroring out when during Initialization of resources
s

sandy

08/18/2022, 7:07 PM
that's unexpected - does it error out if there's an error in an op?
m

Manga Dhatrika

08/18/2022, 7:08 PM
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

sandy

08/18/2022, 8:35 PM
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

Manga Dhatrika

08/18/2022, 8:39 PM
ok I got it working
but how could link the job url in the slack message
?
it is currenty showing the bc360885
s

sandy

08/18/2022, 8:42 PM
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

Manga Dhatrika

08/19/2022, 1:40 PM
ok thank you
94 Views