File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 33and cache calls in a Django application.
44
55
6+ Enable Django tracing automatically via ``ddtrace-run``::
7+
8+ ddtrace-run python manage.py runserver
9+
10+
11+ Django tracing can also be enabled manually::
12+
13+ from ddtrace import patch_all
14+ patch_all()
15+
16+
617To have Django capture the tracer logs, ensure the ``LOGGING`` variable in
718``settings.py`` looks similar to::
819
1041153. Remove ``TraceMiddleware`` or ``TraceExceptionMiddleware`` if used in
105116 ``settings.py``.
106117
118+ 3. Enable Django tracing automatically via `ddtrace-run`` or manually by
119+ adding ``ddtrace.patch_all()`` to ``settings.py``.
120+
107121The mapping from old configuration settings to new ones.
108122
109123+-----------------------------+-------------------------------------------------------------------------------------------------------------------------+
191205 tracer.set_tags({'env': 'production'})
192206
193207 import my.custom.tracer
194- from ddtrace import Pin
208+ from ddtrace import Pin, patch_all
195209 import django
210+ patch_all()
196211 Pin.override(Pin.get_from(django), tracer=my.custom.tracer)
197212
198213.. __: https://www.djangoproject.com/
You can’t perform that action at this time.
0 commit comments