-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add platform-agnostic sample rate page #12016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5159d02
Refactor sample rates page to be more specific
3548703
Update docs/concepts/key-terms/sample-rates.mdx
coolguyzone 5d7155b
Update docs/concepts/key-terms/sample-rates.mdx
coolguyzone 894cd1c
Update docs/concepts/key-terms/sample-rates.mdx
coolguyzone c4dd30d
Add an overview of sample rates
597e24b
Update docs/concepts/key-terms/sample-rates.mdx
coolguyzone decb47d
Update docs/concepts/key-terms/sample-rates.mdx
coolguyzone 1275b8f
Update docs/concepts/key-terms/sample-rates.mdx
coolguyzone f514f06
Update docs/concepts/key-terms/sample-rates.mdx
coolguyzone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| --- | ||
| title: Sample Rates | ||
| sidebar_order: 11 | ||
| description: Learn how to manage the amount of data you send and are billed for in Sentry by adjusting the sample rates of various Sentry products including Traces and Session Replays. | ||
| --- | ||
|
|
||
| ## Overview | ||
|
|
||
| ### What Is a Sample Rate? | ||
|
|
||
| Adding Sentry to your app gives you a lot of valuable information about errors and performance you wouldn't otherwise get. And lots of information is good -- as long as it's the right information, at a reasonable volume. You can use sample rates to capture only a specified percentage of events like errors and traces. | ||
|
|
||
|
|
||
| ### Why Not Capture All Events? | ||
|
|
||
| We recommend sampling your transactions for two reasons: | ||
|
|
||
| 1. Capturing a single trace involves minimal overhead, but capturing traces for every page load or API request may add an undesirable load to your system. | ||
|
|
||
| 1. Enabling sampling allows you to better manage the number of events sent to Sentry, so you can tailor your volume to your organization's needs and budget. | ||
|
|
||
| Choose a sampling rate that balances data accuracy with performance and storage concerns. You should aim to collect enough data to get meaningful insights without overloading resources. If unsure, start with a low rate and gradually increase it as you understand your traffic patterns better. | ||
|
|
||
| ## Sampling Rate Options | ||
|
|
||
| <Note> | ||
| Some of the options below aren't available in every SDK; check out our platform-specific docs for more info. | ||
| </Note> | ||
|
|
||
| ### Error Events | ||
|
|
||
| - **SampleRate** - Configures the sample rate for error events, in the range of 0.0 to 1.0. The default is 1.0, which means that 100% of error events will be sent. If set to 0.1, only 10% of error events will be sent. Events are picked randomly. | ||
|
|
||
| ### Tracing | ||
|
|
||
| - **tracesSampleRate** - A number between 0 and 1, controlling the percentage chance a given transaction will be sent to Sentry. (0 represents 0% while 1 represents 100%.) Applies equally to all transactions created in the app. Either this or `tracesSampler` must be defined to enable tracing. | ||
|
|
||
| - **tracesSampler** - 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 `tracesSampleRate` must be defined to enable tracing. | ||
|
|
||
| Learn more about [tracing](/product/tracing/) in Sentry. | ||
| ### Session Replay | ||
|
|
||
| - **replaysSessionSampleRate** - The sample rate for replays that begin recording immediately and last the entirety of the user's session. 1.0 collects all replays, and 0 collects none. | ||
|
|
||
| - **replaysOnErrorSampleRate** - The sample rate for replays that are recorded when an error happens. This type of replay will record up to a minute of events prior to the error and continue recording until the session ends. 1.0 captures all sessions with an error, and 0 captures none. | ||
coolguyzone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Learn more about [session replay](/product/explore/session-replay/) in Sentry. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.