-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
Only extend ActiveJob when it's defined #1218
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1218 +/- ##
==========================================
+ Coverage 97.92% 98.79% +0.86%
==========================================
Files 193 28 -165
Lines 8249 746 -7503
==========================================
- Hits 8078 737 -7341
+ Misses 171 9 -162
Continue to review full report at Codecov.
|
It's somewhat common for Rails users to exclude ActiveJob by manually requiring every other components when they don't need it. So we should detect if the ActiveJob constant is defined before extending it.
Thanks for this! I bumped into it while migrating from Do you think you could release a patch version of this to rubygems.org? This is working perfectly locally: gem "sentry-rails", github: "getsentry/sentry-ruby", glob: "sentry-rails/*.gemspec"
gem "sentry-ruby", github: "getsentry/sentry-ruby", glob: "sentry-ruby/*.gemspec" But the Sentry transactions aren't being reported from Heroku. Wondering if it's Git-related due to some logs but, still investigating:
|
I'll release gem "sentry-rails", github: "getsentry/sentry-ruby"
gem "sentry-ruby", github: "getsentry/sentry-ruby" |
@croaky well it's been released in version 4.1.5 now 🙂 |
Thanks @st0012! |
similar to the way we treat ActiveJobExtensions in getsentry#1218
similar to the way we treat ActiveJobExtensions in getsentry#1218
getsentry@3ae1365 There are 5 types of hooks that Action Cable provides: * `Connection#connect` * `Connection#disconnect` * `Channel#subscribed` * `Channel#unsubscribed` * `Channel` actions Now, any exceptions raised within those hooks are captured by Sentry, and reported as `ActionCable/[...]` transactions. Additional context is included depending on the hook the exception was raised within. A note/quirk: the Rack env that's included in the scope is from the `Connection`, and therefore has a URL of the cable `mount_path` (usually `/cable`) as well as the headers from that initial connection request. Additionally, there is not currently a really clean way to hook in and set `user_context`. I don't know if that is a blocker for this integration, but wanted to make sure it was noted.
Similar to the update for ActiveJobExtensions in getsentry#1218
Similar to the update for ActionCableExtensions in getsentry#1218 and getsentry#1494
…tion of #1295) (#1638) * capture exceptions in Action Cable connections and channels There are 5 types of hooks that Action Cable provides: * `Connection#connect` * `Connection#disconnect` * `Channel#subscribed` * `Channel#unsubscribed` * `Channel` actions Now, any exceptions raised within those hooks are captured by Sentry, and reported as `ActionCable/[...]` transactions. Additional context is included depending on the hook the exception was raised within. A note/quirk: the Rack env that's included in the scope is from the `Connection`, and therefore has a URL of the cable `mount_path` (usually `/cable`) as well as the headers from that initial connection request. Additionally, there is not currently a really clean way to hook in and set `user_context`. I don't know if that is a blocker for this integration, but wanted to make sure it was noted. * Only extend ActionCable when it's defined Similar to the update for ActionCableExtensions in #1218 and #1494 * test(ActionCable): Assert only 1 event captured: #1295 #1295 * Remove namespace 'ActionCable/*' #1295 * Test ActionCable #unsubscribed #1295 * test(ActionCable): prefer rspec-rails over mini-test #1295 (comment) * test(ActionCable): cleanup duplicated set_callback * docs(CHANGELOG): update #1295 to #1638 Co-authored-by: Alex Robbin <agrobbin@gmail.com>
It's somewhat common for Rails users to exclude ActiveJob by manually
requiring every other components when they don't need it. So we should
detect if the ActiveJob constant is defined before extending it.
Fixes #1210