Skip to content
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

Implement prepend instrumentation for bunny. #566

Closed
mwlang opened this issue Feb 8, 2021 · 0 comments · Fixed by #565
Closed

Implement prepend instrumentation for bunny. #566

mwlang opened this issue Feb 8, 2021 · 0 comments · Fixed by #565

Comments

@mwlang
Copy link
Contributor

mwlang commented Feb 8, 2021

As part of implementing prepend auto-instrumentation for all libraries instrumented, introduce a prepend version of auto-instrumenting for the bunny gem

Feature Description

The agent instruments many libraries using the method chaining (a.k.a. method aliasing) approach to monkey-patching. This is a form of monkey-patching was deprecated with Ruby's introduction of :prepend as a means to insert additional functionality into a module's method lookup mechanism ahead of the library's original method implementation.

Prepend strategy will be the default choice in 7.0+. However, the prepend strategy may be reverted back to method chaining by adding the following configuration flag:

instrumentation:
  bunny: chain

If you find a conflict between Prepend and another gem in your application's Gemfile, we would highly appreciate opening an Issue or commenting on this one specific to the bunny gem so that we are aware and potentially work with gem authors to eliminate conflicts.

Additional context

We are switching to prepending by default and deprecating method-chaining as this is the most acceptable and dependable way to extend libraries with auto-instrumentation support outside of using the subscriber/notification hooks pattern that some gem authors already provide for observability purposes. However, this change is potentially a breaking change for some depending on other gems involved in an application's Gemfile makeup. To facilitate switching over to 7.0 release, the method chaining approach is only deprecated (not removed) and a configuration switch is provided to revert back to method-chaining for customers that are affected by prepend auto-instrumentation strategies.

@mwlang mwlang added this to the 7.0.0 Release Target milestone Feb 8, 2021
@mwlang mwlang linked a pull request Feb 8, 2021 that will close this issue
@tannalynn tannalynn self-assigned this Feb 10, 2021
@kford-newrelic kford-newrelic moved this to Code Complete/Done in Ruby Engineering Board Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants