From cc6237578e697668111bfba349dc29733d08293d Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 20 Jan 2022 17:48:18 +0000 Subject: [PATCH 1/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64405acd89..cc01a452fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-instrumentation-asgi` ASGI: Conditionally create SERVER spans ([#843](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/843)) +- `opentelemetry-instrumentation-django` Django: fix issue preventing detection of MIDDLEWARE_CLASSES ## [1.8.0-0.27b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.8.0-0.27b0) - 2021-12-17 From c302e2ecf7de44c72de743e9e54343ca3088048b Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 20 Jan 2022 17:50:40 +0000 Subject: [PATCH 2/2] Fix Django 1.9 issue preventing use of MIDDLEWARE_CLASSES --- .../src/opentelemetry/instrumentation/django/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py index 46ee710640..d5e1f07279 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py @@ -105,7 +105,7 @@ def _get_django_middleware_setting() -> str: # In Django versions 1.x, setting MIDDLEWARE_CLASSES can be used as a legacy # alternative to MIDDLEWARE. This is the case when `settings.MIDDLEWARE` has # its default value (`None`). - if not DJANGO_2_0 and getattr(settings, "MIDDLEWARE", []) is None: + if not DJANGO_2_0 and getattr(settings, "MIDDLEWARE", None) is None: return "MIDDLEWARE_CLASSES" return "MIDDLEWARE"