File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ class Settings(BaseSettings):
5454 SLACK_LOG_CHANNEL : str = "C077Z79HB0V"
5555 # n8n
5656 N8N_WEBHOOK_URL : str = "http://n8n:5678/webhook/publish-post"
57+ # Metrics
58+ START_METRICS : bool = False
59+ METRICS_PORT : int = 9000
60+
5761 # Pydantic configuration
5862 model_config = SettingsConfigDict (
5963 env_file = ".env" , env_file_encoding = "utf-8" , extra = "ignore"
Original file line number Diff line number Diff line change 3232
3333@broker .on_event (TaskiqEvents .WORKER_STARTUP )
3434async def start_metrics_server (_state : Any ) -> None :
35- start_http_server (9000 )
35+ if settings .START_METRICS :
36+ start_http_server (settings .METRICS_PORT )
3637
3738
3839# Initialise the scheduler with label and Redis sources
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ services:
1212 - POSTGRES_HOST=postgres
1313 - REDIS_HOST=redis
1414 - QDRANT_HOST=qdrant
15+ - START_METRICS=false
1516 depends_on :
1617 postgres :
1718 condition : service_healthy
@@ -29,6 +30,10 @@ services:
2930 - POSTGRES_HOST=postgres
3031 - REDIS_HOST=redis
3132 - QDRANT_HOST=qdrant
33+ - START_METRICS=true
34+ - METRICS_PORT=9000
35+ ports :
36+ - " 9000:9000"
3237 depends_on :
3338 postgres :
3439 condition : service_healthy
@@ -44,6 +49,10 @@ services:
4449 env_file : .env
4550 environment :
4651 - REDIS_HOST=redis
52+ - START_METRICS=true
53+ - METRICS_PORT=9001
54+ ports :
55+ - " 9001:9001"
4756 depends_on :
4857 redis :
4958 condition : service_healthy
You can’t perform that action at this time.
0 commit comments