-
Notifications
You must be signed in to change notification settings - Fork 598
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
Stack level too deep errors on 7.0.0+ #731
Comments
Prepend conflict between httpclient instrumentation and Faraday v1.5.0. Reported in #714 |
We upgraded from newrelic_rpm 6.x to 8.8.0. I had to update our newrelic.yml config file. We also use scout_apm gem which still uses chain method for instrumenting. First time I got the Stack level too deep error regarding net_http. That got solved adding But then it failed again, this time because of redis implementation. I added |
Hi @oboxodo, Thanks very much for this information. I'm very glad to hear that you were able to get things working, but sorry to hear you ran into a couple of issues. New Relic and ScoutAs for the issue with our code auto-detecting Scout and then using chain instead of prepend, that code will only work if Scout has already been loaded ("required" in a Ruby context) before the New Relic code is loaded. Typically to ensure that the Scout code is loaded before the New Relic code, you would make sure New Relic comes second in # Gemfile - put New Relic last
gem 'scout_apm'
gem 'newrelic_rpm' If it is not possible to place
If you feel that the New Relic code is definitely getting loaded after the Scout code and that our code for auto-detecting may have a bug, please let us know and we'll investigate farther. Redis InstrumentationIn order to configure the New Relic agent to use "chain" instead of "prepend", the approach is to put the following in the configuration file: instrumentation.<INSTRUMENTATION NAME>: chain With net/http you were able to do this with With Redis, you will need to do I completely understand how "redis" would make more sense than "redis_instrumentation", but at this point we cannot rename it without breaking existing clients that use the current name. |
Hi @fallwith, Thank you very much for your thorough reply.
You were right about the gems order. I switched them so that scout loads first and then newrelic, and that allowed me to use the default
This didn't work, though. :-/ I made sure to replace That being said, as you can see switching the loading order of scout and newrelic seems to remove the need of using the I'm happy to test any other ideas you might suggest to help you debug this. |
Hi @oboxodo. Two things:
If you are able to help test this issue by following the instructions in the gist, that would be super helpful. If the gist fails for you, then there must be something different between your environment and mine. If the gist succeeds for you, then there must be something different between the gist's Ruby code and New Relic configuration and those of your application. |
This is so that uncommenting any of these options and setting a value will be correctly included in the `common: &default_settings` block. I discovered this while investigating newrelic#731 (comment).
@fallwith ok, I found the "bug", and here's my proposed fix: #1276 The problem is that the template newrelic.yml had no indentation on the default values (since this commit), and that causes that my (unindented) Once I indented the setting adding two spaces to it, it worked as expected. I noticed the problem when I saw these two lines in your gist. |
If you are experiencing a stack level too deep error after upgrading to 7.0+ of the ruby agent, check out our troubleshooting guide on resolving the issue in your application.
Report a New Conflict
The ruby agent is able to automatically install compatible instrumentation when certain gems are detected in the application that are known to cause a conflict with the agents use of Module#prepend.
To report a conflict to be added to the agent detection when automatically installing instrumentation, please provide the following after configuring the agent by following the troubleshooting guide
instrumentation.net_http: prepend
)/Users/user/.rvm/gems/ruby-2.6.5/gems/airbrake-10.0.1/lib/airbrake/rails/net_http.rb:11
orAirbrake v10.0.1
)Gems Known to Cause Prepend Conflicts (auto-detected in latest release v7.2.0)
Net::HTTP
Airbrake < 10.0.2
ScoutApm
Rack::MiniProfiler
Redis
PrometheusExporter
Resque
Airbrake < 11.0.3
The text was updated successfully, but these errors were encountered: