Skip to content

Commit 754f438

Browse files
committed
update python profiler docs
1 parent 055edd7 commit 754f438

File tree

4 files changed

+7
-42
lines changed

4 files changed

+7
-42
lines changed

content/en/profiler/enabling/python.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,8 @@ prof.start() # Should be as early as possible, eg before other imports, to ensu
8080

8181
## Caveats
8282

83-
When your process forks using `os.fork`, the profiler needs to be started in
84-
the child process. In Python 3.7+, this is done automatically. In Python < 3.7,
85-
you need to manually start a new profiler in your child process:
86-
87-
```python
88-
# For ddtrace-run users, call this in your child process
89-
ddtrace.profiling.auto.start_profiler() # Should be as early as possible, eg before other imports, to ensure everything is profiled
90-
91-
# Alternatively, for manual instrumentation,
92-
# create a new profiler in your child process:
93-
from ddtrace.profiling import Profiler
94-
95-
prof = Profiler(...)
96-
prof.start() # Should be as early as possible, eg before other imports, to ensure everything is profiled
97-
```
83+
When your process forks using `os.fork`, the profiler is automatically restarted
84+
in the child process on supported Python versions. No manual restart is required.
9885

9986
## Configuration
10087

@@ -108,22 +95,6 @@ enabled by default, you can turn it off by setting
10895
`DD_PROFILING_ENABLE_CODE_PROVENANCE=0`.
10996

11097

111-
### Stack V2
112-
113-
Stack V2 is the new stack sampler implementation for 64-bit CPython 3.8+ on
114-
Linux and macOS. It enhances the performance, accuracy, and reliability of
115-
Python CPU profiling. The feature is enabled by default from `ddtrace` versions
116-
2.20+. It is recommended to use the most recent release of the library to
117-
benefit from latest improvements and bug fixes. This feature activates a new
118-
stack sampling, collection, and export system.
119-
120-
Exception sampling is missing from Stack V2. If you find this as a blocker for
121-
enabling Stack V2 for your services, you can turn it off by setting
122-
`DD_PROFILING_STACK_V2_ENABLED=0`. If you find any other issue,
123-
escalate using appropriate support channels or file an issue on the
124-
[GitHub repository](https://github.com/DataDog/dd-trace-py).
125-
126-
12798
## Not sure what to do next?
12899

129100
The [Getting Started with Profiler][7] guide takes a sample service with a performance problem and shows you how to use Continuous Profiler to understand and fix the problem.

content/en/profiler/enabling/ssi.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Continuous Profiler with SSI can be enabled for the following languages:
2424
| Java | 1.37.0+ |
2525
| .NET (x86_64 only) | 3.3.1+ |
2626
| Node.js | 4.39.0+, 5.15.0+ |
27+
| Python | 3.0.0+ |
2728

2829
Kubernetes deployments require at least Datadog Agent 7.57.0. Host and container deployments can
2930
use 7.56.x versions of the Datadog Agent.
@@ -105,9 +106,9 @@ environment variable. Running processes are not affected. The Datadog library dy
105106
on the profiler for the processes that are good profiling candidates.
106107

107108
The logic for identifying a process as a good candidate varies by language. For Java, all processes
108-
are profiled, as Java applications are usually deployed as a single Java process on a host. For Node
109-
and Python, profiler is only turned on if the application is running for more than 30 seconds and
110-
has created at least one tracing span.
109+
are profiled, as Java applications are usually deployed as a single Java process on a host. For Node.js,
110+
profiler is only turned on if the application is running for more than 30 seconds and has created at least
111+
one tracing span. For Python, when `DD_PROFILING_ENABLED=auto` (the SSI default), profiling is enabled for SSI-instrumented processes.
111112

112113
SSI can also be configured to inject profiling on each and every process by using the value `true`
113114
instead of `auto`.

content/en/profiler/enabling/supported_versions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The following table shows profile type availability by language. For optimal per
3131
| <div style="width:150px"><div> | [Java][1] | [Python][2] | [Go][3] | [Ruby][4] | [Node.js][5] | [.NET][6] | [PHP][7] | [Rust/C/C++][8] |
3232
|-----------------------------------|:-------------------------------------------------:|:-------:|:------------:|:------:|:---------:|:-------:|:------:|:----------:|
3333
| {{< ci-details title="CPU" >}}The time each function/method spent running on the CPU.{{< /ci-details >}} | {{< X >}} | {{< X >}} | {{< X >}} | {{< X >}} | {{< X >}} | {{< X >}} | {{< X >}} | {{< tooltip glossary="preview" case="title" >}} |
34-
| {{< ci-details title="Exceptions" >}}The number of exceptions raised, including those caught.{{< /ci-details >}} | {{< X >}} | Python 3.7+ | | | | {{< X >}} | {{< X >}} | |
34+
| {{< ci-details title="Exceptions" >}}The number of exceptions raised, including those caught.{{< /ci-details >}} | {{< X >}} | | | | | {{< X >}} | {{< X >}} | |
3535
| {{< ci-details title="Allocation" >}}Number and sizes of memory allocations made by each function/method, including allocations which were subsequently freed.{{< /ci-details >}} | [JDK 11+][17] | Python 3.6+ | {{< X >}} | {{< X >}} | | {{< tooltip glossary="preview" case="title" >}}<br>.NET 6+ <br>(.NET 10 recommended)| {{< X >}} | {{< tooltip glossary="preview" case="title" >}} |
3636
| {{< ci-details title="Heap" >}}The amount of heap memory allocated that remains in use.{{< /ci-details >}} | [JDK 11+][17] | Python 3.6+ | {{< X >}} | {{< tooltip glossary="preview" case="title" >}}<br>Ruby 3.1+<br>Not yet compatible with Ruby 4 | {{< X >}} | {{< tooltip glossary="preview" case="title" >}}<br>.NET 7+ <br>(.NET 10 recommended) | | {{< tooltip glossary="preview" case="title" >}} |
3737
| {{< ci-details title="Wall time" >}}The elapsed time spent in each function/method. Elapsed time includes time when code is running on CPU, waiting for I/O, and anything else that happens while the function/method is running.{{< /ci-details >}} | {{< X >}} | {{< X >}} | | {{< X >}} | {{< X >}} | {{< X >}} | {{< X >}} | |
@@ -74,4 +74,3 @@ The following table outlines additional profiling features by language. For full
7474
[19]: /profiler/connect_traces_and_profiles/#endpoint-profiling
7575
[20]: /profiler/connect_traces_and_profiles/#span-execution-timeline-view
7676
[21]: https://go.dev/doc/devel/release
77-

content/en/profiler/profile_types.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@ Allocations
101101
: The number of heap allocations made by each function, including allocations which were subsequently freed.<br />
102102
_Requires: Python 3.5+_
103103

104-
Thrown Exceptions
105-
: The number of caught or uncaught exceptions raised by each function, as well as their type.<br />
106-
_Requires: Python 3.7+, POSIX platform_
107-
108-
109104
[1]: /profiler/enabling/python/#requirements
110105
{{< /programming-lang >}}
111106
{{< programming-lang lang="go" >}}
@@ -298,4 +293,3 @@ CPU Time (eBPF)
298293
## Further Reading
299294

300295
{{< partial name="whats-next/whats-next.html" >}}
301-

0 commit comments

Comments
 (0)