Download the PHP package wizaplace/elastic-apm-wrapper without Composer
On this page you can find all versions of the php package wizaplace/elastic-apm-wrapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wizaplace/elastic-apm-wrapper
More information about wizaplace/elastic-apm-wrapper
Files in wizaplace/elastic-apm-wrapper
Package elastic-apm-wrapper
Short Description Wizaplace Elastic APM Wrapper
License MIT
Homepage https://github.com/wizaplace/elastic-apm-wrapper
Informations about the package elastic-apm-wrapper
Elastic APM Wrapper
PHP Wrapper to send Logs to Elastic APM
Installation
The recommended way to install the wrapper is through Composer.
Run the following composer command:
Configuration
Communication with Elastic APM is managed by elastic-apm-php-agent (\PhilKra\Agent).
In order to instantiate the service using this agent, you have to provide several parameters :
appName
(e.g. 'Wizaplace')appVersion
(e.g. '1.0.0')environment
(e.g. 'Development', 'Production')serverUrl
APM Server EndpointsecretToken
Secret token for your Elastic APM Servertimeout
Guzzle Client timeout
Usage
Transaction
Transactions are the highest level of work you’re measuring within a service, like a request to your server. The main idea is that you monitor one transaction at a time: your PHP script being executed.
To start a transaction, you need to use the method within AgentService.php. It should be stopped (using ) at the very end of the application you're monitoring. Ideally, you wil start the transaction at the beginning of each entry point of your application and stop it at the end of each.
Spans
Spans can be seen as 'sub-transactions', meaning they are used to help to watch parts of your application.
A new span can be started as one or several spans are already started. It is important to stop manually all the spans you started otherwise they will be closed automatically meaning you won't really get accurate data.
Within one transaction there can be 0-* spans captured.
Apm Handler
A custom Monolog handler (ApmHandler.php
) has been included to this package, enabling you to send data to the APM automatically when Monolog is called.
This configuration is optional.
Licence
This library is distributed under the terms of the MIT licence.