Swarrot processor to send data to stastd with M6Web/StatsdBundle.
Open a command console, enter your project directory and execute:
$ composer require hexanet/swarrot-statsd-bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require hexanet/swarrot-statsd-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Hexanet\SwarrotStatsdBundle\HexanetSwarrotStatsdBundle(),
);
// ...
}
// ...
}
In your config.yml
file, you could add a middleware processor which is going to send events to use my M6Web/StatsdBundle.
swarrot:
consumers:
eligibility:
processor: processor.eligibility
middleware_stack:
- configurator: hexanet_swarrot_statsd.processor.statsd
extras:
name: eligibility
- configurator: swarrot.processor.ack
populate_ticket:
processor: processor.populate_ticket
middleware_stack:
# no extra data with message name so the queue name is used instead
- configurator: hexanet_swarrot_statsd.processor.statsd
- configurator: swarrot.processor.ack
m6_statsd:
clients:
default:
servers: ['default']
events:
swarrot_statsd.message.success:
increment: "si.eligibility-service.message.<messageName>.success"
timing: "si.eligibility-service.message.<messageName>"
swarrot_statsd.message.error:
increment: "si.eligibility-service.message.<messageName>.error"
timing: "si.eligibility-service.message.<messageName>"
immediate_send: true
Developed by Hexanet.
SwarrotStatsdBundle is licensed under the MIT license.