aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2016-03-05 19:15:21 +0000
committerChristopher Baines <mail@cbaines.net>2016-03-05 19:15:21 +0000
commitc42b0529ddebcd95ea3734d1d12014c104808934 (patch)
treedbfa9b0f3f4828f6ac572ee3bfb951b15e9156ed
parentb7e3267134a7602c261fc2e5a30e2cb34bb5bd0f (diff)
downloadprometheus-haproxy-log-exporter-c42b0529ddebcd95ea3734d1d12014c104808934.tar
prometheus-haproxy-log-exporter-c42b0529ddebcd95ea3734d1d12014c104808934.tar.gz
Support changing the port and host to export metrics on
-rw-r--r--prometheus_haproxy_log_exporter/cli.py18
1 files 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
@@ -50,6 +50,20 @@ def get_argument_parser():
)
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'),
help="The location of the licence, linked to through the web interface",
@@ -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),