File tree Expand file tree Collapse file tree 7 files changed +21
-16
lines changed Expand file tree Collapse file tree 7 files changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ async def some_work():
3636 are attached to the main trace
3737
3838A ``patch(asyncio=True)`` is available if you want to automatically use above
39- wrappers without changing your code.
39+ wrappers without changing your code. In that case, the patch method **must be
40+ called before** importing stdlib functions.
4041"""
4142from ..util import require_modules
4243
Original file line number Diff line number Diff line change 11"""
22The Django integration will trace requests, database calls and template
3- renders .
3+ renderers .
44
5- To install the Django tracing middleware, add it to the list of your
6- installed apps and in your middleware classes in ``settings.py``::
5+ To enable the Django integration, add the application to your installed
6+ apps and our tracing middleware **as a first middleware** in your ``MIDDLEWARE``
7+ list, as follows::
78
89 INSTALLED_APPS = [
910 # your Django apps...
1314 ]
1415
1516 # or MIDDLEWARE_CLASSES for Django pre 1.10
16- MIDDLEWARE = (
17+ MIDDLEWARE = [
1718 # the tracer must be the first middleware
1819 'ddtrace.contrib.django.TraceMiddleware',
1920
2021 # your middlewares...
21- )
22+ ]
2223
23- The configuration of this integration is all namespaced inside a single
24- Django setting, named ``DATADOG_TRACE``. For example, your ``settings.py``
25- may contain::
24+ The configuration for this integration is namespaced under the ``DATADOG_TRACE``
25+ Django setting. For example, your ``settings.py`` may contain::
2626
2727 DATADOG_TRACE = {
2828 'DEFAULT_SERVICE': 'my-django-app',
2929 'TAGS': {'env': 'production'},
3030 }
3131
32- If you need to access to the tracing settings, you should::
32+ If you need to access to integration settings, you should::
3333
3434 from ddtrace.contrib.django.conf import settings
3535
Original file line number Diff line number Diff line change 66yield the context to another one.
77
88The simplest way to trace a ``gevent`` application is to configure the tracer and
9- patch ``gevent`` before using it ::
9+ patch ``gevent`` ** before importing** the library ::
1010
1111 # patch before importing gevent
1212 from ddtrace import patch, tracer
Original file line number Diff line number Diff line change 11"""
2- To trace sqlalchemy queries, add instrumentation to the engine class or
3- instance you are using ::
2+ To trace sqlalchemy queries, add instrumentation to the engine class
3+ using the patch method that **must be called before** importing sqlalchemy ::
44
55 # patch before importing `create_engine`
66 from ddtrace import Pin, patch
Original file line number Diff line number Diff line change 11"""
22The Tornado integration traces all ``RequestHandler`` defined in a Tornado web application.
3- Auto instrumentation is available using the ``patch`` function as follows::
3+ Auto instrumentation is available using the ``patch`` function that **must be called before**
4+ importing the tornado library. The following is an example::
45
6+ # patch before importing tornado
57 from ddtrace import tracer, patch
68 patch(tornado=True)
79
Original file line number Diff line number Diff line change @@ -152,8 +152,10 @@ def set_metas(self, kvs):
152152 self .set_tags (kvs )
153153
154154 def set_metric (self , key , value ):
155- # FIXME[matt] we could push this check to serialization time as well.
155+ # This method sets a numeric tag value for the given key. It acts
156+ # like `set_meta()` and it simply add a tag without further processing.
156157
158+ # FIXME[matt] we could push this check to serialization time as well.
157159 # only permit types that are commonly serializable (don't use
158160 # isinstance so that we convert unserializable types like numpy
159161 # numbers)
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ for changing your code::
3737 Usage: [ENV_VARS] ddtrace-run <my_program>
3838
3939
40- The available environment settings are:
40+ The available environment variables are:
4141
4242* ``DATADOG_TRACE_ENABLED=true|false `` (default: true): Enable web framework and library instrumentation. When false, your application code
4343 will not generate any traces.
You can’t perform that action at this time.
0 commit comments