Send Sentry events async
We saw in gitlab-com/gl-infra/production#4091 (closed) where a bug that triggered a lot of Sentry events caused idle transactions to timeout.
sentry-raven
supports a simple way to do this in separate threads: https://github.com/getsentry/sentry-ruby/tree/sentry-raven-v3.1.2/sentry-raven#async. As noted in the doc, this naive implementation could lead to a large number of threads though.
We may want to upgrade and switch to the new sentry-ruby
gem which has better support for async: https://github.com/getsentry/sentry-ruby/tree/master. It now has a background_worker_threads
option and the Sentry events will be sent using that thread pool.
Edited by Heinrich Lee Yu