Skip to content

Commit 57041f8

Browse files
coolguyzoneAlex Krawieclizokm
authored andcommitted
Add platform-agnostic sample rate page (#12016)
* Refactor sample rates page to be more specific * Update docs/concepts/key-terms/sample-rates.mdx Co-authored-by: Liza Mock <[email protected]> * Update docs/concepts/key-terms/sample-rates.mdx Co-authored-by: Liza Mock <[email protected]> * Update docs/concepts/key-terms/sample-rates.mdx Co-authored-by: Liza Mock <[email protected]> * Add an overview of sample rates * Update docs/concepts/key-terms/sample-rates.mdx Co-authored-by: Liza Mock <[email protected]> * Update docs/concepts/key-terms/sample-rates.mdx Co-authored-by: Liza Mock <[email protected]> * Update docs/concepts/key-terms/sample-rates.mdx Co-authored-by: Liza Mock <[email protected]> * Update docs/concepts/key-terms/sample-rates.mdx Co-authored-by: Liza Mock <[email protected]> --------- Co-authored-by: Alex Krawiec <[email protected]> Co-authored-by: Liza Mock <[email protected]>
1 parent c89d8c5 commit 57041f8

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Sample Rates
3+
sidebar_order: 11
4+
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.
5+
---
6+
7+
## Overview
8+
9+
### What Is a Sample Rate?
10+
11+
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.
12+
13+
14+
### Why Not Capture All Events?
15+
16+
We recommend sampling your transactions for two reasons:
17+
18+
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.
19+
20+
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.
21+
22+
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.
23+
24+
## Sampling Rate Options
25+
26+
<Note>
27+
Some of the options below aren't available in every SDK; check out our platform-specific docs for more info.
28+
</Note>
29+
30+
### Error Events
31+
32+
- **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.
33+
34+
### Tracing
35+
36+
- **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.
37+
38+
- **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.
39+
40+
Learn more about [tracing](/product/tracing/) in Sentry.
41+
### Session Replay
42+
43+
- **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.
44+
45+
- **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.
46+
47+
Learn more about [session replay](/product/explore/session-replay/) in Sentry.

0 commit comments

Comments
 (0)