fix: env var position change

main
PovilasID 2023-11-26 11:44:58 +02:00 committed by GitHub
parent 5947650b01
commit e16b626d17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -201,7 +201,7 @@ if __name__ == '__main__':
logging.basicConfig(format='%(asctime)s - %(message)s', level=logging.INFO) logging.basicConfig(format='%(asctime)s - %(message)s', level=logging.INFO)
try: try:
url = sys.argv[1] url = str(os.environ.get('FRIGATE_STATS_URL', 'http://localhost:5000/api/stats'))
REGISTRY.register(CustomCollector(url)) REGISTRY.register(CustomCollector(url))
except IndexError: except IndexError:
logging.error( logging.error(
@ -212,7 +212,7 @@ if __name__ == '__main__':
port = int(os.environ.get('PORT', 9100)) port = int(os.environ.get('PORT', 9100))
start_http_server(port) start_http_server(port)
logging.info('Started, Frigate API URL: ' + sys.argv[1]) logging.info('Started, Frigate API URL: ' + url)
logging.info('Metrics at: http://localhost:' + str(port) + '/metrics') logging.info('Metrics at: http://localhost:' + str(port) + '/metrics')
while True: while True: