heroku-buildpack-php-tyler icon indicating copy to clipboard operation
heroku-buildpack-php-tyler copied to clipboard

Upgrade New Relic instrumentation to v3.0.

Open iphoting opened this issue 13 years ago • 13 comments
trafficstars

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

iphoting avatar Oct 24 '12 11:10 iphoting

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 avatar Oct 24 '12 11:10 iphoting

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

iphoting avatar Jan 18 '13 03:01 iphoting

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.

iphoting avatar Jan 20 '13 16:01 iphoting

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

larsschenk avatar Feb 18 '13 16:02 larsschenk

Post your newrelic.ini please?

iphoting avatar Feb 18 '13 22:02 iphoting

; 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?

larsschenk avatar Feb 19 '13 00:02 larsschenk

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

iphoting avatar Feb 19 '13 01:02 iphoting

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).

larsschenk avatar Feb 19 '13 03:02 larsschenk

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

Fall-back to v2 for now and KIV this.

iphoting avatar Feb 19 '13 04:02 iphoting

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.

larsschenk avatar Feb 19 '13 21:02 larsschenk

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

sumkincpp avatar Feb 25 '13 19:02 sumkincpp

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 avatar Feb 27 '13 04:02 iphoting

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 avatar Feb 28 '13 16:02 iphoting