ekino/EkinoNewRelicBundle — pull request #45 by Nyholm (2013-12-12 11:01:48+00:00)
Title: [Bugfix] Wrong transactions reported when using Symfony's HTTP cache and ESI

I'm using Symfony's HTTP cache and I do not have any other reverse proxy caches (like Varnish) in front of my application. I've noticed that those pages that are using ESI was under represented new relic transactions. In fact, I had more ESI subrequest than main requests.

I have one request called "startpage" and within that request it calls a subrequest to "mainMenu". The mainMenu request still has *requestType() = HttpKernelInterface::MASTER_REQUEST*... So what happens is that the two requests are merged into one transaction that will be named "mainMenu" (or what ever ESI request that is executed last).

With this PR you may specify that you are using Symfony's HTTP cache and the bundle will be running newrelic_start_transaction() and newrelic_end_transaction() on incoming requests and outgoing responses respectively. Now will the different ESI requests be logged as different transactions.

I don't want this to be enabled by default because there is some execution time that we are missing. It is the code in the Kernel and the other event listeners that is executed before our RequestListener executes.