Skip to content

Commit e3ab7b6

Browse files
ZylphrexJonasBaviglia
authored
feat(profiling): Update python continuous profiling docs (#12781)
* feat(profiling): Update python continuous profiling docs This should now use the `start_profile_session` and `stop_profile_session` apis and mention `profile_lifecycle="trace"`. * profiling: set version to 2.23.1 * replace start_profile_session and stop_profile_session with start_profiler and stop_profiler * update python sdk version for continuous profiling this should be the minimum version --------- Co-authored-by: JonasBa <[email protected]> Co-authored-by: Francesco Vigliaturo <[email protected]>
1 parent d1f2dcc commit e3ab7b6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

docs/platforms/python/profiling/index.mdx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Python profiling is stable as of SDK version `1.18.0`.
1616

1717
</Alert>
1818

19-
2019
```python
2120
import sentry_sdk
2221

@@ -60,7 +59,7 @@ Profiling was experimental in SDK versions `1.17.0` and older. Learn how to upgr
6059

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

63-
_(New in version 2.21.0)_
62+
_(New in version 2.24.1)_
6463

6564
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.
6665

@@ -97,7 +96,7 @@ sentry_sdk.profiler.start_profiler()
9796
sentry_sdk.profiler.stop_profiler()
9897
```
9998

100-
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.
99+
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.
101100

102101
```python
103102
import sentry_sdk
@@ -106,9 +105,9 @@ sentry_sdk.init(
106105
dsn="___PUBLIC_DSN___",
107106
send_default_pii=True,
108107
traces_sample_rate=1.0,
109-
_experiments={
110-
"continuous_profiling_auto_start": True,
111-
},
108+
# To collect profiles for all profile sessions, set `profile_session_sample_rate` to 1.0.
109+
profile_session_sample_rate=1.0,
110+
profile_lifecycle="trace",
112111
)
113112
```
114113

0 commit comments

Comments
 (0)