Feature/updated hooks merge to 1 x stable

Ports #692 to 1-x-stable so we can use New Relic.