From 5159d02ec2ae00e3ab81ef40e2502e69363e2087 Mon Sep 17 00:00:00 2001 From: Alex Krawiec Date: Tue, 26 Nov 2024 14:46:48 -0800 Subject: [PATCH 1/9] Refactor sample rates page to be more specific --- docs/concepts/key-terms/sample-rates.mdx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 docs/concepts/key-terms/sample-rates.mdx diff --git a/docs/concepts/key-terms/sample-rates.mdx b/docs/concepts/key-terms/sample-rates.mdx new file mode 100644 index 0000000000000..d3e4ae9bfa80d --- /dev/null +++ b/docs/concepts/key-terms/sample-rates.mdx @@ -0,0 +1,21 @@ +--- +title: Sample Rates +sidebar_order: 11 +description: "Adding Sentry to your app gives you a great deal of very 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." +--- + + +Some of the options below are not available in every SDK; check out platform-specific docs for more info. + + + + +- **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. + +- **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. + +- **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. From 354870389570ff88c76109e791590a4009469dfa Mon Sep 17 00:00:00 2001 From: Alex Krawiec Date: Mon, 2 Dec 2024 16:02:54 -0800 Subject: [PATCH 2/9] Update docs/concepts/key-terms/sample-rates.mdx Co-authored-by: Liza Mock --- docs/concepts/key-terms/sample-rates.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/concepts/key-terms/sample-rates.mdx b/docs/concepts/key-terms/sample-rates.mdx index d3e4ae9bfa80d..52e152e67b19f 100644 --- a/docs/concepts/key-terms/sample-rates.mdx +++ b/docs/concepts/key-terms/sample-rates.mdx @@ -5,7 +5,7 @@ description: "Adding Sentry to your app gives you a great deal of very valuable --- -Some of the options below are not available in every SDK; check out platform-specific docs for more info. +Some of the options below aren't available in every SDK; check out our platform-specific docs for more info. From 5d7155bf962d0ec01b420a9bb398450e5bdfbcac Mon Sep 17 00:00:00 2001 From: Alex Krawiec Date: Mon, 2 Dec 2024 16:03:01 -0800 Subject: [PATCH 3/9] Update docs/concepts/key-terms/sample-rates.mdx Co-authored-by: Liza Mock --- docs/concepts/key-terms/sample-rates.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/concepts/key-terms/sample-rates.mdx b/docs/concepts/key-terms/sample-rates.mdx index 52e152e67b19f..6e702decebc4a 100644 --- a/docs/concepts/key-terms/sample-rates.mdx +++ b/docs/concepts/key-terms/sample-rates.mdx @@ -1,7 +1,7 @@ --- title: Sample Rates sidebar_order: 11 -description: "Adding Sentry to your app gives you a great deal of very 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." +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. --- From 894cd1c54995b099f39f4ce2462b7a4e3f088ea2 Mon Sep 17 00:00:00 2001 From: Alex Krawiec Date: Mon, 2 Dec 2024 16:03:16 -0800 Subject: [PATCH 4/9] Update docs/concepts/key-terms/sample-rates.mdx Co-authored-by: Liza Mock --- docs/concepts/key-terms/sample-rates.mdx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/concepts/key-terms/sample-rates.mdx b/docs/concepts/key-terms/sample-rates.mdx index 6e702decebc4a..695f58f4d5e15 100644 --- a/docs/concepts/key-terms/sample-rates.mdx +++ b/docs/concepts/key-terms/sample-rates.mdx @@ -8,14 +8,19 @@ description: Learn how to manage the amount of data you send and are billed for Some of the options below aren't available in every SDK; check out our platform-specific docs for more info. +## 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. +## 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. -- **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. From c4dd30d1dc70c15e4cbf13f30b87a7850c27989a Mon Sep 17 00:00:00 2001 From: Alex Krawiec Date: Tue, 3 Dec 2024 10:01:04 -0800 Subject: [PATCH 5/9] Add an overview of sample rates --- docs/concepts/key-terms/sample-rates.mdx | 26 ++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/concepts/key-terms/sample-rates.mdx b/docs/concepts/key-terms/sample-rates.mdx index 695f58f4d5e15..526e95aa83c6c 100644 --- a/docs/concepts/key-terms/sample-rates.mdx +++ b/docs/concepts/key-terms/sample-rates.mdx @@ -4,23 +4,41 @@ 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 every 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 with the goal of finding a balance between performance and volume concerns with data accuracy. You don't want to collect too much data, but you want to collect sufficient data from which to draw meaningful conclusions. If you’re not sure what rate to choose, start with a low value and gradually increase it as you learn more about your traffic patterns and volume. + +## Sampling Rate Options + Some of the options below aren't available in every SDK; check out our platform-specific docs for more info. -## Error Events +### 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 +### 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. -## Session Replay +### 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. - From 597e24b1f2bd084178f97254ddc9c53b168b0165 Mon Sep 17 00:00:00 2001 From: Alex Krawiec Date: Tue, 3 Dec 2024 11:08:56 -0800 Subject: [PATCH 6/9] Update docs/concepts/key-terms/sample-rates.mdx Co-authored-by: Liza Mock --- docs/concepts/key-terms/sample-rates.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/concepts/key-terms/sample-rates.mdx b/docs/concepts/key-terms/sample-rates.mdx index 526e95aa83c6c..47105b7cf4c60 100644 --- a/docs/concepts/key-terms/sample-rates.mdx +++ b/docs/concepts/key-terms/sample-rates.mdx @@ -15,7 +15,7 @@ Adding Sentry to your app gives you a lot of valuable information about errors a We recommend sampling your transactions for two reasons: -1. Capturing a single trace involves minimal overhead, but capturing traces for every page load or every API request may add an undesirable load to your system. +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. From decb47dcc49492a5d4bb6e904229623263fdf173 Mon Sep 17 00:00:00 2001 From: Alex Krawiec Date: Tue, 3 Dec 2024 11:09:16 -0800 Subject: [PATCH 7/9] Update docs/concepts/key-terms/sample-rates.mdx Co-authored-by: Liza Mock --- docs/concepts/key-terms/sample-rates.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/concepts/key-terms/sample-rates.mdx b/docs/concepts/key-terms/sample-rates.mdx index 47105b7cf4c60..0e37ef25ea922 100644 --- a/docs/concepts/key-terms/sample-rates.mdx +++ b/docs/concepts/key-terms/sample-rates.mdx @@ -19,7 +19,7 @@ We recommend sampling your transactions for two reasons: 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 with the goal of finding a balance between performance and volume concerns with data accuracy. You don't want to collect too much data, but you want to collect sufficient data from which to draw meaningful conclusions. If you’re not sure what rate to choose, start with a low value and gradually increase it as you learn more about your traffic patterns and volume. +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 From 1275b8f3f0c3d20b52b98b29ef758da78f0c63c9 Mon Sep 17 00:00:00 2001 From: Alex Krawiec Date: Tue, 3 Dec 2024 11:09:42 -0800 Subject: [PATCH 8/9] Update docs/concepts/key-terms/sample-rates.mdx Co-authored-by: Liza Mock --- docs/concepts/key-terms/sample-rates.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/concepts/key-terms/sample-rates.mdx b/docs/concepts/key-terms/sample-rates.mdx index 0e37ef25ea922..7356bc202bd03 100644 --- a/docs/concepts/key-terms/sample-rates.mdx +++ b/docs/concepts/key-terms/sample-rates.mdx @@ -37,6 +37,7 @@ Some of the options below aren't available in every SDK; check out our platform- - **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. From f514f06718d46ec396bedead7e756ad5f8b83ebc Mon Sep 17 00:00:00 2001 From: Alex Krawiec Date: Tue, 3 Dec 2024 11:09:51 -0800 Subject: [PATCH 9/9] Update docs/concepts/key-terms/sample-rates.mdx Co-authored-by: Liza Mock --- docs/concepts/key-terms/sample-rates.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/concepts/key-terms/sample-rates.mdx b/docs/concepts/key-terms/sample-rates.mdx index 7356bc202bd03..61a5825650e01 100644 --- a/docs/concepts/key-terms/sample-rates.mdx +++ b/docs/concepts/key-terms/sample-rates.mdx @@ -43,3 +43,5 @@ Learn more about [tracing](/product/tracing/) in Sentry. - **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. + +Learn more about [session replay](/product/explore/session-replay/) in Sentry.