neeckeloo/NewRelic — pull request #4 by bnkr (2014-01-15 12:01:10+00:00)
Title: Setting application_name to null disables calling newrelic_set_appname

This patch means that when the ! (bool) newrelic.application_name, the RequestListener will not call client.setAppName.

On our newrelic deployment we found that setting the appname in a module handler sometimes got called after the controller ran, which mean that all the metrics for that transaction would be discarded. It also meant we lost any errors or warnings that were reported. (Further, I guess that setting in an event listener at all would always result in some lost profiling time and I'd like to see the full time of the framework as well as the controller).

I didn't really work out exactly why this happened. I suspect it could be do with other events I bound to and that I don't use layouts everywhere. The version of php running also seemed to make a difference.

It seems more simple to set the appname in the php or virtualhost configuration for my purposes anyway since this is more likely to compare properly against non-zend scripts.

Note that I am testing this principle on an affected production deployment by replacing the Client factory to return a Client which ignores an empty application name so this exact patch is not in use. If you'd like me to do more testing I'd be happy to do so, but I'm limited in what I can change on that particular server.