Support `good_job`
Describe the idea
good_job is a modern and feature-full ActiveJob backend based on PostgreSQL, by @bensheldon
If would be useful to have an integration for it, similar to the Sidekiq integration.
Why do you think it's beneficial to most of the users
You could add the instrumentation yourself to the app (there are examples in the doc for exception tracking), but it can get complex if you want a full integration with tracing support and so on. Having it built-in will ensure that users benefit from all Sentry's feature when using good_job
Possible implementation
There has been some discussion about this integration, with some code samples that add some of those features: https://github.com/bensheldon/good_job/issues/1558
hey thanks for reporting this - sounds like a great addition, would you be interested in opening a PR with this integration? I'm happy to help.
We are evaluating switching from Sidekiq to GoodJob right now, but did not make the switch yet, so I can not work on it at the moment. But in our exploration we noticed that this switch would make us loose those Sentry features that we really like, hence the issue.
Maybe @olivier-thatch who contributed the code in the linked issue would be interested?
@solnic Hey! I am also interested in this, do you have any hints? Probably this might be already enough for the start: https://github.com/search?q=repo%3Agetsentry%2Fsentry-ruby%20sidekiq&type=code and https://github.com/bensheldon/good_job/issues/1558#issuecomment-2546936044
I realized that sentry-rails already has an ActiveJob integration that does some of this (https://github.com/getsentry/sentry-ruby/blob/master/sentry-rails/lib/sentry/rails/active_job.rb)
I was also wondering about this as it covers quite essential parts already.
@solnic Hey! I am also interested in this, do you have any hints? Probably this might be already enough for the start: https://github.com/search?q=repo%3Agetsentry%2Fsentry-ruby%20sidekiq&type=code and bensheldon/good_job#1558 (comment)
I realized that sentry-rails already has an ActiveJob integration that does some of this (https://github.com/getsentry/sentry-ruby/blob/master/sentry-rails/lib/sentry/rails/active_job.rb)
I was also wondering about this as it covers quite essential parts already.
@amkisko hey! :) yes looking at sentry-sidekiq and taking some inspiration from it would be a good start. As I understand good_job is powerful enough to justify a dedicated integration, right?
As I understand good_job is powerful enough to justify a dedicated integration, right?
I haven't had a chance to work on this in a while, but I don't think a dedicated integration is necessary: unlike Sidekiq which can be used on its own or as an ActiveJob backend, GoodJob is purely an ActiveJob backend, so the existing ActiveJob integration should be sufficient.
Rather than writing a new dedicated integration, I think the existing ActiveJob integration should be updated. Currently, it emits a queue.active_job operation when a job is performed. Ideally, the integration would:
- emit a
queue.publishoperation when a job is enqueued (this is currently missing) - rename the
queue.active_joboperation toqueue.processfor clarity and consistency with the Sidekiq integration
I did write a simple but working integration here: https://gist.github.com/olivier-thatch/6baf7bf12b0f4862e53a4c333e3570d9, but it's probably missing some features from the existing ActiveJob integration, and I haven't tested it thoroughly (i.e. what happens when a job is performed inline with #perform_now, what happens when a job is retried, etc.).
GoodJob is purely an ActiveJob backend
@olivier-thatch oh OK thanks! I missed/forgot about that. In this case we should just look into improving our existing ActiveJob integration just like you described above.
@amkisko is this something you'd be interested in doing?
I've got preliminary working solution according to current features in Sentry, continuing testing it and let's see if it will get here. :)
Main PR: https://github.com/getsentry/sentry-ruby/pull/2751
Would also prefer getting this one in the same time: https://github.com/getsentry/sentry-ruby/pull/2750