mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-30 13:43:03 +08:00
Allow django to be instrumented automatically (#1239)
This commit is contained in:
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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")
|
Reference in New Issue
Block a user