sentry-ruby
sentry-ruby copied to clipboard
Support profiling for queues
Add and test support for profiling transactions from sidekiq/delayed_job/resque, some customers have already shown interest.
I'm looking into the code for this. Aside from the threading issues (that I don't have enough depth for just yet), it looks like:
-
Transaction
has aProfiler
attached. - On
Sentry.start_transaction
, the hub will calltransaction.start_profiler!
, which will, with random luck, do exactly that, as long as this transaction is sampled, and profiling rate allows. - It looks like anything that already uses transactions will potentially be able to make profiles. Looking as
sentry_context_middleware.rb
for sidekiq, it seems like it should work?
I have not yet tried it out myself, but that's the next thing I'm looking at. I expect that if I set my profile rate high enough and spam background jobs in an example app, I should see messed up profiles, all dumped into the single thead_id: 0
.
If that's the case, I guess we should focus on trying Vernier first?
this is on hold for now, because the server will actually throw away profiles longer than 30s. Longer profiles need a bunch of server support for 'streaming profiles' because otherwise the payloads get too large and are not practical.