Code Monkey home page Code Monkey logo

laravel-newrelic's People

Contributors

alies-dev avatar altrim avatar andrioli avatar apancutt avatar bryceray1121 avatar danhunsaker avatar danwall avatar daper avatar emmanuelgautier avatar hootlex avatar lukewaite avatar mosanger avatar paunin avatar philonl avatar pleckey avatar tomschlick avatar weotch avatar wins1908 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-newrelic's Issues

tag queue support

Hello,
the support of queue ais nice, could you tag it, to make it usable?

thanks

Laravel not showing events

Hi, I followed all the instructions and set the configuration as
'auto_name_transactions' => true

but NewRelic only tracks background processes and errors. And nothing else.
I only have an API (to communicate with my app) and the routes are defined as this:

Route::controller('/api', 'ApiController');

Any thoughts?

Not working in Lumen 5.4

I've published the config file, added the Middleware, registered the ServiceProvider and added the Newrelic facade. However none of my "Transactions" are being recorded in APM. There are no errors in my application when I check my log files.

Transactions not showing up

Setting the app name in an App::before() closure seems to work (I can see all my app names in the New Relic panel) but none of the apps have any transactions.

I already tried setting the $xmit parameter to true while setting the app name but that doesn't seem to help.

Any ideas?

Error while installing the package

I just created a Laravel 5 project and added this library, now when I run php artisan I get this error:

[BadMethodCallException]
Method after does not exist.

Laravel 5.2 support

There is no more Illuminate\Routing\Router::before filter, it was deprecated in 5.1 and removed in 5.2. So NewrelicServiceProvider::registerNamedTransactions is broken.

Support Laravel 7

There is a "illuminate/support": "5.*" dependency that doesn't allow to install package for Laravel 7 projects

Problem with different router

Hello,

I'm using dingo/api as my default router. It only pushes POST index.php, GET index.php, PUT index.php to Newrelic. I've seen your library and wanted to use for fixing this issue. But it threw another exception. Here is the trace is below.

So, i know that you dont support for dingo/api or another custom provider. But any help would be appreciated.

Thanks.

Stack trace:
#0 /var/www/vendor/intouch/laravel-newrelic/src/Intouch/LaravelNewrelic/NewrelicServiceProvider.php(102): Intouch\LaravelNewrelic\NewrelicServiceProvider->getPath()
#1 /var/www/vendor/intouch/laravel-newrelic/src/Intouch/LaravelNewrelic/NewrelicServiceProvider.php(78): Intouch\LaravelNewrelic\NewrelicServiceProvider->getTransactionName()
#2 /var/www/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(348): Intouch\LaravelNewrelic\NewrelicServiceProvider->Intouch\LaravelNewrelic\{closure}(Object(Illuminate\Routing\Events\RouteMatched))
#3 /var/www/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(199): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}('Illuminate\\Rout...', Array)
#4 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(533): Illuminate\Events\Dispatcher->dispatch('Illuminate\\Rout...')
#5 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(513): Illuminate\Routing\Router->dispatchToRoute(Object(Dingo\Api\Http\Request))
#6 /var/www/vendor/dingo/api/src/Routing/Adapter/Laravel.php(81): Illuminate\Routing\Router->dispatch(Object(Dingo\Api\Http\Request))
#7 /var/www/vendor/dingo/api/src/Routing/Router.php(503): Dingo\Api\Routing\Adapter\Laravel->dispatch(Object(Dingo\Api\Http\Request), 'v1')
#8 /var/www/vendor/dingo/api/src/Http/Middleware/Request.php(126): Dingo\Api\Routing\Router->dispatch(Object(Dingo\Api\Http\Request))
#9 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(114): Dingo\Api\Http\Middleware\Request->Dingo\Api\Http\Middleware\{closure}(Object(Dingo\Api\Http\Request))
#10 /var/www/vendor/barryvdh/laravel-cors/src/HandleCors.php(36): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Dingo\Api\Http\Request))
#11 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Barryvdh\Cors\HandleCors->handle(Object(Dingo\Api\Http\Request), Object(Closure))
#12 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Dingo\Api\Http\Request))
#13 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Dingo\Api\Http\Request), Object(Closure))
#14 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Dingo\Api\Http\Request))
#15 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Dingo\Api\Http\Request), Object(Closure))
#16 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Dingo\Api\Http\Request))
#17 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Dingo\Api\Http\Request), Object(Closure))
#18 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Dingo\Api\Http\Request))
#19 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Dingo\Api\Http\Request), Object(Closure))
#20 /var/www/app/Http/Middleware/ContentManipulateMiddleware.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Dingo\Api\Http\Request))
#21 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): App\Http\Middleware\ContentManipulateMiddleware->handle(Object(Dingo\Api\Http\Request), Object(Closure))
#22 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Dingo\Api\Http\Request))
#23 /var/www/vendor/dingo/api/src/Http/Middleware/Request.php(127): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#24 /var/www/vendor/dingo/api/src/Http/Middleware/Request.php(103): Dingo\Api\Http\Middleware\Request->sendRequestThroughRouter(Object(Dingo\Api\Http\Request))
#25 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Dingo\Api\Http\Middleware\Request->handle(Object(Dingo\Api\Http\Request), Object(Closure))
#26 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#27 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#28 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(149): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#29 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#30 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php(234): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#31 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php(57): Illuminate\Foundation\Testing\TestCase->call('GET', '/api/v1/health-...', Array, Array, Array, Array)
#32 /var/www/tests/Feature/Api/ApiStatusCheckTest.php(14): Illuminate\Foundation\Testing\TestCase->get('/api/v1/health-...')
#33 [internal function]: Tests\Feature\Api\ApiStatusCheckTest->testExample()
#34 /var/www/vendor/phpunit/phpunit/src/Framework/TestCase.php(1054): ReflectionMethod->invokeArgs(Object(Tests\Feature\Api\ApiStatusCheckTest), Array)
#35 /var/www/vendor/phpunit/phpunit/src/Framework/TestCase.php(905): PHPUnit_Framework_TestCase->runTest()
#36 /var/www/vendor/phpunit/phpunit/src/Framework/TestResult.php(686): PHPUnit_Framework_TestCase->runBare()
#37 /var/www/vendor/phpunit/phpunit/src/Framework/TestCase.php(860): PHPUnit_Framework_TestResult->run(Object(Tests\Feature\Api\ApiStatusCheckTest))
#38 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(722): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult))
#39 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(517): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#40 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(186): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array, true)
#41 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(116): PHPUnit_TextUI_Command->run(Array, true)
#42 /var/www/vendor/phpunit/phpunit/phpunit(52): PHPUnit_TextUI_Command::main()
#43 {main}  

Lumen support

Do you have plan to support Lumen ?

Currently it does not work because of NewrelicServiceProvider and $app['router'] usage.

[Request] Enable/Disable based upon environment config.

It'd be great to conditionally load the service provider based on an environment variable, that way avoiding the

 [BadMethodCallException]
  Method after does not exist.

error that shows up when this is installed without the New Relic PHP agent being installed.

Fatal error on PHP 5.3

PHP Fatal error: Using $this when not in object context in F:\projects\Altitude
\Altitude-Core\vendor\intouch\laravel-newrelic\src\Intouch\LaravelNewrelic\Larav
elNewrelicServiceProvider.php on line 84

Argument 1 passed to NewrelicServiceProvider must be an instance of JobProcessed, JobProcessing given

Symfony\Component\Debug\Exception\FatalThrowableError: Argument 1 passed to Intouch\LaravelNewrelic\NewrelicServiceProvider::Intouch\LaravelNewrelic{closure}() must be an instance of Illuminate\Queue\Events\JobProcessed, instance of Illuminate\Queue\Events\JobProcessing given, called in /home/www/releases/1548843103/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php on line 360 in /home/forge/interaction-design.org/releases/1548843103/vendor/intouch/laravel-newrelic/src/Intouch/LaravelNewrelic/NewrelicServiceProvider.php:95

Laravel version: 5.7.23
Package version: 2.2.1

Problem caused by a new release, PR #48

I need that folk already quick-fixed this issue on their forks, but we need a robust fix

Config file should have warning about the default settings

Thanks for the awesome package.

I stumbled upon a problematic situation with Newrelic as I ended up using the default values for 'name_provider' (=> '{uri} {route}') in the config. It's nice way to use NR with Laravel, but in high-volume + lots of changing uris, we got contacted by Newrelic and they informed us that there's "unusually large number of unique transaction names".

So how about adding additional warning or suggestion to the config file which says something like "If you have lots of different uris, drop the {uri} from the config as Newrelic doesn't recommend over 1000 transaction names"? Probably saves some work from people using your package and from Newrelic as well :)

Wrong Publish Config Artisan Command

The readme says:

php artisan publish:config intouch/laravel-newrelic

For me (using Laravel 4.2.17), I had to run:

php artisan config:publish intouch/laravel-newrelic

Not working with Laravel 5.5 & PHP 7.1 (fpm)

PHP execution trace follows...
#0 Illuminate\Routing\Router->prepareResponse() 
#1 Illuminate\Routing\Router->php-fpm: pool default (+0xe15b5)[0x7f9cd85e15b5]
PHP execution trace follows...
##2 0Illuminate\Routing\Pipeline ->Illuminate\Routing\RouterIlluminate\Routing\{closure}()->prepareResponse

Adds a new option to log errors in newrelic when laravel debug is set to false.

In order to make the errors appear in the Newrelic dashboard when the debug is set to false I need to add the follow snippet to the app/start/global.php file:

App::error(function(Exception $exception, $code)
{
    Log::error($exception);
    if (App::environment('production'))
    {
        $newrelic = new Intouch\Newrelic\Newrelic;
        $newrelic->noticeError($exception);
    }

});

What you think about this be done behind the scenes and bring this as a new option in the package config file?

Automatic transaction names

Since Laravel 4.1 and the getCurrentRouteName() confusion in other issues I have also noticed another problem and would like to start a discussion on improving this functionality.

In 4.0, currentRouteName() used to return either the name of the route (e.g. "home") or the HTTP verb followed by the request path (e.g. "get /"). This would work on both controller methods as well as route closures.

In 4.1, this functionality has been changed so that currentRouteName() returns either the route name (e.g. "home") or null. If a route name is not defined, it returns null - this is the case for both controllers and route closures.

Request::path() returns the current requests path, without the HTTP verb.

Route::currentRouteAction() returns the controller method in the format "HomeController@getIndex" which is my preferred method as it does not rely on the route being named. One caveat with this is that it also returns null on route closures.

Perhaps we could have some sort of fallback if currentRouteAction() returns null, we then use Request::path()?

These are just my thoughts, would love to hear feedback from others.

Not working in Laravel 5.4

Call to undefined method Illuminate\Foundation\Application::share()
in Intouch/LaravelNewrelic/NewrelicServiceProvider.php line 54

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.