Skip to content

Commit

Permalink
Allow multiple connections for the Prometheus exporter
Browse files Browse the repository at this point in the history
The code needs a bigger refactoring to avoid this need, but this
gets it working for now.
  • Loading branch information
pnorman committed Dec 1, 2024
1 parent 4cff53e commit e0bc3db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tilekiln/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e0bc3db

Please sign in to comment.