Skip to content

Commit

Permalink
Allow django to be instrumented automatically (#1239)
Browse files Browse the repository at this point in the history
  • Loading branch information
owais authored Oct 14, 2020
1 parent 6019a91 commit c782f14
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 21 deletions.
8 changes: 7 additions & 1 deletion docs/examples/django/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Execution of the Django app

Set these environment variables first:

#. ``export OTEL_PYTHON_DJANGO_INSTRUMENT=True``
#. ``export DJANGO_SETTINGS_MODULE=instrumentation_example.settings``

The way to achieve OpenTelemetry instrumentation for your Django app is to use
Expand Down Expand Up @@ -100,6 +99,13 @@ output similar to this one:
The last output shows spans automatically generated by the OpenTelemetry Django
Instrumentation package.

Disabling Django Instrumentation
--------------------------------

Django's instrumentation can be disabled by setting the following environment variable.

#. ``export OTEL_PYTHON_DJANGO_INSTRUMENT=False``

References
----------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _instrument(self, **kwargs):
# 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:
Expand Down

This file was deleted.

0 comments on commit c782f14

Please sign in to comment.