Skip to content

Instantly share code, notes, and snippets.

@pleckey
Created June 27, 2014 13:29
Show Gist options
  • Save pleckey/be76f5e38a5093f6873f to your computer and use it in GitHub Desktop.
Save pleckey/be76f5e38a5093f6873f to your computer and use it in GitHub Desktop.
Transaction naming using App::before
App::before(function($request){
$nameProvider = Config::get('laravel-newrelic::name_provider');
if ( is_callable($nameProvider) ) {
$name = $nameProvider( $request, null, $app );
} else {
$name = Route::currentRouteName()
?: Route::current() && Route::currentRouteAction()
?: $request->getMethod . ' ' . $request->getPathInfo();
}
Newrelic::nameTransaction( $name );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment