Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions export.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,17 @@ def prom_client(config):
# Start up the server to expose the metrics.
#
if not events_only:
log.info(f"starting http server on port {config['exporter']['listen_port']}")
log.info(f"starting http server on {config['exporter']['host_ip']}:{config['exporter']['listen_port']}")
try:
if config['exporter']['certfile'] is not None and config['exporter']['keyfile'] is not None:
prometheus_client.start_http_server(int(config['exporter']['listen_port']),
certfile=config['exporter']['certfile'],
addr=config['exporter']['host_ip'],
keyfile=config['exporter']['keyfile'])
else:
prometheus_client.start_http_server(int(config['exporter']['listen_port']))
prometheus_client.start_http_server(int(config['exporter']['listen_port']), addr=config['exporter']['host_ip'])
except Exception as exc:
log.critical(f"Unable to start http server on port {config['exporter']['listen_port']}: {exc}")
log.critical(f"Unable to start http server on {config['exporter']['host_ip']}:{config['exporter']['listen_port']}: {exc}")
return 1

# register our custom collector
Expand Down
1 change: 1 addition & 0 deletions export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# exporter section - info about how we're going to run
exporter:
host_ip: 0.0.0.0
listen_port: 8150
events_only: False
events_to_loki: True
Expand Down