Skip to content

Commit

Permalink
Add Python open beta for autocomplete and search (#25480)
Browse files Browse the repository at this point in the history
* Add Python open beta for autocomplete and search

* Apply suggestions from code review

Co-authored-by: Gabriele N. Tornetta <[email protected]>

* Apply suggestions from code review

Co-authored-by: Sandra (neko) <[email protected]>

* Fix list indentation

* Update content/en/dynamic_instrumentation/symdb/python.md

Co-authored-by: Sandra (neko) <[email protected]>

---------

Co-authored-by: Gabriele N. Tornetta <[email protected]>
Co-authored-by: Sandra (neko) <[email protected]>
  • Loading branch information
3 people authored Oct 1, 2024
1 parent 4d1c21b commit bc482c6
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
59 changes: 59 additions & 0 deletions content/en/dynamic_instrumentation/symdb/python.md
Original file line number Diff line number Diff line change
@@ -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=<YOUR_SERVICE>
export DD_ENV=<YOUR_ENV>
export DD_VERSION=<YOUR_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=<LIST_OF_USER_CODE_MODULES>
export DD_THIRD_PARTY_DETECTION_INCLUDES=<LIST_OF_ADDITIONAL_THIRD_PARTY_MODULES>
```
where `<LIST_OF_USER_CODE_MODULES>` and `<LIST_OF_ADDITIONAL_THIRD_PARTY_MODULES>` 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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
</div>
</a>
</div>
<div class="col">
<a class="card h-100" href="/dynamic_instrumentation/symdb/python">
<div class="card-body text-center py-2 px-1">
{{ partial "img.html" (dict "root" . "src" "integrations_logos/python.png" "class" "img-fluid" "alt" "Python" "width" "400") }}
</div>
</a>
</div>
<div class="col">
<a class="card h-100" href="/dynamic_instrumentation/symdb/dotnet">
<div class="card-body text-center py-2 px-1">
Expand Down

0 comments on commit bc482c6

Please sign in to comment.