-
-
Notifications
You must be signed in to change notification settings - Fork 513
Redis support for sentry-ruby #1697
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
Conversation
Patches a Redis client to capture breadcrumb and span data when calls are made to Redis.
* master: Don't reuse Net::HTTP objects in `HTTPTransport` (getsentry#1696) Rails 7 example (getsentry#1694)
@lewispb thanks for the work! I think you've done a fantastic job on this 👍 |
No problem @st0012, thanks for looking! |
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.
I think the implementation looks good and logging
is probably the best place to patch for this 👍
I left 2 comments but generally it's ready to merge. After merging I'll play a bit with it and perhaps add some screenshot to the changelog & improve some tests around SDK initialization check.
@@ -0,0 +1,81 @@ | |||
require "spec_helper" | |||
require "fakeredis" |
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.
I think it's ok to put this in spec_helper
and before require "sentry-ruby"
. Then we don't need to force the redis.rb
reload anymore. Wdyt?
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.
Good idea!
I can implement that in a separate PR and ask for your opinion, wdyt?
I haven't received any request to opt-out specific tracing integration. So it's probably not needed now.
I think |
yes that span status is correct, only the |
thanks for the contribution @lewispb! In the ruby SDK currently, we have separate gems encapsulating specific integrations ( Now with redis, we're adding it to the main |
* master: feat(performance): Sync activerecord and net-http span names (getsentry#1681) Register Sentry's ErrorSubscriber for Rails 7.0+ apps (getsentry#1705) Support serializing ActiveRecord job arguments in global id form (getsentry#1688) release: 5.0.2 Fix report_after_job_retries's decision logic (getsentry#1704) Followup of getsentry#1701 (getsentry#1703) Capture transaction tags (getsentry#1701)
I think there are different categories in terms of "integrations":
For 1), the current approach is to ask users to install the related For 2), the current approach is to have their code in
For 3), the current approach is to detect if those components exist in the app, and opt-in for the user. Let me explain a bit on my decision on 3): Most users don't spend time configuring their Sentry SDK. They copy and paste the configuration from documentation or setup wizard, check if errors go through, and then forget about it. I have 2 examples for this assumption:
And guess what happened, many users leave both of them uncommented 😂
So my concern is that most users may not aware of those lower-level components and thus won't intentionally make the effort to opt-in the integration. That's why I didn't want to make |
Codecov Report
@@ Coverage Diff @@
## master #1697 +/- ##
==========================================
- Coverage 98.39% 96.16% -2.23%
==========================================
Files 136 115 -21
Lines 7833 6696 -1137
==========================================
- Hits 7707 6439 -1268
- Misses 126 257 +131
Continue to review full report at Codecov.
|
Sounds great, thanks.
Cool, OK! |
Completely agree on the zero-config front, that is also very much our design philosophy as well. Either way, I don't wanna bikeshed on this too much, but it's instructive that we had this conversation. Let's just go with the PR in its current form. 👍 We can agree on a simple rule like 'large' frameworks go in separate gems and everything else goes in |
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.
👍 Thanks for this great PR!
Sure, no problem! I could also take a look at it if you like, although probably not till next week? |
@lewispb I scheduled it for |
Description
Implements #1693
Patches a Redis client to capture breadcrumb and span data when calls are made to Redis.
Todo
Outstanding questions
config.send_default_pii
setting. Is capturing these values something we need right away, or can it wait for a future PR?