philkra/elastic-apm-php-agent
PHP agent for Elastic APM that instruments your application to capture transactions, spans, errors, and performance metrics. Sends telemetry to Elastic APM Server for tracing and monitoring, with support for web and CLI workloads and configurable sampling.
The following parameters can be passed to the Agent in order to apply the required configuration.
appName : Name of this application, Required
appVersion : Application version, Default: ''
serverUrl : APM Server Endpoint, Default: 'http://127.0.0.1:8200'
secretToken : Secret token for APM Server, Default: null
hostname : Hostname to transmit to the APM Server, Default: gethostname()
active : Activate the APM Agent, Default: true
timeout : Guzzle Client timeout, Default: 5
env : $_SERVER vars to send to the APM Server, empty set sends all. Keys are case sensitive, Default: ['SERVER_SOFTWARE']
cookies : Cookies to send to the APM Server, empty set sends all. Keys are case sensitive, Default: []
httpClient : Extended GuzzleHttp\Client Default: []
backtraceLimit: Depth of a transaction backtrace, Default: unlimited
Detailed GuzzleHttp\Client options can be found here.
$config = [
'appName' => 'My WebApp',
'appVersion' => '1.0.42',
'serverUrl' => 'http://apm-server.example.com',
'secretToken' => 'DKKbdsupZWEEzYd4LX34TyHF36vDKRJP',
'hostname' => 'node-24.app.network.com',
'env' => ['DOCUMENT_ROOT', 'REMOTE_ADDR', 'REMOTE_USER'],
'cookies' => ['my-cookie'],
'httpClient' => [
'verify' => false,
'proxy' => 'tcp://localhost:8125'
],
];
$agent = new \PhilKra\Agent($config);
How can I help you explore Laravel packages today?