From 4750dcc48093cb2309c63d409096e717ec17290f Mon Sep 17 00:00:00 2001 From: PovilasID <396243+PovilasID@users.noreply.github.com> Date: Sun, 26 Nov 2023 11:00:48 +0200 Subject: [PATCH] change: default port change via env --- prometheus_frigate_exporter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/prometheus_frigate_exporter.py b/prometheus_frigate_exporter.py index b550096..4beb880 100644 --- a/prometheus_frigate_exporter.py +++ b/prometheus_frigate_exporter.py @@ -208,10 +208,11 @@ if __name__ == '__main__': "e.g. FRIGATE_STATS_URL=http://:5000/api/stats") exit() - start_http_server(9100) + port = int(os.environ.get('PORT', 9100)) + start_http_server(port) logging.info('Started, Frigate API URL: ' + sys.argv[1]) - logging.info('Metrics at: http://localhost:9100/metrics') + logging.info('Metrics at: http://localhost:' + str(port) + '/metrics') while True: time.sleep(1)