-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(notifications): adds task for slack notifications #29720
Conversation
We were discussing this problem on Ecosystems yesterday and decided that we should have per-workspace redis queues that can fire off API calls at 1 message per second. Enqueuing would be async so you get your endpoint speed-up. |
@mgaeta Ok...so I should close this PR? When do you think you can build that out? |
|
||
|
||
# TODO: add retry logic | ||
@instrumented_task(name="sentry.integrations.slack.post_message", queue="integrations", max_retries=0) # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you also want late_acks? That will ensure that your messages are retried if a worker is restarted in while this task is running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markstory At this point, this task just exists so we can make it async. We'll have to follow up later with handling failures. That's why I set max_retries
to 0.
This PR creates a thin wrapper around Slack's postMessage endpoint and turns it into a task. We are currently using this task for the notification platform so that we won't have to make users wait for Slack messages to send before we end the web request that triggered the notification (if there is one). This is important for the upcoming "Request to X" notifications.
Note that I purposely made the task have 0 retries. In the future, we might want to add logic to retry 429 errors and timeouts but I am going to leave it to the Ecosystem team to figure out how to tune it.