A symfony1 plugin to instrument web requests, CLI tasks, and Doctrine queries in a symfony1 application.
More details on Scout APM can be found on their website, docs, and scout-apm-php readme.
- Install plugin via composer
composer require waytohealth/scout-apm-plugin
Note: This will install the plugin at plugins/scoutApmPlugin
(not in vendor/
as is typically the case with composer dependencies). You may need to adjust your gitignore accordingly.
- Enable the plugin in project configuration:
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
parent::setup();
// Add the below line:
$this->enablePlugins('scoutApmPlugin');
}
}
- Set up environment variables, as documented in the Scout APM PHP docs.
SCOUT_KEY=xxxxxxx
SCOUT_MONITOR=true
SCOUT_NAME="Your application (production)"
SCOUT_REVISION_SHA=xxxxxxx
The exact mechanism will depend on your deployment environment. In our application, we use vlucas/phpdotenv to make variables in .env
files available to getenv()
. If your deployment environment doesn't natively support environment variables, either install a library such as vlucas/phpdotenv
or open a PR to this repo enabling configuration of ScoutAPM using \Scoutapm\Config::fromArray
.