Skip to content
Merged
Show file tree
Hide file tree
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
24 changes: 23 additions & 1 deletion docs/platforms/python/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Configures the sample rate for error events, in the range of `0.0` to `1.0`. The

<SdkOption name="error_sampler" type='function' defaultValue='None'>

Dynamically configures the sample rate for error events on a per-event basis. This configuration option accepts a function, which takes two parameters (the `event` and the `hint`), and which returns a boolean (indicating whether the event should be sent to Sentry) or a floating-point number between `0.0` and `1.0`, inclusive (where the number indicates the probability the event is sent to Sentry; the SDK will randomly decide whether to send the event with the given probability).
A function responsible for determining the percentage chance a given error event will be sent to Sentry. This configuration option accepts a function, which takes two parameters (the `event` and the `hint`), and which returns a boolean (indicating whether the event should be sent to Sentry), or returns a number between `0` (0% chance of being sent) and `1` (100% chance of being sent).

If this configuration option is specified, the `sample_rate` option is ignored.

Expand Down Expand Up @@ -439,6 +439,28 @@ In `trace` mode, the profiler starts and stops automatically based on active spa

</SdkOption>

<SdkOption name="profiler_mode" type='str' defaultValue='None'>

Determines which scheduler the profiler uses to record profiles. Can be `"thread"`, `"gevent"`, `"unknown"`, or `"sleep"` (deprecated, only for backwards compatibility). If not set, the SDK will determine the best scheduler to use. Only change this option if you know what you are doing.

</SdkOption>

<SdkOption name="profiles_sample_rate" type='float' defaultValue='None'>

A number between `0` and `1`, controlling the percentage chance a given profile will be sent to Sentry. (`0` represents 0% while `1` represents 100%.) Applies equally to all profiles created in the app. The `profiles_sample_rate` setting is relative to the `traces_sample_rate` setting.

Either this or `profiles_sampler` must be defined to enable profiling.

</SdkOption>

<SdkOption name="profiles_sampler" type='function' defaultValue='None'>

A function responsible for determining the percentage chance a recorded profile will be sent to Sentry. The function takes one parameter (the `sampling_context`). The given `sampling_context` contains information about the transaction linked to the profile and the context in which it's being created. The function must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering profiles, by returning `0` for those that are unwanted.

Either this or `profiles_sample_rate` must be defined to enable profiling. Additionally, tracing must be enabled for profiling to work.

</SdkOption>

<SdkOption name="profile_session_sample_rate" type='float' defaultValue='None'>

A number between `0` and `1`, controlling the percentage chance a given session will be profiled. The sampling decision is evaluated only once at SDK initialization.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<SdkOption name="traces_sampler" type='function' defaultValue='None'>

A function responsible for determining the percentage chance a given transaction will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering transactions, by returning `0` for those that are unwanted. Either this or `traces_sample_rate` must be defined to enable tracing.
A function responsible for determining the percentage chance a given transaction will be sent to Sentry. This configuration option accepts a function, which takes one parameter (the `sampling_context`). The given `sampling_context` contains information about the transaction and the context in which it's being created. The function must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering transactions, by returning `0` for those that are unwanted.

Either this or `traces_sample_rate` must be defined to enable tracing.

</SdkOption>
Loading