Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat (SRM) add failed events slack notification #886

Merged
merged 8 commits into from
Mar 5, 2025

Conversation

raylrui
Copy link
Contributor

@raylrui raylrui commented Mar 3, 2025

solve: #875

Subscribe to the 'SequenceRunStateChange' event, and send the slack notification topic when the failed event is triggered.
event rules as:

eventRule.addEventPattern({
      source: ['orcabus.sequencerunmanager'],
      detailType: ['SequenceRunStateChange'],
      detail: {
        status: ['FAILED'],
        id: [{ exists: true }],
        instrumentRunId: [{ exists: true }],
        sampleSheetName: [{ exists: true }],
        startTime: [{ exists: true }],
      },
    });

It will generate Failed SRM events message to slack channel( biobots for prod account).
Example message format:
image

PS:
(SNS topic issue) Because we set up 'alerts' sns topic manually, CDK can't modify the resource policy as it is an "imported" resource in our stacks. So we need to add a resource policy to allow EventBridge to publish to this SNS topic.
example of manually added resource policy:

{
      "Sid": "AWSEvents_OrcaBusBeta-SequenceRunManagerStackSlackNotificationRule_Id85755e27-3dd5-408e-9091-9cbc7315db7e",
      "Effect": "Allow",
      "Principal": {
        "Service": "events.amazonaws.com"
      },
      "Action": "sns:Publish",
      "Resource": "arn:aws:sns:ap-southeast-2:843407916570:AwsChatBotTopic-alerts"
      }

@raylrui raylrui added the feature New feature label Mar 3, 2025
@raylrui raylrui self-assigned this Mar 3, 2025
@raylrui raylrui changed the title srm add failed event slack notification Feat (SRM) add failed events slack notification Mar 4, 2025
@raylrui raylrui requested review from reisingerf and victorskl March 4, 2025 23:26
Copy link
Member

@reisingerf reisingerf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution!

@raylrui raylrui added this pull request to the merge queue Mar 5, 2025
Merged via the queue into main with commit 0e279d3 Mar 5, 2025
6 checks passed
@raylrui raylrui deleted the feat/srm-add-failed-run-slack-notification branch March 5, 2025 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants