Open slhck opened 3 weeks ago
I was able to work around it by specifying require: false
in the Gemfile
, and then requiring the Gem only in config/environments/production.rb
. That, however, makes it difficult to use ElasticAPM
classes throughout the code, since they will have to be wrapped in a if Rails.env.production?
statement (otherwise you'll get a class not found error).
Is your feature request related to a problem? Please describe.
I want to disable the APM agent in a particular Rails environment, or via an environment variable setting, to dynamically turn on/off APM reporting. In particular I do not want instrumentation in the Rails test environment.
Describe the solution you'd like
Provide a config option, just like the Node.js version has:
Describe alternatives you've considered
Not loading the Gem, but it is automatically loaded when specified in the Gemfile.