From c42b0529ddebcd95ea3734d1d12014c104808934 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 5 Mar 2016 19:15:21 +0000 Subject: Support changing the port and host to export metrics on --- prometheus_haproxy_log_exporter/cli.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/prometheus_haproxy_log_exporter/cli.py b/prometheus_haproxy_log_exporter/cli.py index 24e085d..db6357f 100644 --- a/prometheus_haproxy_log_exporter/cli.py +++ b/prometheus_haproxy_log_exporter/cli.py @@ -49,6 +49,20 @@ def get_argument_parser(): env_var='CONFIG', ) + p.add( + '--port', + default='9129', + help="Port on which to expose metrics", + type=int, + env_var='PORT', + ) + p.add( + '--host', + default='0.0.0.0', + help="Host on which to expose metrics", + env_var='HOST', + ) + p.add( '--licence-location', default=join(dirname(dirname(normpath(__file__))), 'LICENSE'), @@ -243,8 +257,8 @@ def main(): log_processor = create_log_processor(options, p.error) log_processor.start() - host = '0.0.0.0' - port = 9129 + host = options.host + port = options.port httpd = HTTPServer( (host, port), -- cgit v1.2.3