PHP code example of pccomponentes / apm-guzzle

1. Go to this page and download the library: Download pccomponentes/apm-guzzle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pccomponentes / apm-guzzle example snippets



declare(strict_types=1);

$apmMiddleware = PcComponentes\ElasticAPM\GuzzleHttp\ElasticApmMiddleware::trace(
    $apmTracer, /** \ZoiloMora\ElasticAPM\ElasticApmTracer instance. */
);

$handler = GuzzleHttp\HandlerStack::create();
$handler->push($apmMiddleware);

$config = [
    'handler' => $handler,
];

$client = new GuzzleHttp\Client($config);