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

Upgrade New Relic instrumentation to v3.0. #8

Open
iphoting opened this issue Oct 24, 2012 · 13 comments
Open

Upgrade New Relic instrumentation to v3.0. #8

iphoting opened this issue Oct 24, 2012 · 13 comments

Comments

@iphoting
Copy link
Owner

New version announced: http://blog.newrelic.com/2012/10/23/new-relic-launches-php-agent-3-0-includes-multi-tenancy-support/

@iphoting
Copy link
Owner Author

The agent and daemon no longer use a UNIX-domain socket for their communications. Now a standard TCP socket (port 33142 by default) is used, which makes deploying in a chroot environment a lot easier.

(https://newrelic.com/docs/releases/php)

This means that it cannot be used on the Heroku platform, until they re-implement UNIX-domain socket support.

@iphoting
Copy link
Owner Author

UNIX-domain socket support has been reimplemented in v3.1.5.136.

iphoting added a commit that referenced this issue Jan 20, 2013
@iphoting
Copy link
Owner Author

New Relic version 3 is now available in the newrelic/3.1 branch. It is NOT a seamless upgrade, but the breakage is limited to the lack of NR instrumentation.

Upgrade instructions:

  1. Copy the provided support/04_newrelic.ini.sample file to app_dir/conf/etc.d/04_newrelic.ini, and edit to taste.
  2. Commit, and push.
  3. Test.

Please test and report any bugs.

@ghost ghost assigned iphoting Jan 20, 2013
@larsschenk
Copy link

Bugreport - don't know if it's just me?

2013-02-18T16:38:02+00:00 heroku[slugc]: Slug compilation finished
2013-02-18T16:38:05+00:00 heroku[deployhooks]: Your New Relic account is not activated. Please make sure your agent is running: http://devcenter.heroku.com/articles/newrelic
2013-02-18T16:38:05+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-02-18T16:38:05+00:00 heroku[web.1]: Starting process with command `sh boot.sh`
2013-02-18T16:38:06+00:00 app[web.1]: 2013-02-18 16:30:44 [22/main] always: New Relic local daemon version 2.9.5.30/C started - pid=22 background=true
2013-02-18T16:38:06+00:00 app[web.1]: Booting nginx
2013-02-18T16:38:06+00:00 app[web.1]: ==> /app/vendor/nginx/logs/access.log <==
2013-02-18T16:38:06+00:00 app[web.1]: 
2013-02-18T16:38:06+00:00 app[web.1]: ==> /app/vendor/nginx/logs/error.log <==
2013-02-18T16:38:06+00:00 app[web.1]: 
2013-02-18T16:38:06+00:00 app[web.1]: ==> /app/vendor/php/var/log/php-fpm.log <==
2013-02-18T16:38:06+00:00 app[web.1]: 
2013-02-18T16:38:06+00:00 app[web.1]: ==> /app/local/var/log/newrelic/newrelic-daemon.log <==
2013-02-18T16:38:06+00:00 app[web.1]: 
2013-02-18T16:38:06+00:00 app[web.1]: ==> /app/local/var/log/newrelic/php_agent.log <==
2013-02-18T16:38:06+00:00 app[web.1]: [18-Feb-2013 16:38:06] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
2013-02-18T16:38:06+00:00 app[web.1]: [18-Feb-2013 16:38:06] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
2013-02-18T16:38:07+00:00 heroku[web.1]: Process exited with status 143
2013-02-18T16:38:07+00:00 app[web.1]: 
2013-02-18T16:38:07+00:00 app[web.1]: ==> /app/vendor/php/var/log/php-fpm.log <==
2013-02-18T16:38:07+00:00 app[web.1]: [18-Feb-2013 16:38:06] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
2013-02-18T16:38:07+00:00 app[web.1]: [18-Feb-2013 16:38:06] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
2013-02-18T16:38:07+00:00 app[web.1]: [18-Feb-2013 16:38:06] NOTICE: fpm is running, pid 23
2013-02-18T16:38:07+00:00 app[web.1]: [18-Feb-2013 16:38:06] NOTICE: ready to handle connections
2013-02-18T16:38:07+00:00 app[web.1]: 
2013-02-18T16:38:07+00:00 app[web.1]: ==> /app/local/var/log/newrelic/newrelic-daemon.log <==
2013-02-18T16:38:07+00:00 app[web.1]: 2013-02-18 16:38:06 [22/main] always: New Relic local daemon version 2.9.5.30/C started - pid=22 background=true
2013-02-18T16:38:07+00:00 app[web.1]: ==> /app/local/var/log/newrelic/php_agent.log <==
2013-02-18T16:38:07+00:00 app[web.1]: 2013-02-18 16:38:06.682 (21/main) info: New Relic 3.1 (release build 137 - "beatific") [daemon='/tmp/.newrelic.sock' php='5.4.11' zts=no sapi='fpm-fcgi' backtrace=yes os='Linux' rel='2.6.32-350-ec2' mach='x86_64' ver='#57-Ubuntu SMP Thu Nov 15 15' node='79c248bc-b876-4b3b-8e56-984911590d3a' startup=agent code=0x0x7fd5c02ae2b0 data=0x0x7fd5c06eede0]
2013-02-18T16:38:07+00:00 app[web.1]: 2013-02-18 16:38:06.682 (21/main) warning: couldn't find daemon='/usr/bin/newrelic-daemon' (ENOENT)
2013-02-18T16:38:07+00:00 app[web.1]: 2013-02-18 16:38:06.682 (21/main) info: New Relic PHP Agent globally disabled
2013-02-18T16:38:08+00:00 heroku[web.1]: State changed from starting to up

and before that one I once had:

2013-02-18T16:30:44+00:00 app[web.1]: PHP:  syntax error, unexpected BOOL_TRUE in /app/vendor/php/etc.d/04_newrelic.ini on line 5

@iphoting
Copy link
Owner Author

Post your newrelic.ini please?

@larsschenk
Copy link

; Enable newrelic
; /conf/etc.d/04_newrelic.ini
extension=newrelic.so

newrelic.appname = WordPress
newrelic.enabled = 1
newrelic.logfile = /app/local/var/log/newrelic/php_agent.log
newrelic.loglevel = none
newrelic.browser_monitoring.auto_instrument = 1

I tried branch development and newrelic/3.1. NewRelic addon is installed.
What is about the "warning: couldn't find daemon='/usr/bin/newrelic-daemon' (ENOENT)" error?

@iphoting
Copy link
Owner Author

The couldn't find error is specific to newrelic v3—new config file required; see instructions in this issue above.

@larsschenk
Copy link

from phpinfo:
New Relic Version 3.1.5.137 ("beatific")

; Enable newrelic
extension=newrelic.so

newrelic.license = "4448e....ec"
newrelic.appname = "PHP Application"
newrelic.enabled = 1
newrelic.logfile = "/app/local/var/log/newrelic/php_agent.log"
newrelic.loglevel = "info"
newrelic.framework = "wordpress"
newrelic.daemon.location = "/app/local/bin/newrelic-daemon"
newrelic.browser_monitoring.auto_instrument = 1

results into:

2013-02-19 02:23:42.909 (19/main) warning: failed (err=2/ENOENT) to connect to the daemon. If this problem persists please contact [email protected]. You may see this message repeated for each Apache / FPM worker process. Please do not consider these multiple failures.

heroku config

NEW_RELIC_APP_NAME:    PHP Application
NEW_RELIC_ID:          26nnnn
NEW_RELIC_LICENSE_KEY: 4448e.....ec
NEW_RELIC_LOG:         stdout

NEW_RELIC_VERSION not set!? (required?)
Haven't checked if I have a newrelic.cfg (for the daemon).

@iphoting
Copy link
Owner Author

Hmm I think I need to re-engineer newrelic 3.x support.

Fall-back to v2 for now and KIV this.

@larsschenk
Copy link

Fall-back to v2 and newrelic is working now. Thanks anyway. Will keep an eye on this and continue testing with v3 if you give me a go.

iphoting added a commit that referenced this issue Feb 21, 2013
iphoting added a commit that referenced this issue Feb 21, 2013
@sumkincpp
Copy link

just to confirm: new version of newrelic 3.2.* works as expected, thanks!

@iphoting
Copy link
Owner Author

I am currently still uncomfortable with newrelic 3.2. Please consider it as alpha and work-in-progress, and do NOT use it in production.

I suggest if you want to keep testing this, please append the commit id, i.e. #50fc89e, to the end of the BUILDPACK_URL instead of #newrelic/3.1. This should at least protect you from unexpected breaking changes that I might introduce in the coming weekends to get this working.

@iphoting
Copy link
Owner Author

Ok, I've redone new-relic support slightly. Please test using commit 468af70. Be sure to use the latest 04_newrelic.ini sample from the support folder in this buildpack (at that commit id).

Please let me know of any weird behaviour. I've smoke tested it for a few times and I don't see any errors in the logs.

iphoting added a commit that referenced this issue Mar 4, 2013
iphoting added a commit that referenced this issue Apr 18, 2013
iphoting added a commit that referenced this issue May 30, 2013
iphoting added a commit that referenced this issue Aug 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants