From 8779ab9fbd27d141aafb9350a3e4aa2234fa338f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenc=20G=C3=A9czi?= Date: Thu, 14 Jul 2022 00:00:00 +0000 Subject: [PATCH] fix(django): Detect running django based on the injected path --- instana/instrumentation/django/middleware.py | 2 +- instana/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instana/instrumentation/django/middleware.py b/instana/instrumentation/django/middleware.py index 37a52bdc2..e29ed7cb3 100644 --- a/instana/instrumentation/django/middleware.py +++ b/instana/instrumentation/django/middleware.py @@ -168,7 +168,7 @@ def load_middleware_wrapper(wrapped, instance, args, kwargs): logger.debug("Instrumenting django") wrapt.wrap_function_wrapper('django.core.handlers.base', 'BaseHandler.load_middleware', load_middleware_wrapper) - if 'INSTANA_MAGIC' in os.environ: + if '/tmp/.instana/python' in sys.path: # If we are instrumenting via AutoTrace (in an already running process), then the # WSGI middleware has to be live reloaded. from django.core.servers.basehttp import get_internal_wsgi_application diff --git a/instana/version.py b/instana/version.py index 68cb86cbb..371774ede 100644 --- a/instana/version.py +++ b/instana/version.py @@ -3,4 +3,4 @@ # Module version file. Used by setup.py and snapshot reporting. -VERSION = '1.37.3' +VERSION = '1.37.4'