diff --git a/ddtrace/_monkey.py b/ddtrace/_monkey.py index 488211e46b1..ff7747ce395 100644 --- a/ddtrace/_monkey.py +++ b/ddtrace/_monkey.py @@ -206,7 +206,7 @@ def on_import(hook): def patch_all(**patch_modules): # type: (bool) -> None - """Automatically patches all available modules. + """Enables ddtrace library instrumentation. In addition to ``patch_modules``, an override can be specified via an environment variable, ``DD_TRACE__ENABLED`` for each module. diff --git a/docs/basic_usage.rst b/docs/basic_usage.rst index 4e438e154bb..7f8f6cbb9cb 100644 --- a/docs/basic_usage.rst +++ b/docs/basic_usage.rst @@ -3,39 +3,19 @@ Basic Usage =========== -Tracing -~~~~~~~ +Automatic Instrumentation +~~~~~~~~~~~~~~~~~~~~~~~~~ ``ddtrace.auto`` ---------------- -To set up instrumentation within your application, call :ref:`import ddtrace.auto` as early as possible +To enable full ddtrace support (library instrumentation, profiling, application security monitoring, dynamic instrumentation, etc.) call :ref:`import ddtrace.auto` as the very first thing in your application. This will only work if your application is not running under ``ddtrace-run``. -``patch_all`` -------------- - -For fine-grained control over instrumentation setup, use ``patch_all`` as early as possible -in the application:: - - from ddtrace import patch_all - patch_all() - -To toggle instrumentation for a particular module:: - - from ddtrace import patch_all - patch_all(redis=False, cassandra=False) - -By default all supported libraries will be instrumented when ``patch_all`` is -used. - -**Note:** To ensure that the supported libraries are instrumented properly in -the application, they must be patched *prior* to being imported. So make sure -to call ``patch_all`` *before* importing libraries that are to be instrumented. - -More information about ``patch_all`` is available in the :py:func:`patch_all` API -documentation. +Note: Some Datadog products and instrumentation are disabled by default. Products and instrumentation can be enabled/disable via environment variables, see :ref:`configurations ` page for more details. +Tracing +~~~~~~~ Manual Instrumentation ---------------------- diff --git a/docs/index.rst b/docs/index.rst index 3d19a4fbf14..23c0cd48a06 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -186,7 +186,7 @@ contacting support. .. [1] Libraries that are automatically instrumented when the :ref:`ddtrace-run` command is used or the ``import ddtrace.auto`` import - is used. Always use ``patch()``, ``patch_all()``, and ``import ddtrace.auto`` as soon + is used. Always use ``import ddtrace.auto`` as soon as possible in your Python entrypoint. .. [2] only the synchronous client diff --git a/docs/installation_quickstart.rst b/docs/installation_quickstart.rst index 4cfc4d670d1..2d879a072b3 100644 --- a/docs/installation_quickstart.rst +++ b/docs/installation_quickstart.rst @@ -59,24 +59,6 @@ When ``ddtrace-run`` cannot be used, a similar start-up behavior can be achieved with the import of ``ddtrace.auto``. This should normally be imported as the first thing during the application start-up. -If neither ``ddtrace-run`` nor ``import ddtrace.auto`` are suitable for your application, then -:py:func:`ddtrace.patch_all` can be used to configure the tracer:: - - from ddtrace import config, patch_all - - config.env = "dev" # the environment the application is in - config.service = "app" # name of your application - config.version = "0.1" # version of your application - patch_all() - - -.. note:: - We recommend the use of ``ddtrace-run`` when possible. If you are importing - ``ddtrace.auto`` as a programmatic replacement for ``ddtrace``, then note - that integrations will take their configuration from the environment - variables. A call to :py:func:`ddtrace.patch_all` cannot be used to disable - an integration at this point. - Service names also need to be configured for libraries that query other services (``requests``, ``grpc``, database libraries, etc). Check out the