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 sinatra #595

Closed
tannalynn opened this issue Feb 22, 2021 · 0 comments · Fixed by #626
Closed

Implement prepend instrumentation for sinatra #595

tannalynn opened this issue Feb 22, 2021 · 0 comments · Fixed by #626

Comments

@tannalynn
Copy link
Contributor

As part of implementing prepend auto-instrumentation for all libraries instrumented, introduce a prepend version of auto-instrumenting for the sinatra 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:
  sinatra: chain

All configuration options are described in-depth here:
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 this 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.

@tannalynn tannalynn added this to the 7.0.0 Release Target milestone Feb 22, 2021
@tannalynn tannalynn added this to Triage in Ruby Engineering Board via automation Feb 22, 2021
@angelatan2 angelatan2 moved this from Triage to Backlog in Ruby Engineering Board Feb 23, 2021
@angelatan2 angelatan2 moved this from Backlog to To do in Ruby Engineering Board Feb 27, 2021
@tannalynn tannalynn moved this from To do to In progress in Ruby Engineering Board Mar 15, 2021
@tannalynn tannalynn linked a pull request Mar 24, 2021 that will close this issue
Ruby Engineering Board automation moved this from In progress to Done/Pending Release Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Ruby Engineering Board
  
Code Complete/Done
Development

Successfully merging a pull request may close this issue.

1 participant