From 0a0b13c04bc57e2cfcd0e4bdbc46ac7e312e5b33 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 24 Feb 2014 15:34:48 -0800 Subject: [PATCH] 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 --- log_processor/client.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/log_processor/client.py b/log_processor/client.py index 0f36649..a472c19 100644 --- a/log_processor/client.py +++ b/log_processor/client.py @@ -148,7 +148,13 @@ class Server(object): self.processors.append(processor) 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() for processor in self.processors: