You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: develop-docs/application-architecture/dynamic-sampling/fidelity-and-biases.mdx
+9-13Lines changed: 9 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Fidelity and Biases
3
3
sidebar_order: 2
4
4
---
5
5
6
-
Dynamic Sampling is a feature that allows Sentry to automatically adjust the amount of data retained based on the value of the data. This is technically achieved by applying a **sample rate** to every event, which is determined by a **set of rules** that are evaluated for each event.
6
+
Dynamic Sampling allows Sentry to automatically adjust the amount of data retained based on how valuable the data is to the user. This is technically achieved by applying a **sample rate** to every event, which is determined by a **set of rules** that are evaluated for each event.
7
7
8
8
<Alerttitle="✨ Note"level="info">
9
9
@@ -15,7 +15,10 @@ A sample rate is a number in the interval `[0.0, 1.0]` that will determine the l
15
15
16
16
At the core of Dynamic Sampling there is the concept of **fidelity**, which translates to an overall **target sample rate** that should be applied across all events of an organization.
17
17
18
-
In automatic mode, the target sample rate is computed for each project based on the volume of events in a time window of 24 hours. In manual mode, the user can set a constant sample rate for each project that will not be automatically adjusted.
18
+
### Target Sample Rate Adjustment: Automatic Mode and Manual Mode
19
+
There are two available modes to govern the target sample rates for Dynamic Sampling: Automatic Mode and Manual Mode.
20
+
-**Automatic mode** dynamically manages the target sample rate for each project based on the target sample rate for the organization, prioritizing lower volume projects to increase visibility.
21
+
-**Manual mode** allows the user to set static target sample rates on a per-project basis that serve as the baseline sample rate before applying the dynamic biases outlined below. Target sample rates are not adjusted by the system.
19
22
20
23
Within this target sample rate, Dynamic Sampling can create a **bias toward more meaningful data**. This is achieved by constantly updating and communicating special rules to Relay, via a project configuration, which then applies targeted sampling to every event.
21
24
@@ -39,12 +42,11 @@ Sentry supports **two fundamentally different types of sampling**. While this is
39
42
40
43
### Trace Sampling
41
44
42
-
A trace is a **collection of events that are related to each other**. For example a trace could contain events started from your frontend that are then generating events in your backend.
45
+
A trace is a **collection of events that are related to each other**. For example, a trace could contain events started from your frontend that are then generating events in your backend.
43
46
44
-
TODO: have the fields usable for sampling changed?
45
47
Trace sampling ensures that **either all events of a trace are sampled, or none**. That is, these rules **always yield the same sampling decision** for every event in the same trace. This requires the cooperation of SDKs and thus allows sampling only by `project`, `release`, `environment`, and `transaction` name.
46
48
47
-
To achieve trace sampling, SDKs pass all fields that can be sampled by [Dynamic Sampling Context (DSC)](/sdk/performance/dynamic-sampling-context/) (defined [here](https://getsentry.github.io/relay/relay_sampling/dsc/struct.DynamicSamplingContext.html)) as they propagate traces. _This ensures that every transaction from the same trace comes with the same DSC._
49
+
To achieve trace sampling, SDKs pass all fields that can be sampled by [Dynamic Sampling Context (DSC)](/sdk/performance/dynamic-sampling-context/) (defined [here](https://getsentry.github.io/relay/relay_sampling/dsc/struct.DynamicSamplingContext.html)) as they propagate traces. _This ensures that every event from the same trace comes with the same DSC._
48
50
49
51

50
52
@@ -56,17 +58,11 @@ In order to achieve full trace sampling, the random number generator used by Rel
56
58
57
59
### Transaction Sampling
58
60
59
-
Transaction Sampling **does not guarantee complete traces** and instead **applies to individual transactions** by looking at the incoming transaction's body. It can be used to remove unwanted transactions from traces, or to individually boost transactions at the expense of incomplete contextual traces
60
-
61
-
## Sample Rate Adjustment: Automatic Mode and Manual Mode
62
-
There are two modes of operation for Dynamic Sampling: Automatic Mode and Manual Mode.
63
-
Automatic mode manages the sample rate for each project based on the target sample rate for the organization.
64
-
Manual mode allows the user to set sample rates on a per-project basis.
65
-
61
+
Transaction Sampling **does not guarantee complete traces** and instead **applies to individual transactions** by looking at the incoming transaction's body. It can be used to remove unwanted transactions from traces, or to individually boost transactions at the expense of incomplete contextual traces.
66
62
67
63
## Biases for Sampling
68
64
69
-
A bias is a set of one or more rules that are evaluated for each event. More specifically, when we define a bias, we want to achieve a specific objective, which **can be expressed as a set of rules**. To learn more about rules, check out the architecture page [here](/dynamic-sampling/architecture/).
65
+
A bias is a set of one or more rules that are evaluated for each event. More specifically, when we define a bias, we want to achieve a specific objective, which **can be expressed as a set of rules**. You learn more about rules on the architecture page [here](/dynamic-sampling/architecture/).
70
66
71
67
Sentry has already defined a set of biases that are available to all customers. These biases have different goals, but they can be combined to express more complex semantics.
0 commit comments