Use Module#prepend where possible#890
Use Module#prepend where possible#890mikker merged 13 commits intoelastic:nextfrom mikker:prependageddon
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Steps errors
Expand to view the steps failures
|
|
😅 apm-agent-ruby/lib/elastic_apm/span_helpers.rb Lines 39 to 49 in 9557a3c |
estolfo
left a comment
There was a problem hiding this comment.
Looks good-- seems a lot more straightforward than I thought it would be.
You mentioned wanting to change the name of Spies, do you still want to? We could call them extensions, as they are each in a module Ext. Or integrations, as I think you suggested.
|
I sort of still do. We'd have to do it in 2 steps though as we'd be renaming some config options too. So step 1 is soft deprecation, then remove in major. |
|
ok, I guess it's not urgent then and doesn't necessarily have to be part of this PR. |
This leaves us with only the module based APIs still using
class_eval, specificallydelayed_jobandsucker_punch. The problem being that at the time of hooking up the integration, the target modules have already been included and so prepending doesn't modify the including classes.I propose we leave them as is for now and change them in a future version if we come up with a scheme or they introduce some sort of plugin api that could help us avoid
class_eval.This PR is a breaking change not because it removes any features but because it might interfere with other libraries still using class_eval and thereby possibly introduce the infinite loop when trying to look up stacktraces after an exception(#753 for example).