From e0bc3dbedec0670800f2086cd645b472bc29a288 Mon Sep 17 00:00:00 2001 From: Paul Norman Date: Sun, 1 Dec 2024 15:09:30 -0800 Subject: [PATCH] Allow multiple connections for the Prometheus exporter The code needs a bigger refactoring to avoid this need, but this gets it working for now. --- tilekiln/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tilekiln/main.py b/tilekiln/main.py index 5bc6281..1e36e91 100644 --- a/tilekiln/main.py +++ b/tilekiln/main.py @@ -44,7 +44,8 @@ def cli() -> None: def prometheus(bind_host: str, bind_port: int, storage_dbname: str, storage_host: str, storage_port: int, storage_username: str) -> None: '''Run a prometheus exporter for metrics on tiles.''' - with psycopg_pool.ConnectionPool(min_size=1, max_size=1, num_workers=1, + # The prometheus exporter sometimes needs multiple connections + with psycopg_pool.ConnectionPool(min_size=3, max_size=3, num_workers=1, check=psycopg_pool.ConnectionPool.check_connection, kwargs={"dbname": storage_dbname, "host": storage_host,