Skip to content

Commit ecdac8e

Browse files
author
Emanuele Palazzetti
authored
Merge pull request #305 from palazzem/update-docs
[docs] be more explicit in docs
2 parents c2df100 + 40546de commit ecdac8e

File tree

7 files changed

+21
-16
lines changed

7 files changed

+21
-16
lines changed

ddtrace/contrib/asyncio/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ async def some_work():
3636
are attached to the main trace
3737
3838
A ``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
"""
4142
from ..util import require_modules
4243

ddtrace/contrib/django/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""
22
The 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...
@@ -13,23 +14,22 @@
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

ddtrace/contrib/gevent/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
yield the context to another one.
77
88
The 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

ddtrace/contrib/sqlalchemy/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

ddtrace/contrib/tornado/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
"""
22
The 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

ddtrace/span.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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)

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)