Skip to content

Commit

Permalink
Merge pull request #57 from pnorman/prometheus_pool
Browse files Browse the repository at this point in the history
Allow multiple connections for the Prometheus exporter
  • Loading branch information
pnorman authored Dec 1, 2024
2 parents 24354d6 + e0bc3db commit 00787b5
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 00787b5

Please sign in to comment.