Skip to content

Commit

Permalink
[DOP-15650] Allow using Horizon with multiple uvicorn workers
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed May 14, 2024
1 parent 4313940 commit 25ce279
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ services:
image: postgres:15-alpine
restart: unless-stopped
env_file: .env.docker
# PROMETHEUS_MULTIPROC_DIR is required for multiple workers, see:
# https://prometheus.github.io/client_python/multiprocess/
environment:
PROMETHEUS_MULTIPROC_DIR: /tmp/prometheus-metrics
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data
# tmpfs dir is cleaned up each container restart
tmpfs:
- /tmp/prometheus-metrics
healthcheck:
test: pg_isready
start_period: 5s
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/settings/server/log/colored.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ formatters:
colored:
(): coloredlogs.ColoredFormatter
# Add correlation_id to log records
fmt: '%(asctime)s.%(msecs)03d %(name)s:%(lineno)d [%(levelname)s] %(correlation_id)s %(message)s'
fmt: '%(asctime)s.%(msecs)03d %(processName)s:%(process)d %(name)s:%(lineno)d [%(levelname)s] %(correlation_id)s %(message)s'
datefmt: '%Y-%m-%d %H:%M:%S'

handlers:
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/settings/server/log/json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ formatters:
json:
(): pythonjsonlogger.jsonlogger.JsonFormatter
# Add correlation_id to log records
fmt: '%(name)s %(lineno)d %(levelname)s %(message)s %(correlation_id)s'
fmt: '%(processName)s %(process)d %(threadName)s %(thread)d %(name)s %(lineno)d %(levelname)s %(message)s %(correlation_id)s'
timestamp: true

handlers:
Expand Down
2 changes: 1 addition & 1 deletion horizon/backend/settings/server/log/plain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ formatters:
plain:
(): logging.Formatter
# Add correlation_id to log records
fmt: '%(asctime)s.%(msecs)03d %(name)s:%(lineno)d [%(levelname)s] %(correlation_id)s %(message)s'
fmt: '%(asctime)s.%(msecs)03d %(processName)s:%(process)d %(name)s:%(lineno)d [%(levelname)s] %(correlation_id)s %(message)s'
datefmt: '%Y-%m-%d %H:%M:%S'

handlers:
Expand Down

0 comments on commit 25ce279

Please sign in to comment.