Use statsd in logstash client

Have the log-gearman-client (aka jenkins-log-client) initialize
the statsd parameters when starting the geard server.  Also, make
sure that the python statsd package is installed on the host.

Change-Id: I04fe1a7609f08bc710891b6a3b92d0f4d156d86c
This commit is contained in:
James E. Blair 2014-02-24 15:34:48 -08:00
parent 158cbf0e4e
commit fdc0ec232d
2 changed files with 13 additions and 1 deletions

View File

@ -148,7 +148,13 @@ class Server(object):
self.processors.append(processor) self.processors.append(processor)
def main(self): def main(self):
self.gearserver = gear.Server() statsd_host = os.environ.get('STATSD_HOST')
statsd_port = int(os.environ.get('STATSD_PORT', 8125))
statsd_prefix = os.environ.get('STATSD_PREFIX', 'logstash.geard')
self.gearserver = gear.Server(
statsd_host=statsd_host,
statsd_port=statsd_port,
statsd_prefix=statsd_prefix)
self.setup_processors() self.setup_processors()
for processor in self.processors: for processor in self.processors:

View File

@ -40,6 +40,12 @@ class log_processor (
require => Class['pip'], require => Class['pip'],
} }
package { 'statsd':
ensure => latest,
provider => 'pip',
require => Class['pip'],
}
file { '/var/lib/crm114': file { '/var/lib/crm114':
ensure => directory, ensure => directory,
owner => 'logstash', owner => 'logstash',