-
Notifications
You must be signed in to change notification settings - Fork 369
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
Add loaded specs fallback #1510
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1510 +/- ##
==========================================
- Coverage 98.22% 98.22% -0.01%
==========================================
Files 862 862
Lines 41686 41685 -1
==========================================
- Hits 40945 40944 -1
Misses 741 741
Continue to review full report at Codecov.
|
I'm... still a bit unconvinced that this is correct:
But I admit some of the details of the inner workings of rubygems and Ruby are unknown to me. My understanding is that So I think this replacement is not a direct equivalent. This is why in #1506 I've tried to wire things up such as if the library appears to be loaded (and protobuf doesn't provide a version constant, so "appears to be loaded" was what I had to work with), then we avoid the use of |
@ivoanjo yes i've been thinking about this incorrectly, will update issue + this pr |
…gem isnt yet required
@ivoanjo what do u think now, better? |
Co-authored-by: Marco Costa <marco.costa@datadoghq.com>
this pr addresses #1505. Within the core tracer we should generally try to avoid
Gem.loaded_specs
if a known libraries version constant exists, asloaded_specs
may not work depending on how the user is using Rubygems.This work builds on top of #1506 and the next step here would be to add fallback code, where possible, for each contrib integration. Doing this repeatedly would be a chore so it's preferable to have a helper class for this that safely checks the version constant, maybe something like