aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrégoire Détrez <gregoire@mullvad.net>2022-08-05 18:08:42 +0200
committerGrégoire Détrez <gregoire@mullvad.net>2022-08-19 14:46:42 +0200
commita0bfd66e46bd27f1db2297c7a9634e12f983a9bb (patch)
tree60d47c367f8b91170d8682dc43a8f00b0d36e84e
parent4035c20098f0f1f59b70a55b0c7ef2e49d2a49ef (diff)
Add option to change the metrics port
-rwxr-xr-xsigsum-witness.py14
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)