Created
June 27, 2014 13:29
-
-
Save pleckey/be76f5e38a5093f6873f to your computer and use it in GitHub Desktop.
Transaction naming using App::before
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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