LaravelPackages.net
Acme Inc.
Toggle sidebar
faridcs/laravel-apm

Laravel APM For Elasticsearch

17
2
4.4
About faridcs/laravel-apm

faridcs/laravel-apm is a Laravel package for laravel apm for elasticsearch. It currently has 2 GitHub stars and 17 downloads on Packagist (latest version 4.4). Install it with composer require faridcs/laravel-apm. Discover more Laravel packages by faridcs or browse all Laravel packages to compare alternatives.

Last updated

laravel-apm

PHP Elastic APM for Laravel This package is compatible with laravel >= 5.2

Install

composer require faridcs/laravel-apm

Provider and Aliases

Add this line to provider and aliases array in config/app.php

'providers' => [

        /*
         * Laravel Framework Service Providers...
         */
        // ... more provider

        faridcs\ApmLaravel\Providers\ElasticApmServiceProvider::class,
    ],
    
'aliases' => [

        // more aliases
        
        'ElasticApm' => faridcs\ApmLaravel\Facades\ElasticApm::class,
    ],

Config

php artisan vendor:publish --provider="alopeyk\ApmLaravel\Providers\ElasticApmServiceProvider" --tag="config"

Middleware

Register the middleware in app/Http/Kernel.php

protected $middleware = [
    // ... more middleware
    \faridcs\ApmLaravel\Middleware\RecordTransaction::class,
];

Error/Exception Handling

Laravel

In app/Exceptions/Handler, add the following to the report method:

ElasticApm::captureThrowable($exception);
ElasticApm::send();

Make sure to import the facade at the top of your file:

use ElasticApm;

Star History Chart