From a0bfd66e46bd27f1db2297c7a9634e12f983a9bb Mon Sep 17 00:00:00 2001 From: Grégoire Détrez Date: Fri, 5 Aug 2022 18:08:42 +0200 Subject: Add option to change the metrics port --- sigsum-witness.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'sigsum-witness.py') 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) -- cgit v1.2.3