Skip to content

Send Slack message based on job success retry sensor #17736

Answered by jamiedemaria
dagsir[bot] bot asked this question in Q&A
Discussion options

You must be logged in to vote

Inside of a run status sensor, you have access to a context. The context has an attribute called dagster_run that in turn contains the tags for a run. You could check those tags and then send a slack message if it was a retry

@run_status_sensor(run_status=DagsterRunStatus.SUCCESS)
def send_slack_on_successful_retry(context):
    tags = context.dagster_run.tags 
    # if retry tag in tags, then use SlackResource to send a message 

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jamiedemaria
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area: sensor Related to Sensors
2 participants