diff --git a/instrumentation/opentelemetry-instrumentation-django/CHANGELOG.md b/instrumentation/opentelemetry-instrumentation-django/CHANGELOG.md index 496d94008..2248ea35c 100644 --- a/instrumentation/opentelemetry-instrumentation-django/CHANGELOG.md +++ b/instrumentation/opentelemetry-instrumentation-django/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Django instrumentation is now enabled by default but can be disabled by setting `OTEL_PYTHON_DJANGO_INSTRUMENT` to `False` ([#1239](https://github.com/open-telemetry/opentelemetry-python/pull/1239)) + ## Version 0.14b0 Released 2020-10-13 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 a9bd620e7..9ba3bbb91 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py @@ -41,7 +41,7 @@ class DjangoInstrumentor(BaseInstrumentor): # built inside the Configuration class itself with the magic method # __bool__ - if not Configuration().DJANGO_INSTRUMENT: + if Configuration().DJANGO_INSTRUMENT is False: return # This can not be solved, but is an inherent problem of this approach: diff --git a/instrumentation/opentelemetry-instrumentation-django/tests/conftest.py b/instrumentation/opentelemetry-instrumentation-django/tests/conftest.py deleted file mode 100644 index 8797bfc30..000000000 --- a/instrumentation/opentelemetry-instrumentation-django/tests/conftest.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from os import environ - - -def pytest_sessionstart(session): # pylint: disable=unused-argument - environ.setdefault("OTEL_PYTHON_DJANGO_INSTRUMENT", "True")