Download the PHP package bethinkpl/elastic-apm-laravel without Composer

On this page you can find all versions of the php package bethinkpl/elastic-apm-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package elastic-apm-laravel

PHP Elastic APM for Laravel & Lumen

Laravel package of the https://github.com/philkra/elastic-apm-php-agent library, automatically handling transactions and errors/exceptions. If using Illuminate\Support\Facades\Auth the user Id added to the context. Tested with Laravel 6.* and the philkra/elastic-apm-php-agent version 7.x.

Install

Use local code in wnl-platform instead of a released package

Make sure to use absolute paths.

Additional features

Middleware

Laravel

Register as (e.g.) global middleware to be called with every request. https://laravel.com/docs/5.6/middleware#global-middleware

Register the middleware in app/Http/Kernel.php

Lumen

In bootstrap/app.php register PhilKra\ElasticApmLaravel\Middleware\RecordTransaction::class as middleware:

Service Provider

Laravel

No need to register service provider manually. It is registered automatically by package discovery.

Lumen

In bootstrap/app.php register \PhilKra\ElasticApmLaravel\Providers\ElasticApmServiceProvider::class as service provider:

Spans

Laravel

A Transaction object is made available via the dependency container and can be used to start a new span at any point in the application. The Span will automatically add itself to the Transaction when it is ended.

Lumen

pending

Error/Exception Handling

Laravel

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

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

Lumen

not tested yet.

Agent Configuration

Laravel

The following environment variables are supported in the default configuration:

Variable Description
APM_ACTIVE true or false defaults to true. If false, the agent will collect, but not send, transaction data.
APM_APPNAME Name of the app as it will appear in APM.
APM_APPVERSION Version of the app as it will appear in APM.
APM_SERVERURL URL to the APM intake service.
APM_SECRETTOKEN Secret token, if required.
APM_APIVERSION APM API version, defaults to v1 (only v1 is supported at this time).
APM_USEROUTEURI true or false defaults to false. The default behavior is to record the URL as sent in the request. This can result in excessive unique entries in APM. Set to true to have the agent use the route URL instead.
APM_NORMALIZEURI true or false defaults to false. If enabled, removes variable parts from URI when generating transaction name (e.g. GET /foo/bar/123 is reported as GET /foo/bar/N). APM_USEROUTEURI needs to be enabled.
APM_QUERYLOG true or false defaults to 'true'. Set to false to completely disable query logging, or to auto if you would like to use the threshold feature.
APM_THRESHOLD Query threshold in milliseconds, defaults to 200. If a query takes longer then 200ms, we enable the query log. Make sure you set APM_QUERYLOG=auto.
APM_BACKTRACEDEPTH Defaults to 25. Depth of backtrace in query span.
APM_RENDERSOURCE Defaults to true. Include source code in query span.
APM_HTTPLOG Defaults to true. Will record HTTP requests performed via GuzzleHttp.
APM_SAMPLING Defaults to 100. Sets the percentage of transactions that will be reported to APM (ranges from 0 to 100).

You may also publish the elastic-apm.php configuration file to change additional settings:

Once published, open the config/elastic-apm.php file and review the various settings.

Laravel Test Setup

Laravel provides classes to support running unit and feature tests with PHPUnit. In most cases, you will want to explicitly disable APM during testing since it is enabled by default. Refer to the Laravel documentation for more information (https://laravel.com/docs/5.7/testing).

Because the APM agent checks it's active status using a strict boolean type, you must ensure your APM_ACTIVE value is a boolean false rather than simply a falsy value. The best way to accomplish this is to create an .env.testing file and include APM_ACTIVE=false, along with any other environment settings required for your tests. This file should be safe to include in your SCM.


All versions of elastic-apm-laravel with dependencies

PHP Build Version
Package Version
Requires php Version >= 7.2
illuminate/database Version ^6.0|^7|^8
illuminate/http Version ^6.0|^7|^8
illuminate/routing Version ^6.0|^7|^8
illuminate/support Version ^6.0|^7|^8
philkra/elastic-apm-php-agent Version 7.0.0-rc3
ramsey/uuid Version ^3.0|^4.0
psr/http-message Version ^1.0
guzzlehttp/guzzle Version ~6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bethinkpl/elastic-apm-laravel contains the following files

Loading the files please wait ....