Skip to content

Commit 7ed76d2

Browse files
authored
Merge pull request #163 from rostilos/1.5.5-rc
feat: Integrate New Relic APM configuration in docker-compose and mai…
2 parents ac92f41 + 403378e commit 7ed76d2

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

deployment/docker-compose.prod.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ services:
181181
INTERNAL_API_SECRET: ${INTERNAL_API_SECRET:?INTERNAL_API_SECRET must be set in .env}
182182
# Redis connection for async analysis queue (DB 1 to isolate from session storage on DB 0)
183183
REDIS_URL: redis://redis:6379/1
184+
# New Relic APM — points to the mounted config file
185+
NEW_RELIC_CONFIG_FILE: /app/newrelic.ini
184186
networks:
185187
- codecrow-network
186188
volumes:

python-ecosystem/inference-orchestrator/src/main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
python main.py --stdin # Process single request from stdin
1212
"""
1313

14+
# ── New Relic APM — must be initialized before any other imports ─────────
15+
import os as _os
16+
_nr_config = _os.environ.get('NEW_RELIC_CONFIG_FILE')
17+
if _nr_config and _os.path.exists(_nr_config):
18+
import newrelic.agent
19+
newrelic.agent.initialize(_nr_config)
20+
# ─────────────────────────────────────────────────────────────────────────
21+
1422
import os
1523
import sys
1624
import logging

0 commit comments

Comments
 (0)