-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
New Relic support #128
Comments
after almost a whole day trying to figure this out, I got this working. |
In my case the environment variable helped. But I had to add following initializer if defined?(NewRelic) && defined?(Puma)
NewRelic::Agent.after_fork force_reconnect: true
end I also had to put |
I can't get this to work with any of these approaches |
Please try following:
|
Had the same issue. It really only works for me if the env variable NEWRELIC_DISPATCHER=puma is set... Not sure why it doesn't work without the env var!? |
I'm currently debugging this and plan to make some adjustments so it works out of the box. Should be out soon. |
+1 NewRelic work with NEWRELIC_DISPATCHER=puma. |
Even with the ENV variable or |
There has been a report that manually including NEWRELIC_DISPATCHER=puma in the actual start-up script of puma as opposed to an environment variable was required, in one instance |
I got this error message when using the above initializer:
I was trying to deploy with capistrano (it was from running assets precompile rake task) |
@rengland-newrelic I've tried all "solutions" listed in this thread: the environment variable, setting it manually in the start-up script, including EDIT: false alarm. it looks like setting the environment variable in my startup script did work. I'm reporting data. Cool. |
Adding Rails 3.2.8, Puma 1.6.3 |
This doesn't work out the box for me with puma 2.0.0.b4, rails 3.2.11 and ruby 2.0.0.rc1 Here's the stack trace |
No longer working under ruby 2.0.0 |
@concept47 based on that stack trace, it's likely a bug in the Ruby agent rather than in puma. We're taking a look. |
@davidcelis ... you're absolutely right, I ran it by newrelic and its an issue with ruby 2.0.0 and their newrelic agent |
Looks like New Relic Agent 3.5.8.72 added support for Ruby 2.0.0. Agent 3.6.0.78 added support for "thread safety" and specifically mentions Puma. I'm still on Ruby 1.9.3 so I can't confirm anything. Unfortunately looks like I still have to set |
I can confirm it works now. |
I wanted to let you all know I've just pushed a beta version of newrelic_rpm which should work in puma without needing to set NEWRELIC_DISPATCHER variables or other shenanigans. More specifically, I've simplified the logic that controls when the agent attempts to start, and switched to blacklisting environments (e.g. rails console, irb, certain rake tasks) instead of trying to detect if the agent is in a "supported environment". I'd be very interested in getting some feedback on whether this works for your puma apps and simplifies their deployment. Thanks! |
@samg it's working for my app when running in a webserver, but seems to not be detected during asset compilation when deploying to heroku. "No known dispatcher detected" |
@jjb - thanks for the update. I sounds like that's the intended behavior. The recent change I described makes it so the agent will start up even if it doesn't detect a "known dispatcher" as long as it's in a monitored environment. It will still log the message you described. I haven't added any specific code to detect puma. I've just made it so we don't need to detect every web server out there in order to start. Thanks! |
Using Ruby 2.0.0-p247, Rails 4.0.0 and newrelic_rpm (3.6.5.130) I've added [07/11/13 14:32:44 +0000 domain.com (12336)] INFO : Installing Sidekiq instrumentation Still not seeing anything for the application even after another |
Getting this without tampering anything, but no report in newrelic_rpm (3.6.5.130), Rails 3-2-stable, Ruby 2.0.0-p247
|
I'm having the same problem as @pawel2105 new relic log looks like this
but I'm getting no data to newrelic whatsoever When I downgrade to puma 2.0.1, it works just fine. |
I'm seeing the same thing. Using Ruby 2.0.0-p247, Rails 4.0.0 and newrelic_rpm (3.6.5.130). In New Relic, there is no data except for it detecting a single instance pegged at 100MB. I'm running 4 workers. |
I see lot of this in the puma err log:
might be a hint. Also at the same time:
|
Hey all. I'm an engineer on the Ruby agent team at New Relic and I'm looking into this today. Can those who are seeing the issue confirm whether they're using clustered mode with multiple workers? If so, we've encountered an issue with that recently. While we're getting a fix ready, you can work around it by: Adding :require => false to your gem 'newrelic_rpm' line in your Gemfile In your puma configuration file, add a block like this:
If anyone is not running in clustered mode but has problems with recent versions, I'm especially interested to hear about that too. |
Thank you so much @jasonrclark for this timely intervention. Just switched to clustered mode and was experiencing this issue. Everything just works when following your instructions! |
Hm, today I restarted puma on the server just in case and now it's not detecting unicorn anymore. I think I did a stop & start yesterday too, but maybe I just did a restart, not sure. Anyway it seems newrelic was then detecting unicorn because the gem was present (even though puma was present too). Before I added the environment variable, I didn't get any data in newrelic (but logs were showing that newrelic did start). |
What exactly do I need to do now? I've added ENV['NEWRELIC_DISPATCHER'] = 'puma' to boot.rb and dispatcher: puma to my newrelic.yml. Is there anything else I need to do? I'm getting practically no data (just a cpm count - everything else is zero). Update: Puma 1.6.3 Ruby 1.9.3 Rails 4.0.1 w/ Resque Sinatra app |
Hey @ponny how is your launch script, I mean what do you use to boot up the server ? Also, do you know the version of your |
@ponny New Relic gem work out of the box with puma. |
@madwork So what exactly do I need to do to fix it? I don't see how switching to upstart would make a difference. |
@ponny Set daemonize option to false will fix the newrelic agent issue, but puma will not start as a daemon, so to fix this behavior, I use upstart to daemonize puma (and start/stop/monitor puma process). |
@ponny If you set the daemonize option true in your puma configuration, newrelic_rpm as of 3.6.9.171 doesn't detect properly. We're working on a fix, but don't have it ready yet. @madwork's suggestion or something similar should fix things. As long as Puma doesn't daemonize itself, you should be fine--another process managing Puma can daemonize/background all it wants, as long as Puma itself isn't calling An alternative some people have had success with is setting |
…ead with one worker. The thread/worker config is a workaround for newrelic: puma/puma#128
Setting workers to 1 worked for me as well and -w 2 works too. puma -t 8:50 -e production -b unix:///tmp/utro.0.sock -w 1 -d && puma -t 8:50 -e production -b unix:///tmp/utro.1.sock -w 1 -d but this also works |
Can confirm that setting workers > 0 fixes the issue.
|
…h one worker. The thread/worker config is a workaround for newrelic: puma/puma#128
…h one worker. The thread/worker config is a workaround for newrelic: puma/puma#128
…h one worker. The thread/worker config is a workaround for newrelic: puma/puma#128
…h one worker. The thread/worker config is a workaround for newrelic: puma/puma#128
…h one worker. The thread/worker config is a workaround for newrelic: puma/puma#128
…h one worker. The thread/worker config is a workaround for newrelic: puma/puma#128
…h one worker. The thread/worker config is a workaround for newrelic: puma/puma#128
…h one worker. The thread/worker config is a workaround for newrelic: puma/puma#128
…h one worker. The thread/worker config is a workaround for newrelic: puma/puma#128
…h one worker. The thread/worker config is a workaround for newrelic: puma/puma#128
…h one worker. The thread/worker config is a workaround for newrelic: puma/puma#128
noto.io — Puma + New Relic http://noto.io/post/67556490184/puma-new-relic New Relic support - Issue #128 - puma/puma puma/puma#128 (comment)
As seen in issue puma/puma#128
Does Puma work with New Relic out of the box? I cannot get it to report data from my app.
The text was updated successfully, but these errors were encountered: