Puppet Class: profile::statsd

Defined in:
modules/profile/manifests/statsd.pp

Overview

Class: role::statsd

Provisions a statsd-proxy instance that listens for StatsD metrics on UDP port 8125 and forwards to backends on UDP ports 8126+, as well as the set of statsite backends that listen on these ports.

Parameters:

  • graphite_host (Stdlib::Host) (defaults to: lookup('graphite_host'))


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
60
61
62
63
64
65
66
67
68
# File 'modules/profile/manifests/statsd.pp', line 7

class profile::statsd (
    Stdlib::Host   $graphite_host = lookup('graphite_host'),
){

    class { '::statsd_proxy':
        server_port   => 8125,
        backend_ports => range(8126, 8131),
    }

    nrpe::monitor_service { 'statsd-proxy':
        description  => 'statsd-proxy process',
        nrpe_command => '/usr/lib/nagios/plugins/check_procs -c 1: -C statsd-proxy',
        notes_url    => 'https://wikitech.wikimedia.org/wiki/Statsd',
    }

    # load balancer frontend, backend ports 8126-8131 are only accessed from localhost
    ferm::service { 'statsd':
        proto   => 'udp',
        port    => '8125',
        notrack => true,
        srange  => '$DOMAIN_NETWORKS',
    }

    class { '::statsite': }

    # statsite backends
    statsite::instance { '8126':
        port          => 8126,
        graphite_host => $graphite_host,
        input_counter => "statsd.${::hostname}-8126.received",
    }

    statsite::instance { '8127':
        port          => 8127,
        graphite_host => $graphite_host,
        input_counter => "statsd.${::hostname}-8127.received",
    }

    statsite::instance { '8128':
        port          => 8128,
        graphite_host => $graphite_host,
        input_counter => "statsd.${::hostname}-8128.received",
    }

    statsite::instance { '8129':
        port          => 8129,
        graphite_host => $graphite_host,
        input_counter => "statsd.${::hostname}-8129.received",
    }

    statsite::instance { '8130':
        port          => 8130,
        graphite_host => $graphite_host,
        input_counter => "statsd.${::hostname}-8130.received",
    }

    statsite::instance { '8131':
        port          => 8131,
        graphite_host => $graphite_host,
        input_counter => "statsd.${::hostname}-8131.received",
    }
}