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

Add a configuration option to permit custom method tracers to be defined automatically #2701

Open
fallwith opened this issue Jun 7, 2024 · 1 comment

Comments

@fallwith
Copy link
Contributor

fallwith commented Jun 7, 2024

Coming out of a k8s operator discussion involving automated injection logic that would allow a customer to leverage New Relic APM functionality without altering their existing code base...

As per the docs, currently a customer wanting to define a custom method tracer must do so by adding a line of code for every method to be traced:

add_method_tracer :my_method_to_be_traced

It would be ideal if we could leverage a configuration parameter to permit method tracers to by added automatically when the agent starts.

Users could enjoy all of the custom functionality without any alterations being made to their .rb files.

For example, given this Ruby code:

module MyCompany
  class Image
    def render_png
      # code to render a PNG
    end
  end

  class User
    def self.notify
      # code to notify users
    end
  end
end

We could support a configuration parameter called :custom_tracer_method_list like so in newrelic.yml:

customer_tracer_method_list: MyCompany::Image#render_png,MyCompany::User.notify

Method tracers would then automatically be added for the 2 methods on the list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant