NewRelic-Alternative zur Überwachung der Laravel-Oktanzahl

PHPz
Freigeben: 2024-08-29 22:30:38
Original
851 Leute haben es durchsucht

I recently had the opportunity to discuss the adoption of Inspector by a team of developers based in Brazil. At the time they were using NewRelic to monitor their applications, but found that it was not compatible with Laravel Octane.

Ever since Laravel Octane was released I have thoroughly studied its internal dynamics to make sure that Inspector Laravel package continues to work as usual. Due to its characteristics I always suspected that Octane could cause a lot of headaches for “infrastructure oriented” monitoring platforms.

Let me give you some technical details.

Laravel Octane in a brief

Laravel Octane is a high-performance application server for Laravel, designed to significantly boost the performance of Laravel applications. It was introduced in Laravel 8.x and provides a way to serve Laravel applications using high-performance application servers like Swoole and RoadRunner.

As the official documentation says:

Octane boots your application once, keeps it in memory, and then feeds it requests at supersonic speeds.

Your Laravel application runs inside a long-running process which can create problems for the monitoring agents installed on your machine to know what is happening inside it.

Inspector to monitor Laravel Octane

This is a perfect example to understand why Inspector "is built for developers".

To connect your application with Inspector you only need the Laravel package. You don't need any interaction with the underlying infrastructure. It doesn’t matter how your application is running, Inspector is integrated with your framework, not with the server.

How easy is it?

Afterinstalling the packageyou should attach the Octane specialized middleware to the application routes:

Laravel 11

use \Inspector\Laravel\Middleware\InspectorOctaneMiddleware; return Application::configure(basePath: dirname(__DIR__)) ->withRouting( // routes ) ->withMiddleware(function (Middleware $middleware) { // Append the middleware $middleware->appendToGroup('web', InspectorOctaneMiddleware::class) ->appendToGroup('api', InspectorOctaneMiddleware::class); }) ->withExceptions(function (Exceptions $exceptions) { // })->create();
Nach dem Login kopieren

Laravel <= 10

/** * The application's route middleware groups. * * @var array */ protected $middlewareGroups = [ 'web' => [ ..., //\Inspector\Laravel\Middleware\WebRequestMonitoring::class, \Inspector\Laravel\Middleware\InspectorOctaneMiddleware::class, ], 'api' => [ ..., //\Inspector\Laravel\Middleware\WebRequestMonitoring::class, \Inspector\Laravel\Middleware\InspectorOctaneMiddleware::class, ], ]

That's it.

Your application will continue to be monitored as usual.

NewRelic Alternative For Monitoring Laravel Octane

Other NewRelic bottlenecks

The team of Brazilian devs delved even deeper into the motivations that drove them to look for valid alternatives to NewRelic.

They wanted to monitor other internal applications as well. Applications that are less critical but for which the company would benefit from real-time monitoring data.

The problem was the complexity of making NewRelic at work on other applications and even more problematic was the big increase in costs.

Costs to monitor other hosts, costs to share the monitoring environment with other users, and the complexity to configure and use the platform.

For me it was a revealing discussion. I had never heard all these details about the various use cases in which Inspector provides a design and pricing policy much more convenient than platforms aimed at large corporations.

So, thank you guys, I'm happy to collaborate with such open minded developers like you. The Inspector community continues to grow.

Monitor your PHP application for free

Inspector is a Code Execution Monitoring tool specifically designed for software developers. You don't need to install anything at the server level, just install thecomposer packageand you are ready to go.

Inspector is super easy and PHP friendly. You can try our Laravel or Symfony package.

If you are looking for HTTP monitoring, database query insights, and the ability to forward alerts and notifications into your preferred messaging environment, try Inspector for free. Register your account.

Or learn more on the website: https://inspector.dev

NewRelic Alternative For Monitoring Laravel Octane

Das obige ist der detaillierte Inhalt vonNewRelic-Alternative zur Überwachung der Laravel-Oktanzahl. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!

Quelle:dev.to
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!