Most APMs in the PHP ecosystem automatically track requests and errors. However, if you implement background jobs, you might need to manually track them, especially if one PHP process runs multiple jobs. This project might help you. :)
This package is work in progress and might never be production ready.
You can install the package via composer:
composer require suora/apm-wrapper
$profiler = new \Suora\ApmWrapper\Profiler\AutoTideways(
'your-token',
'workerpool'
);
foreach ($jobs as $job) {
$profiler->startTransaction($job->getName());
$profiler->addParameter('jobId', $job->getId());
$job->run();
$profiler->endTransaction();
}
composer test
Please see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.