Skip to content

Commit

Permalink
Merge pull request #61 from weka/mar24_2
Browse files Browse the repository at this point in the history
added optional TLS proto
  • Loading branch information
vince-weka authored Apr 19, 2024
2 parents a228299 + f909a57 commit 9fd9419
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 13 additions & 2 deletions export.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from wekalib.wekacluster import WekaCluster
import wekalib.exceptions

VERSION = "1.7.1"
VERSION = "1.7.2"

#VERSION = "experimental"

Expand Down Expand Up @@ -94,6 +94,12 @@ def prom_client(config):
if 'datapoints_per_collect' not in config['exporter']:
config['exporter']['datapoints_per_collect'] = 1

if 'certfile' not in config['exporter']:
config['exporter']['certfile'] = None

if 'keyfile' not in config['exporter']:
config['exporter']['keyfile'] = None

log.info(f"Timeout set to {config['exporter']['timeout']} secs")

try:
Expand Down Expand Up @@ -143,7 +149,12 @@ def prom_client(config):
#
log.info(f"starting http server on port {config['exporter']['listen_port']}")
try:
prometheus_client.start_http_server(int(config['exporter']['listen_port']))
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'],
keyfile=config['exporter']['keyfile'])
else:
prometheus_client.start_http_server(int(config['exporter']['listen_port']))
except Exception as exc:
log.critical(f"Unable to start http server on port {config['exporter']['listen_port']}: {exc}")
return 1
Expand Down
4 changes: 3 additions & 1 deletion export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ exporter:
max_threads_per_proc: 100
backends_only: True
datapoints_per_collect: 5
certfile: null
keyfile: null

# cluster section - info about the weka cluster we want to export data from:
cluster:
auth_token_file: auth-token.json
hosts:
- 172.29.4.65
- 172.29.0.63
force_https: False # only 3.10+ clusters support https
verify_cert: False # default cert cannot be verified
mgmt_port: 14000
Expand Down

0 comments on commit 9fd9419

Please sign in to comment.