Skip to content

Commit 6a0c037

Browse files
authored
Python: Update some options (#15051)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR Make sure all `*_sampler` options and all profiler related options are documented. Preview: https://sentry-docs-git-antonpirker-pythonoptions-samplers.sentry.dev/platforms/python/configuration/options/ refs #12606 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
1 parent 2df5e0d commit 6a0c037

File tree

2 files changed

+26
-2
lines changed
  • docs/platforms/python/configuration
  • platform-includes/performance/traces-sampler-config-option

2 files changed

+26
-2
lines changed

docs/platforms/python/configuration/options.mdx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Configures the sample rate for error events, in the range of `0.0` to `1.0`. The
6868

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

71-
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).
71+
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).
7272

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

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

440440
</SdkOption>
441441

442+
<SdkOption name="profiler_mode" type='str' defaultValue='None'>
443+
444+
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.
445+
446+
</SdkOption>
447+
448+
<SdkOption name="profiles_sample_rate" type='float' defaultValue='None'>
449+
450+
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.
451+
452+
Either this or `profiles_sampler` must be defined to enable profiling.
453+
454+
</SdkOption>
455+
456+
<SdkOption name="profiles_sampler" type='function' defaultValue='None'>
457+
458+
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.
459+
460+
Either this or `profiles_sample_rate` must be defined to enable profiling. Additionally, tracing must be enabled for profiling to work.
461+
462+
</SdkOption>
463+
442464
<SdkOption name="profile_session_sample_rate" type='float' defaultValue='None'>
443465

444466
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.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<SdkOption name="traces_sampler" type='function' defaultValue='None'>
22

3-
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.
3+
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.
4+
5+
Either this or `traces_sample_rate` must be defined to enable tracing.
46

57
</SdkOption>

0 commit comments

Comments
 (0)