diff options
author | Grégoire Détrez <gregoire@mullvad.net> | 2022-08-05 18:08:42 +0200 |
---|---|---|
committer | Grégoire Détrez <gregoire@mullvad.net> | 2022-08-19 14:46:42 +0200 |
commit | a0bfd66e46bd27f1db2297c7a9634e12f983a9bb (patch) | |
tree | 60d47c367f8b91170d8682dc43a8f00b0d36e84e | |
parent | 4035c20098f0f1f59b70a55b0c7ef2e49d2a49ef (diff) |
Add option to change the metrics port
-rwxr-xr-x | sigsum-witness.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sigsum-witness.py b/sigsum-witness.py index 1a565b8..87e073e 100755 --- a/sigsum-witness.py +++ b/sigsum-witness.py @@ -120,7 +120,15 @@ class Parser: const=logging.DEBUG, default=logging.INFO, dest="log_level", - help="Log base URL ({})".format(BASE_URL_DEFAULT), + help="Increase verbosity", + ) + + p.add_argument( + "--metrics-port", + action="store", + type=int, + default=8000, + help="Port of the HTTP server to expose Prometheus metrics.", ) self.parser = p @@ -599,8 +607,8 @@ def main(args): "ERROR: Valid tree head found: --bootstrap-log not allowed") # Start up the server to expose the metrics. - LOGGER.info("Starting metrics server on port 8000") - prometheus.start_http_server(8000) + LOGGER.info(f"Starting metrics server on port {g_args.metrics_port}") + prometheus.start_http_server(g_args.metrics_port) LOGGER.info("Starting witness") thread = Witness(signing_key, log_verification_key, cur_tree_head) |