Brian Abelson
03/18/2021, 10:45 PMfailure_hook
on all my pipelines that looks like this:
@failure_hook(required_resource_keys={"slack"})
def slack_message_on_failure(context: HookContext):
message = f"*ALERT*: Dagster failed while running pipeline `{context.pipeline.pipeline_name}` at solid `{context.solid.name}`.\nCheck out the logs at <https://dagster.ioby.network/instance/runs/{context.run_id}>"
context.resources.slack.chat_postMessage(channel="product-alerts", text=message, icon_emoji=':scream_cat:', username='Uh-oh Cat')
yuhan
03/19/2021, 2:33 AMslack_on_failure
and slack_on_success
takes dagit_base_url
, the underlying logic of which is exactly the pattern you are using. see details in source codeBrian Abelson
03/19/2021, 2:15 PM