From 3dead1b83c2abdb8669490fac0bccdef1391a807 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Fri, 26 Sep 2025 12:44:39 +0200 Subject: [PATCH 1/4] Removed obsolete docs --- docs/platforms/python/usage/set-level/index.mdx | 11 ----------- platform-includes/set-level/python.mdx | 5 ----- 2 files changed, 16 deletions(-) delete mode 100644 docs/platforms/python/usage/set-level/index.mdx delete mode 100644 platform-includes/set-level/python.mdx diff --git a/docs/platforms/python/usage/set-level/index.mdx b/docs/platforms/python/usage/set-level/index.mdx deleted file mode 100644 index 8e80928388ac2..0000000000000 --- a/docs/platforms/python/usage/set-level/index.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Set the Level -description: "The level - similar to logging levels - is generally added by default based on the integration. You can also override it within an event." -sidebar_order: 5 ---- - -The level - similar to logging levels - is generally added by default based on the integration. You can also override it within an event. - - - -For a list of possible levels, see the [API Documentation](https://getsentry.github.io/sentry-python/api.html#sentry_sdk.api.set_level). diff --git a/platform-includes/set-level/python.mdx b/platform-includes/set-level/python.mdx deleted file mode 100644 index 7087e2b92b539..0000000000000 --- a/platform-includes/set-level/python.mdx +++ /dev/null @@ -1,5 +0,0 @@ -```python -import sentry_sdk - -sentry_sdk.set_level("warning") -``` From 5da6819bc8b1764fe5e8c15ef878e11759513fae Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Fri, 26 Sep 2025 13:35:17 +0200 Subject: [PATCH 2/4] Updated sampler and profiling options. --- .../python/configuration/options.mdx | 44 ++++++++++++++----- .../traces-sampler-config-option/python.mdx | 4 +- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/docs/platforms/python/configuration/options.mdx b/docs/platforms/python/configuration/options.mdx index 313af05be60eb..e087d5f628dcd 100644 --- a/docs/platforms/python/configuration/options.mdx +++ b/docs/platforms/python/configuration/options.mdx @@ -16,17 +16,19 @@ Options that can be read from an environment variable (`SENTRY_DSN`, `SENTRY_ENV - The DSN tells the SDK where to send the events. If this option is not set, the SDK will just not send any data. The `dsn` config option takes precedence over the environment variable. Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-utilization). +The DSN tells the SDK where to send the events. If this option is not set, the SDK will just not send any data. The `dsn` config option takes precedence over the environment variable. Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-utilization). - +{" "} + + - Turns debug mode on or off. When `True`, the SDK will attempt to print out debugging information. This can be useful if something goes wrong with event sending. The default is always `False`. It's generally not recommended to turn it on in production because of the increase in log output. +Turns debug mode on or off. When `True`, the SDK will attempt to print out debugging information. This can be useful if something goes wrong with event sending. The default is always `False`. It's generally not recommended to turn it on in production because of the increase in log output. - The `debug` config option takes precedence over the environment variable. +The `debug` config option takes precedence over the environment variable. @@ -62,7 +64,7 @@ Configures the sample rate for error events, in the range of `0.0` to `1.0`. The -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 events 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. @@ -71,9 +73,9 @@ If this configuration option is specified, the `sample_rate` option is ignored. A list of exception class names that shouldn't be sent to Sentry. Errors that are an instance of these exceptions or a subclass of them, will be filtered out before they're sent to Sentry. - By default, all errors are sent. - +By default, all errors are sent. + @@ -203,6 +205,7 @@ List of integrations to enable in addition to [auto-enabling integrations](/plat List of integrations that will be disabled. This setting can be used to explicitly turn off specific [auto-enabling](/platforms/python/integrations/#available-integrations) or [default](/platforms/python/integrations/default-integrations/) integrations. + @@ -218,6 +221,7 @@ When set to `False`, no auto-enabling integrations will be enabled by default, e Configures whether [default integrations](/platforms/python/integrations/default-integrations/) should be enabled. Setting `default_integrations` to `False` disables all default integrations **as well as all auto-enabling integrations**, unless they are specifically added in the `integrations` option, described above. + ## Hooks @@ -257,14 +261,13 @@ New in SDK version `2.35.0`. Prior to `2.35.0`, this option was experimental. - ## Transport Options Transports are used to send events to Sentry. Transports can be customized to some degree to better support highly specific deployments. - Switches out the transport used to send events. How this works depends on the SDK. It can, for instance, be used to capture events for unit-testing or to send it through some more complex setup that requires proxy authentication. +Switches out the transport used to send events. How this works depends on the SDK. It can, for instance, be used to capture events for unit-testing or to send it through some more complex setup that requires proxy authentication. @@ -426,13 +429,34 @@ In `trace` mode, the profiler starts and stops automatically based on active spa + + +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. + + + + + +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. + + + + + +A function responsible for determining the percentage chance a recorded profile 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 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. + + + 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. - ## Logs Options diff --git a/platform-includes/performance/traces-sampler-config-option/python.mdx b/platform-includes/performance/traces-sampler-config-option/python.mdx index 6a94749ed0645..6521295fb60de 100644 --- a/platform-includes/performance/traces-sampler-config-option/python.mdx +++ b/platform-includes/performance/traces-sampler-config-option/python.mdx @@ -1,5 +1,7 @@ -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. From e37139c781728fd9942984b657b94221207779f7 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 29 Sep 2025 10:31:57 +0200 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Ivana Kellyer --- docs/platforms/python/configuration/options.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/platforms/python/configuration/options.mdx b/docs/platforms/python/configuration/options.mdx index e087d5f628dcd..71ec863552a83 100644 --- a/docs/platforms/python/configuration/options.mdx +++ b/docs/platforms/python/configuration/options.mdx @@ -64,7 +64,7 @@ Configures the sample rate for error events, in the range of `0.0` to `1.0`. The -A function responsible for determining the percentage chance a given error events 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). +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. @@ -431,11 +431,11 @@ In `trace` mode, the profiler starts and stops automatically based on active spa -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. +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. - + 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. @@ -445,9 +445,9 @@ Either this or `profiles_sampler` must be defined to enable profiling. -A function responsible for determining the percentage chance a recorded profile 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 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. +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. +Either this or `profiles_sample_rate` must be defined to enable profiling. Additionally, tracing must be enabled for profiling to work. From 8eee2952906c1e45af493dd208c4ee035a3f43a7 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 29 Sep 2025 10:32:23 +0200 Subject: [PATCH 4/4] cleanup --- docs/platforms/python/configuration/options.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/platforms/python/configuration/options.mdx b/docs/platforms/python/configuration/options.mdx index 71ec863552a83..f90195de67fbf 100644 --- a/docs/platforms/python/configuration/options.mdx +++ b/docs/platforms/python/configuration/options.mdx @@ -18,8 +18,6 @@ Options that can be read from an environment variable (`SENTRY_DSN`, `SENTRY_ENV The DSN tells the SDK where to send the events. If this option is not set, the SDK will just not send any data. The `dsn` config option takes precedence over the environment variable. Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-utilization). -{" "} -