Symfony bundle SRFDatadogStatsDBundle
integrates the datadog StatsD API to Symonfy
Get the Bundle
Choose your version from packagist.org and add a requirement to your composer.json
:
Using the console:
php composer.phar require mmz-srf/srf-datadog-statsd-bundle
Composer will add the dependency to your configuration.
Register the Bundle
Add the bundle in your app/AppKernel.php
like this:
public function registerBundles()
{
$bundles[] = new SRF\Bundles\SRFDatadogStatsDBundle\SRFDatadogStatsDBundle();
}
Update your dependencies
Run php composer.phar update mmz-srf/srf-datadog-statsd-bundle
Clear the caches
Run php app/console cache:clear
Usage
- Log to Monolog:*
$this->container->get('srf.metrics.consumer.monolog')->timing('my.key', 4);
- Log to Datadog StatsD:*
$this->container->get('srf.metrics.consumer.datadog')->timing('my.key', 4);
The Bundle is licensed under MIT. For details, see LICENSE.
Maintained by @ymc-pabu