rstgroup/statsd-module

There is no license information available for the latest version (1.3.0) of this package.

Statsd module for ZF2/ZF3

1.3.0 2017-12-28 09:32 UTC

This package is not auto-updated.

Last update: 2024-07-20 18:24:59 UTC


README

Module is based on domnikl/statsd-php.

Installation

Using composer:

composer require rstgroup/statsd-module

Configuration

In your Zend Framework application config add to module list

return [
    'modules' => [
        'RstGroup\\StatsdModule',
    ],
];

also in your autoload config based on enviroment add statsd client configuration

return [
    'statsd' => [
        'tcp' => [
            'host' => 'example_host',
            'port' => example_port,
            'timeout' => null,
            'persistent' => false,
            'mtu' => 1500,
        ],
        'udp' => [
            'host' => 'example_host',
            'port' => example_port,
            'timeout' => null,
            'persistent' => false,
            'mtu' => 1500,
        ],
        'namespace' => 'services.default',
        'connectionType' => 'RstGroup\Statsd\Connection\Blackhole',
    ],
];

Connection types:

  • RstGroup\Statsd\Connection\Udp
  • RstGroup\Statsd\Connection\Tcp errors will not be suppressed in this mode
  • RstGroup\Statsd\Connection\Memory in this mode sending is disabled, but messages are collected
  • RstGroup\Statsd\Connection\Blackhole in this mode sending is disabled

Usage

Typical usage from ServiceManager

$client = $serviceManager->get("RstGroup\Statsd\Client");