Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions medcat-trainer/webapp/api/core/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')

# Initialize OpenTelemetry before Django so uwsgi/gunicorn get tracing (manage.py only runs for CLI).
if os.environ.get('MCT_ENABLE_TRACING', 'False').lower() == 'true':
from opentelemetry.instrumentation import auto_instrumentation

auto_instrumentation.initialize()

from django.core.wsgi import get_wsgi_application

application = get_wsgi_application()
1 change: 0 additions & 1 deletion medcat-trainer/webapp/api/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def main():
if os.environ.get('MCT_ENABLE_TRACING', 'False').lower() == 'true':
from opentelemetry.instrumentation import auto_instrumentation

print("Initializing OpenTelemetry instrumentation")
auto_instrumentation.initialize()

try:
Expand Down