From bc482c63ba46d9f78f649fa534734e190b2b60f1 Mon Sep 17 00:00:00 2001 From: Oskar Jung Date: Wed, 2 Oct 2024 00:36:39 +0200 Subject: [PATCH] Add Python open beta for autocomplete and search (#25480) * Add Python open beta for autocomplete and search * Apply suggestions from code review Co-authored-by: Gabriele N. Tornetta * Apply suggestions from code review Co-authored-by: Sandra (neko) <165049174+neko-dd@users.noreply.github.com> * Fix list indentation * Update content/en/dynamic_instrumentation/symdb/python.md Co-authored-by: Sandra (neko) <165049174+neko-dd@users.noreply.github.com> --------- Co-authored-by: Gabriele N. Tornetta Co-authored-by: Sandra (neko) <165049174+neko-dd@users.noreply.github.com> --- .../dynamic_instrumentation/symdb/python.md | 59 +++++++++++++++++++ .../symbol-database-languages.html | 7 +++ 2 files changed, 66 insertions(+) create mode 100644 content/en/dynamic_instrumentation/symdb/python.md diff --git a/content/en/dynamic_instrumentation/symdb/python.md b/content/en/dynamic_instrumentation/symdb/python.md new file mode 100644 index 0000000000000..4097aa464b962 --- /dev/null +++ b/content/en/dynamic_instrumentation/symdb/python.md @@ -0,0 +1,59 @@ +--- +title: Enable Autocomplete and Search for Python +is_beta: true +private: false +code_lang: python +type: multi-code-lang +code_lang_weight: 10 +--- +{{< beta-callout url="#" btn_hidden="true" >}} +Autocomplete and search are in public beta. +{{< /beta-callout >}} + +## Requirements + +- [Dynamic Instrumentation][1] is enabled for your service. +- Tracing library [`dd-trace-py`][6] 2.9.0 or higher is installed. + +## Installation + +Run your service with Dynamic Instrumentation enabled, and additionally enable autocomplete and search: + +1. Run your service with Dynamic Instrumentation enabled by setting the `DD_DYNAMIC_INSTRUMENTATION_ENABLED` environment variable to `true`. +2. Specify `DD_SERVICE` and `DD_VERSION` [Unified Service Tags][5]. +3. Invoke your service: + + ```shell + export DD_SERVICE= + export DD_ENV= + export DD_VERSION= + export DD_DYNAMIC_INSTRUMENTATION_ENABLED=true + export DD_SYMBOL_DATABASE_UPLOAD_ENABLED=true + ddtrace-run python -m myapp + ``` + +After starting your service with the required features enabled, you can use Dynamic Instrumentation's IDE-like features on the [**APM** > **Dynamic Instrumentation**][4] page. + +## Additional configuration + +### Third party detection + +If autocomplete suggestions do not appear for your package or module, it may be incorrectly recognized as third-party code. The autocomplete and search features use a heuristic to filter out third-party code, which can sometimes lead to accidental misclassification. + +To ensure that your code is properly recognized, and to enable accurate autocomplete and search functionality, configure your third-party detection settings to use the following options: + +``` +export DD_THIRD_PARTY_DETECTION_EXCLUDES= +export DD_THIRD_PARTY_DETECTION_INCLUDES= +``` + +where `` and `` are comma separated lists of package prefixes. For example: + +``` +export DD_THIRD_PARTY_DETECTION_EXCLUDES=shopping,database +``` + +[1]: /dynamic_instrumentation +[4]: https://app.datadoghq.com/dynamic-instrumentation +[5]: /getting_started/tagging/unified_service_tagging +[6]: https://github.com/DataDog/dd-trace-py diff --git a/layouts/partials/dynamic_instrumentation/symbol-database-languages.html b/layouts/partials/dynamic_instrumentation/symbol-database-languages.html index b9311ba279a4d..24fbdfd24e35c 100644 --- a/layouts/partials/dynamic_instrumentation/symbol-database-languages.html +++ b/layouts/partials/dynamic_instrumentation/symbol-database-languages.html @@ -9,6 +9,13 @@ +