Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 540 Bytes

agent-instantiate.md

File metadata and controls

26 lines (20 loc) · 540 Bytes

Agent instantiate

<?php

use ZoiloMora\ElasticAPM\Configuration\CoreConfiguration;
use ZoiloMora\ElasticAPM\ElasticApmTracer;
use ZoiloMora\ElasticAPM\Pool\Memory\MemoryPoolFactory;
use ZoiloMora\ElasticAPM\Reporter\ApmServerCurlReporter;

$configuration = CoreConfiguration::create([
    'appName' => 'service-name',
]);

$reporter = new ApmServerCurlReporter(
    'http://apm-server:8200'
);

$poolFactory = MemoryPoolFactory::create();

$agent = new ElasticApmTracer(
    $configuration,
    $reporter,
    $poolFactory
);