Skip to content

Commit d7040c0

Browse files
authored
docs(profiling): Add profile_session_sample_rate docs for python (#12691)
* docs(profiling): Add profile_session_sample_rate docs for python The newly introduced `profile_session_sample_rate` defaults to `0.0` and needs to be set to use continuous profiling. * blurb about the setting itself
1 parent 6f2fecf commit d7040c0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docs/platforms/python/profiling/index.mdx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,18 @@ Profiling was experimental in SDK versions `1.17.0` and older. Learn how to upgr
5959

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

62-
_(New in version 2.13.0)_
62+
_(New in version 2.21.0)_
6363

6464
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.
6565

6666
To get started with continuous profiling, you can start and stop the profiler directly with `sentry_sdk.profiler.start_profiler` and `sentry_sdk.profiler.stop_profiler`.
6767

68+
### Sampling
69+
70+
Sampling for continuous profiling is determined only once when the SDK is configured. That sampling decision is used to decide if the profiles will be collected or not for the entirety of the process.
71+
72+
Set `profile_session_sample_rate=1.0` to collect continuous profiles for 100% of profile sessions.
73+
6874
<Alert>
6975

7076
If you previously set `profiles_sample_rate` or `profilers_sampler` to use transaction-based profiling, you must remove those lines of code from your configuration in order to use continuous profiling.
@@ -78,6 +84,9 @@ sentry_sdk.init(
7884
dsn="___PUBLIC_DSN___",
7985
send_default_pii=True,
8086
traces_sample_rate=1.0,
87+
88+
# To collect profiles for all profile sessions, set `profile_session_sample_rate` to 1.0.
89+
profile_session_sample_rate=1.0,
8190
)
8291

8392
sentry_sdk.profiler.start_profiler()

0 commit comments

Comments
 (0)