Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions docs/platforms/python/profiling/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Python profiling is stable as of SDK version `1.18.0`.

</Alert>


```python
import sentry_sdk

Expand Down Expand Up @@ -59,7 +58,7 @@ Profiling was experimental in SDK versions `1.17.0` and older. Learn how to upgr

<Include name="feature-stage-beta.mdx" />

_(New in version 2.21.0)_
_(New in version 2.24.1)_

The current profiling implementation stops the profiler automatically after 30 seconds (unless you manually stop it earlier). Naturally, this limitation makes it difficult to get full coverage of your app's execution. We now offer an experimental continuous mode, where profiling data is periodically uploaded while running, with no limit on how long the profiler may run.

Expand Down Expand Up @@ -96,7 +95,7 @@ sentry_sdk.profiler.start_profiler()
sentry_sdk.profiler.stop_profiler()
```

For some applications such as web servers, it may be difficult to call `sentry_sdk.profiler.start_profiler` in every process. Instead, you can use the `continuous_profiling_auto_start` option to automatically start the continuous profiler when a transaction is started.
For some applications such as web servers, it may be difficult to call `sentry_sdk.profiler.start_profiler` in every process. Instead, you can use the `profile_lifecycle` option to automatically profile anytime a transaction is active.

```python
import sentry_sdk
Expand All @@ -105,9 +104,9 @@ sentry_sdk.init(
dsn="___PUBLIC_DSN___",
send_default_pii=True,
traces_sample_rate=1.0,
_experiments={
"continuous_profiling_auto_start": True,
},
# To collect profiles for all profile sessions, set `profile_session_sample_rate` to 1.0.
profile_session_sample_rate=1.0,
profile_lifecycle="trace",
)
```

Expand Down