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
Merge branch 'master' into martinhaintz/redact-screenshots-via-view-hierarchy
* master: (28 commits)
feat(angular): Update SDK provider setup for Angular 19 (#11921)
feat(dynamic-sampling): adapt docs to new dynamic sampling logic (#11886)
update banner for post-launch week promotion (#11964)
chore(android): Add masking options to AndroidManifest (#11863)
Bump API schema to 2126f7dd (#11965)
chore(Profiling): Add callouts and links to Android Profiling troubleshooting info (#11905)
docs(flutter): Use sentry flutter init in samples (#11858)
use native crypto to generate uuid (#11959)
fix vercel integration 404 (#11958)
Add RN Replay Privacy page (#11798)
feat(dashboards): Add docs for Dashboard Edit Access Selector (#11822)
feat(app-starts): Add RN SDK min version (#11650)
feat(realy): Add Relay best practices guide (#11914)
docs(sdks): New Scope APIs (#11943)
docs(sdks): Span Sampling (#11940)
Add include explaining sample code options (#11866)
devenv: internal troubleshooting (#11947)
Bump API schema to 0b18bfae (#11946)
Bump API schema to 2bee5317 (#11945)
feat: Link to Replay Issues when we mention Perf Issues as well (#11933)
...
Copy file name to clipboardExpand all lines: develop-docs/application-architecture/dynamic-sampling/the-big-picture.mdx
+33-24Lines changed: 33 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,29 +6,38 @@ sidebar_order: 1
6
6
7
7

8
8
9
+
10
+
<Alerttitle="💡 Note"level="info">
11
+
12
+
Dynamic Sampling currently operates on either spans or transactions to measure data throughput. This is controlled by the feature flag `organizations:dynamic-sampling-spans` and usually set to what the organization's subscription is metered by. In development, this currently defaults to transactions.
13
+
The logic between the two data categories is identical, so most of this documentation is kept at a generic level and important differences are pointed out explicitly.
14
+
15
+
</Alert>
16
+
17
+
9
18
## Sequencing
10
19
11
20
Dynamic Sampling occurs at the edge of our ingestion pipeline, precisely in [Relay](https://github.com/getsentry/relay).
12
21
13
-
When transaction events arrive, in a simplified model, they go through the following steps (some of which won't apply if you self-host Sentry):
22
+
When events arrive, in a simplified model, they go through the following steps:
14
23
15
-
1.**Inbound data filters**: every transaction runs through inbound data filters as configured in project settings, such as legacy browsers or denied releases. Transactions dropped here do not count for quota and are not included in “total transactions” data.
16
-
2.**Quota enforcement**: Sentry charges for all further transactions sent in, before events are passed on to dynamic sampling.
17
-
3.**Metrics extraction**: after passing quotas, Sentry extracts metrics from the total incoming transactions. These metrics provide granular numbers for the performance and frequency of every application transaction.
18
-
4.**Dynamic Sampling**: based on an internal set of rules, Relay determines a sample rate for every incoming transaction event. A random number generator finally decides whether this payload should be kept or dropped.
19
-
5.**Rate limiting**: transactions that are sampled by Dynamic Sampling will be stored and indexed. To protect the infrastructure, internal rate limits apply at this point. Under normal operation, this **rate limit is never reached** since dynamic sampling already reduces the volume of stored events.
24
+
1.**Inbound data filters**: every event runs through inbound data filters as configured in project settings, such as legacy browsers or denied releases. Events dropped here are not counted towards quota and are not included in "total events" data.
25
+
2.**Quota enforcement**: Sentry charges for all further events sent in, before they are passed on to dynamic sampling.
26
+
3.**Metrics extraction**: after passing quotas, Sentry extracts metrics from the total incoming events. These metrics provide granular numbers for the performance and frequency of every event.
27
+
4.**Dynamic Sampling**: based on an internal set of rules, Relay determines a sample rate for every incoming event. A random number generator finally decides whether a payload should be kept or dropped.
28
+
5.**Rate limiting**: events that are sampled by Dynamic Sampling will be stored and indexed. To protect the infrastructure, internal rate limits apply at this point. Under normal operation, this **rate limit is never reached** since dynamic sampling already reduces the volume of events stored.
20
29
21
30
<Alerttitle="💡 Example"level="info">
22
31
23
-
A client is sending 1000 transactions per second to Sentry:
24
-
1. 100 transactions per second are from old browsers and get dropped through an inbound data filter.
25
-
2. The remaining 900 transactions per second show up as total transactions in Sentry.
26
-
3. Their current overall sample rate is at 20%, which statistically samples 180 transactions per second.
27
-
4. Since this is above the 100/s limit, about 80 transactions per second are randomly dropped, and the rest is stored.
32
+
A client is sending 1000 events per second to Sentry:
33
+
1. 100 events per second are from old browsers and get dropped through an inbound data filter.
34
+
2. The remaining 900 events per second show up as total events in Sentry.
35
+
3. Their current overall sample rate is at 20%, which statistically samples 180 events per second.
36
+
4. Since this is above the 100/s limit, about 80 events per second are randomly dropped, and the rest is stored.
28
37
29
38
</Alert>
30
39
31
-
## Rate Limiting and Total Transactions
40
+
## Rate Limiting and Total Events
32
41
33
42
The ingestion pipeline has two kinds of rate limits that behave differently compared to organizations without dynamic sampling:
34
43
@@ -37,49 +46,49 @@ The ingestion pipeline has two kinds of rate limits that behave differently com
37
46
38
47
<Alerttitle="✨️ Note"level="info">
39
48
40
-
There is a dedicated rate limit for stored transactions after inbound filters and dynamic sampling. However, it does not affect total transactions since the fidelity decreases with higher total transaction volumes and this rate limit is not expected to trigger since Dynamic Sampling already reduces the stored transaction throughput.
49
+
There is a dedicated rate limit for stored events after inbound filters and dynamic sampling. However, it does not affect total events since the fidelity decreases with higher total event volumes and this rate limit is not expected to trigger since Dynamic Sampling already reduces the stored event throughput.
41
50
42
51
</Alert>
43
52
44
53
## Rate Limiting and Trace Completeness
45
54
46
-
Dynamic sampling ensures complete traces by retaining all transactions associated with a trace if the head transaction is preserved.
55
+
Dynamic sampling ensures complete traces by retaining all events associated with a trace if the head event is preserved.
47
56
48
-
Despite dynamic sampling providing trace completeness, transactions or other items (errors, replays, ...) may still be missing from a trace when rate limiting drops one or more transactions. Rate limiting drops items without regard for the trace, making each decision independently and potentially resulting in broken traces.
57
+
Despite dynamic sampling providing trace completeness, events or other items (errors, replays, ...) may still be missing from a trace when rate limiting drops one or more of them. Rate limiting drops items without regard for the trace, making each decision independently and potentially resulting in broken traces.
49
58
50
59
<Alerttitle="💡 Example"level="info">
51
60
52
-
For example, if there is a trace from `Project A` to `Project B` and `Project B` is subject to rate limiting or quota enforcement, transactions of `Project B` from the trace initiated by `Project A` are lost.
61
+
For example, if there is a trace from `Project A` to `Project B` and `Project B` is subject to rate limiting or quota enforcement, events of `Project B` from the trace initiated by `Project A` are lost.
53
62
54
63
</Alert>
55
64
56
65
## Client Side Sampling and Dynamic Sampling
57
66
58
-
Clients have their own [traces sample rate](https://docs.sentry.io/platforms/javascript/performance/#configure-the-sample-rate). The client sample rate is a number in the range `[0.0, 1.0]` (from 0% to 100%) that controls **how many transactions arrive at Sentry**. While documentation will generally suggest a sample rate of `1.0`, for some use cases it might be better to reduce it.
67
+
Clients have their own [traces sample rate](https://docs.sentry.io/platforms/javascript/tracing/#configure). The client sample rate is a number in the range `[0.0, 1.0]` (from 0% to 100%) that controls **how many events arrive at Sentry**. While documentation will generally suggest a sample rate of `1.0`, for some use cases it might be better to reduce it.
59
68
60
-
Dynamic Sampling further reduces how many transactions get stored internally. **While many-to-most graphs and numbers in Sentry are based on total transactions**, accessing spans and tags requires stored transactions. The sample rates apply on top of each other.
69
+
Dynamic Sampling further reduces how many events get stored internally. **While most graphs and numbers in Sentry are based on metrics**, accessing spans and tags requires stored events. The sample rates apply on top of each other.
61
70
62
-
An example of client side sampling and Dynamic Sampling starting from 100k transactions which results in 15k stored transactions is shown below:
71
+
An example of client side sampling and Dynamic Sampling starting from 100k events which results in 15k stored events is shown below:
63
72
64
73

65
74
66
75
## Total Transactions
67
76
68
-
To collect unsampled information for “total” transactions in Performance, Alerts, and Dashboards, Relay extracts [metrics](https://getsentry.github.io/relay/relay_metrics/index.html) from transactions. In short, these metrics comprise:
77
+
To collect unsampled information for “total” transactions in Performance, Alerts, and Dashboards, Relay extracts [metrics](https://getsentry.github.io/relay/relay_metrics/index.html) from spans and transactions. In short, these metrics comprise:
69
78
70
-
- Counts and durations for all transactions.
79
+
- Counts and durations for all events.
71
80
- A distribution (histogram) for all measurements, most notably the web vitals.
72
81
- The number of unique users (set).
73
82
74
83
Each of these metrics can be filtered and grouped by a number of predefined tags, [implemented in Relay](https://github.com/getsentry/relay/blob/master/relay-server/src/metrics_extraction/transactions/types.rs#L142-L157).
75
84
76
-
For more granular queries, **stored transaction events are needed**. _The purpose of dynamic sampling here is to ensure that enough representatives are always available._
85
+
For more granular queries, **stored events are needed**. _The purpose of dynamic sampling here is to ensure that there are always sufficient representative sample events._
77
86
78
87
<Alerttitle="💡 Example"level="info">
79
88
80
-
If Sentry applies a 1% dynamic sample rate, you can still receive accurate TPM (transactions per minute) and web vital quantiles through total transaction data backed by metrics. There is also a listing of each of these numbers by the transaction.
89
+
If Sentry applies a 1% dynamic sample rate, you can still receive accurate events per minute (SPM or TPM, depending on event type) and web vital quantiles through total event data backed by metrics. There is also a listing of each of these numbers by the transaction.
81
90
82
-
When you go into transaction summary or Discover, you might want to now split the data by a custom tag you’ve added to your transactions. This granularity is not offered by metrics, so **these queries need to use stored transactions**.
91
+
When you go into the trace explorer or Discover, you might want to now split the data by a custom tag you’ve added to your events. This granularity is not offered by metrics, so **these queries need to use stored events**.
You might also be interested in <Linkto="/development/continuous-integration/#troubleshooting-ci">troubleshooting CI</Link>.
190
+
The more up-to-date troubleshooting docs for the internal development environment on MacOS are <Linkto="https://www.notion.so/sentry/devenv-troubleshooting-1448b10e4b5d8080ba04f452e33de48d">here</Link>.
191
+
192
+
You might also be interested in <Linkto="/development/continuous-integration/#troubleshooting-ci">Troubleshooting CI</Link>.
191
193
192
194
---
193
195
@@ -210,7 +212,7 @@ following in getsentry:
210
212
211
213
**Problem:** You see an error that mentions something like `pkg_resources.DistributionNotFound: The 'some_dependency<0.6.0,>=0.5.5' distribution was not found and is required by sentry`
212
214
213
-
**Solution:** Your virtualenv needs to be updated. Run `make install-py-dev`.
215
+
**Solution:** Your virtualenv needs to be updated. Run `devenv sync`.
Copy file name to clipboardExpand all lines: develop-docs/development-infrastructure/python-dependencies.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ To add or manually update a dependency:
23
23
5. In that repo, add to or update `requirements-base.txt` or `requirements-dev.txt`, as appropriate. Note that many of our dependencies are pinned with lower bounds only, to encourage updating to latest versions, though we do use exact pins for certain core dependencies like `django`. Choose whichever one feels most appropriate in your case.
24
24
6. Run `make freeze-requirements`. You might need to wait a few minutes for the changes to `getsentry/pypi` to be deployed before this will work without erroring.
25
25
7. Commit your changes (which should consist of changes to both one of the `requirements` files and its corresponding lockfile) to a branch and open a PR in the relevant repo. If it's not obvious, explain why you're adding or updating the dependency. Tag `owners-python-build` if they haven't already been auto-tagged.
26
-
8. Merge your PR, pull `master`, and run `make install-py-dev`.
26
+
8. Merge your PR, pull `master`, and run `devenv sync`.
0 commit comments