Skip to content

Commit

Permalink
fix: avoid using django dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamir David authored and Tamir David committed Oct 6, 2024
1 parent 2911e47 commit c42a16a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions initializer/lib_handling.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import sys
import importlib
import os
from opentelemetry.instrumentation.django.environment_variables import (
OTEL_PYTHON_DJANGO_INSTRUMENT,
)

def reorder_python_path():
paths_to_move = [path for path in sys.path if path.startswith('/var/odigos/')]
Expand Down Expand Up @@ -57,7 +54,7 @@ def handle_django_instrumentation():
django_settings_module = os.getenv('DJANGO_SETTINGS_MODULE', None)

if django_settings_module is None:
os.environ.setdefault(OTEL_PYTHON_DJANGO_INSTRUMENT, 'False')
os.environ.setdefault("OTEL_PYTHON_DJANGO_INSTRUMENT", 'False')

else:
cwd_path = os.getcwd()
Expand All @@ -69,5 +66,5 @@ def handle_django_instrumentation():
try:
importlib.import_module(django_settings_module)
except:
os.environ.setdefault(OTEL_PYTHON_DJANGO_INSTRUMENT, 'False')
os.environ.setdefault("OTEL_PYTHON_DJANGO_INSTRUMENT", 'False')

0 comments on commit c42a16a

Please sign in to comment.