Puppet Class: statsd_proxy

Defined in:
modules/statsd_proxy/manifests/init.pp

Overview

Class: statsd_proxy

statsd-proxy is a StatsD-compatible proxy which routes metrics to multiple local UDP ports. It consistently hashes metrics uses Ketama and is built for high-performance.

Parameters

server_port

UDP port to listen on. Example: 9001.

backend_ports

Array of local UDP ports to which incoming metrics should be routed. Example: [ 9002, 9003, 9004 ].

threads

Number of threads to spawn. Defaults to 4.

socket_receive_bufsize

SO_RCVBUF size. Defaults to 6M. (Kernel will ultimately double this value per socket(7))

Examples

# Listen on UDP port 9001 and route to ports 9002-9004:
class { 'statsd_proxy':
  server_port   => 9001,
  backend_ports => [ 9002, 9003, 9004 ],
}

Parameters:

  • server_port (Stdlib::Port)
  • backend_ports (Array[Stdlib::Port])
  • ensure (Wmflib::Ensure) (defaults to: present)
  • threads (Integer) (defaults to: 4)
  • socket_receive_bufsize (Integer) (defaults to: 6291456)


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'modules/statsd_proxy/manifests/init.pp', line 31

class statsd_proxy(
    Stdlib::Port        $server_port,
    Array[Stdlib::Port] $backend_ports,
    Wmflib::Ensure      $ensure                 = present,
    Integer             $threads                  = 4,
    Integer             $socket_receive_bufsize = 6291456,
) {

    package { 'statsd-proxy':
        ensure => $ensure,
    }

    file { '/etc/statsd-proxy.cfg':
        ensure  => $ensure,
        content => template('statsd_proxy/statsd-proxy.cfg.erb'),
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
    }

    service { 'statsd-proxy':
        ensure    => ensure_service($ensure),
        enable    => $ensure == 'present',
        provider  => $::initsystem,
        subscribe => [
            Package['statsd-proxy'],
        ],
    }
}