Skip to content

Commit ea36783

Browse files
committed
Merge branch 'master' into ivana/python/sampling-more-3.0-preparation
2 parents ee5e061 + 7e0635b commit ea36783

File tree

59 files changed

+607
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+607
-234
lines changed

develop-docs/application-architecture/dynamic-sampling/fidelity-and-biases.mdx

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,33 +71,28 @@ Transaction Sampling **does not guarantee complete traces** and instead **applie
7171

7272
## Biases for Sampling
7373

74-
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/).
74+
Dynamic Sampling uses biases to adjust how many events matching certain conditions are sampled. These biases are defined as a set of rules that Relay checks for each event. Learn more about these rules [on the architecture page](/dynamic-sampling/architecture/).
7575

76-
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.
77-
78-
Some of the biases defined by Sentry can be enabled or disabled in the UI, more specifically under **Project Settings -> Performance**, while others are enabled by default and cannot be disabled.
79-
80-
An example of how the UI looks is shown in the following screenshot (the content of this screenshot is subject to change):
76+
Sentry defines a set of biases that are available to all customers. Some of the biases defined by Sentry can be enabled or disabled in the UI under **Project Settings -> Performance**, while others are enabled by default and cannot be disabled. See this example of the UI (the content of this screenshot is subject to change):
8177

8278
![Biases in the UI](./images/biasesUI.png)
8379

8480

8581

8682
### Prioritize New Releases
8783

88-
This bias is used to prioritize traces that are coming from a new release. The goal is to increase the sample rate in the time window that occurs between the creation of a release and its adoption by users. _The identification of a new release is done in the `event_manager` defined [here](https://github.com/getsentry/sentry/blob/43d7c41aee2b22ca9f51916afac40f6cbdcd2b15/src/sentry/event_manager.py#L739-L773)._
84+
This bias is used to prioritize traces that come from a new release. The goal is to increase the sample rate in the time window between the creation of a release and its adoption by users. _New releases are identified in the `event_manager` defined [here](https://github.com/getsentry/sentry/blob/43d7c41aee2b22ca9f51916afac40f6cbdcd2b15/src/sentry/event_manager.py#L739-L773)._
8985

90-
Since the adoption of a release is not constant, we created a system of _decaying_ rules which can interpolate between two sample rates in a given time window with a given function (e.g. `linear`). The idea being that we want to reduce the sample rate since the amount of samples will increase as the release gets adopted by users.
86+
Because release adoption varies over time, a system of _decaying_ rules interpolates between two sample rates within a specified time window and using a specified interpolation function (e.g. `linear`). The sample rate is gradually lowered as user adoption increases and the volume of samples grows.
9187

9288
![Sample Rate and Adoption](./images/sampleRateAndAdoption.png)
9389

94-
The latest release bias uses a decaying rule to interpolate between a starting sample rate and an ending sample rate over a time window that is statically defined for each platform (the list of time to adoptions is define [here](https://github.com/getsentry/sentry/blob/9b98be6b97323a78809a829e06dcbef26a16365c/src/sentry/dynamic_sampling/rules/helpers/time_to_adoptions.py#L25). For example, Android has a bigger time window than JavaScript because on average Android apps take more time to get adopted by users.
90+
The latest release bias uses a decaying rule to interpolate between a starting and ending sample rate over a time window that is statically defined for each platform. The list of adoption times is defined [here](https://github.com/getsentry/sentry/blob/9b98be6b97323a78809a829e06dcbef26a16365c/src/sentry/dynamic_sampling/rules/helpers/time_to_adoptions.py#L25). For example, Android has a longer time window than JavaScript because Android apps generally take more time to be adopted by users.
9591

9692
### Prioritize Dev Environments
9793

98-
This bias is used to prioritize traces coming from a development environment in order to increase the amount of data retained for such environments, since they are more likely to be useful for debugging.
94+
This bias increases the sampling rate for traces from development environments, since this data is often more valuable for debugging. Sentry identifies development environments using a regularly maintained and updated list of known environment patterns. For these environments, the sample rate is set to 100%, so all traces are sampled.
9995

100-
To mark a trace's root transaction as belonging to a development environment, we leverage a list of known development environments, which is maintained and updated regularly by Sentry.
10196

10297
```python
10398
ENVIRONMENT_GLOBS = [
@@ -112,19 +107,18 @@ ENVIRONMENT_GLOBS = [
112107

113108
The list of development environments is available [here](https://github.com/getsentry/sentry/blob/4cb0d863de1ef8e3440153cb440eaca8025dee0d/src/sentry/dynamic_sampling/rules/biases/boost_environments_bias.py#L7).
114109

115-
For prioritizing dev environments, we use a sample rate of `1.0` (100%), which results in all traces being sampled.
116110

117111
### Prioritize Low Volume Projects
118112
<Alert title="✨ Note">
119113
This bias is only active in Automatic Mode (and not in Manual Mode). It applies to any incoming trace and is defined on a per-project basis.
120114
</Alert>
121115

122-
The algorithm used in this bias computes a new sample rate with the goal of prioritizing low-volume projects, which can be drowned out by high-volume projects. The mechanism used for prioritizing is similar to the low-volume transactions bias in which given the sample rate of the organization and the counts of each project, it computes a new sample rate for each project, assuming an ideal distribution of the counts. The sample rate of the boost low volume projects bias is computed using an algorithm that leverages a dynamic sample rate obtained by measuring the incoming volume of transactions in a sliding time window, known as the target fidelity rate. This rate is obtained by calling, at fixed intervals, the `get_sampling_tier_for_volume` function (defined [here](https://github.com/getsentry/sentry/blob/f3a2220ccd3a2118a1255a4c96a9ec2010dab0d8/src/sentry/quotas/base.py#L481)).
116+
This bias uses an algorithm to increase the sample rate for low-volume projects, which might otherwise be overshadowed by high-volume projects. It calculates a new sample rate for each project based on the organization’s overall sample rate and the number of transactions each project receives, aiming for a more balanced distribution. The algorithm dynamically adjusts these rates by measuring _the volume of incoming transactions over a sliding time window_ (also known as the target fidelity rate). At regular intervals, the system calls the `get_sampling_tier_for_volume` function (defined [here](https://github.com/getsentry/sentry/blob/f3a2220ccd3a2118a1255a4c96a9ec2010dab0d8/src/sentry/quotas/base.py#L481)) to determine the appropriate sample rate for each project.
123117

124118

125119

126120
### Prioritize Low Volume Transactions
127-
This bias is used to prioritize low-volume transactions that can be drowned out by high-volume transactions. The goal is to rebalance sample rates of the individual transactions so that low-volume transactions are more likely to have representative samples. The bias is of type trace, which means that the transaction considered for rebalancing will be the root transaction of the trace.
121+
Different transactions have different volumes, and this bias is used to prioritize low-volume transactions that can be drowned out by high-volume transactions. The goal is to rebalance sample rates of the individual transactions so that low-volume transactions are more likely to have representative samples. The transaction considered for rebalancing will be the root transaction of the trace.
128122

129123
Prioritization of low volume transactions works slightly differently depending on the dynamic sampling mode:
130124
- In **Automatic Mode** (`sentry:sampling_mode` == `organization`), the output of the [boost_low_volume_projects](https://github.com/getsentry/sentry/blob/dee539472e999bf590cfc4e99b9b12981963defb/src/sentry/dynamic_sampling/tasks/boost_low_volume_transactions.py#L183) task is used as the base sample rate for the balancing algorithm.
@@ -140,9 +134,7 @@ The algorithms for boosting low volume events are run periodically (with cron jo
140134

141135
### Deprioritize Health Checks
142136

143-
This bias is used to de-prioritize transactions that are classified as health checks. The goal is to reduce the amount of data retained for health checks, since they are not very useful for debugging.
144-
145-
In order to mark a transaction as a health check, we leverage a list of known health check endpoints, which is maintained by Sentry and updated regularly.
137+
This bias reduces the sampling rate for transactions identified as health checks, since these transactions typically provide little value for debugging. Sentry maintains and regularly updates a list of known health check endpoints to identify such transactions and deprioritize them accordingly.
146138

147139
```python
148140
HEALTH_CHECK_GLOBS = [

develop-docs/application-architecture/feedback-architecture.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ filters, **skipping emails if:**
263263
This feature is available if you enable the following feature flags.
264264

265265
- `organizations:user-feedback-ingest`
266-
- `organizations:user-feedback-ui`
266+
- `organizations:user-feedback-ui` (v25.6.2 and prior)
267267
- `organizations:user-feedback-replay-clip` (from v24.7.1 through to v25.3.0)
268268

269269
Auto-registered flags for issue platform, for versions \<= v24.10.0 only:

develop-docs/sdk/telemetry/traces/modules/ai-agents.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ For your AI agents data to show up in the Sentry [AI Agents Insights](https://se
1010

1111
We try to follow the [OpenTelemetry Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) for Generative AI as close as possible. Being 100% compatible is not yet possible, because OpenTelemetry has "Span Events" which Sentry does not support. The input/output to/from an AI model is stored in span events in OpenTelemetry. Since this is not possible in Sentry, we add this data onto span attributes as a list.
1212

13+
<Alert level="success" title="Hint">
14+
The [Sentry Conventions](https://getsentry.github.io/sentry-conventions/generated/attributes/) have all the detailed specifications for `"gen_ai.*"` span attributes.
15+
16+
Sentry Conventions is the single source of truth.
17+
</Alert>
18+
1319
### Invoke Agent Span
1420

1521
Describes AI agent invocation.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
title: Self-hosted Data Flow
3+
sidebar_title: Data Flow
4+
sidebar_order: 20
5+
description: Learn about the data flow of self-hosted Sentry
6+
---
7+
8+
This diagram shows the data flow of self-hosted Sentry. It is similar with [Application Architecture](/application-architecture/overview/) but we are focusing more on the self-hosted components.
9+
10+
```mermaid
11+
graph LR
12+
kafka@{ shape: cyl, label: "Kafka\n(eventstream)" }
13+
redis@{ shape: cyl, label: "Redis" }
14+
postgres@{ shape: cyl, label: "Postgres" }
15+
memcached@{ shape: cyl, label: "Memcached" }
16+
clickhouse@{ shape: cyl, label: "Clickhouse" }
17+
smtp@{ shape: win-pane, label: "SMTP Server" }
18+
symbol-server@{ shape: win-pane, label: "Public/Private Symbol Servers" }
19+
internet@{ shape: trap-t, label: "Internet" }
20+
21+
internet --> nginx
22+
23+
nginx -- Event submitted by SDKs --> relay
24+
nginx -- Web UI & API --> web
25+
26+
subgraph querier [Event Querier]
27+
snuba-api --> clickhouse
28+
end
29+
30+
subgraph processing [Event Processing]
31+
kafka --> snuba-consumer --> clickhouse
32+
snuba-consumer --> kafka
33+
kafka --> snuba-replacer --> clickhouse
34+
kafka --> snuba-subscription-scheduler --> clickhouse
35+
kafka --> snuba-subscription-executor --> clickhouse
36+
redis -- As a celery queue --> sentry-consumer
37+
kafka --> sentry-consumer --> kafka
38+
kafka --> sentry-post-process-forwarder --> kafka
39+
sentry-post-process-forwarder -- Preventing concurrent processing of the same event --> redis
40+
41+
vroom-blob-storage@{ shape: cyl, label: "Blob Storage\n(default is filesystem)" }
42+
43+
kafka -- Profiling event processing --> vroom -- Republish to Kafka to be consumed by Snuba --> kafka
44+
vroom --> snuba-api
45+
vroom -- Store profiles data --> vroom-blob-storage
46+
47+
outgoing-monitors@{ shape: win-pane, label: "Outgoing HTTP Monitors" }
48+
redis -- Fetching uptime configs --> uptime-checker -- Publishing uptime monitoring results --> kafka
49+
uptime-checker --> outgoing-monitors
50+
end
51+
52+
subgraph ui [Web User Interface]
53+
sentry-blob-storage@{ shape: cyl, label: "Blob Storage\n(default is filesystem)" }
54+
55+
web --> worker
56+
web --> postgres
57+
web -- Caching layer --> memcached
58+
web -- Queries on event (errors, spans, etc) data (to snuba-api) --> snuba-api
59+
web -- Avatars, attachments, etc --> sentry-blob-storage
60+
worker -- As a celery queue --> redis
61+
worker --> postgres
62+
worker -- Alert & digest emails --> smtp
63+
web -- Sending test emails --> smtp
64+
end
65+
66+
subgraph ingestion [Event Ingestion]
67+
relay@{ shape: rect, label: 'Relay' }
68+
sentry_ingest_consumer[sentry-ingest-consumers]
69+
70+
relay -- Process envelope into specific types --> kafka --> sentry_ingest_consumer -- Caching event data (to redis) --> redis
71+
relay -- Register relay instance --> web
72+
relay -- Fetching project configs (to redis) --> redis
73+
sentry_ingest_consumer -- Symbolicate stack traces --> symbolicator --> symbol-server
74+
sentry_ingest_consumer -- Save event payload to Nodestore --> postgres
75+
sentry_ingest_consumer -- Republish to events topic --> kafka
76+
end
77+
```
78+
79+
### Event Ingestion Pipeline
80+
81+
1. Events from the SDK is sent to the `relay` service.
82+
2. Relay parses the incoming envelope, validates whether the DSN and Project ID are valid. It reads project config data from `redis`.
83+
3. Relay builds a new payload to be consumed by Sentry ingest consumers, and sends it to `kafka`.
84+
4. Sentry `ingest-*` consumers ( with `*` [wildcard] being the event type [errors, transaction, profiles, etc]) consumes the event, caches it in `redis` and starts the `preprocess_event` task.
85+
5. The `preprocess_event` task symbolicates stack traces with `symbolicator` service, and processes the event according to its event type.
86+
6. The `preprocess_event` task saves the event payload to nodestore (default nodestore backend is `postgres`).
87+
7. The `preprocess_event` task publishes the event to `kafka` under the `events` topic.
88+
89+
### Event Processing Pipeline
90+
91+
1. The `snuba-consumer` service consumes events from `events` topic and processes them. After the events are written to clickhouse, snuba publishes error & transaction events to `post-process-forwarder`.
92+
2. The Sentry `post-process-forwarder` consumer consumes messages and spawns a `post_process_group` task for each processed error & issue occurance.
93+
94+
### Web User Interface
95+
96+
1. The `web` service is what you see, it's the Django web UI and API that serves the Sentry's frontend.
97+
2. The `worker` service mainly consumes tasks from `redis` that acts as a celery queue. One notable task is to send emails through the SMTP server.
98+

docs/cli/configuration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ If this is set to false then SSL revocation checks are disabled on Windows. This
141141

142142
`SENTRY_HTTP_MAX_RETRIES` (_http.max_retries_):
143143

144-
Sets the maximum number of retry attempts for upload operations (e.g., uploads of release files and debug symbols). The default is `5`.
144+
Sets the maximum number of retry attempts for HTTP requests, which may be experiencing a transient failure. The default is `5`.
145145

146146
(_ui.show_notifications_):
147147

docs/concepts/data-management/data-forwarding.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ description: "Learn about forwarding processed events to third-party providers."
66

77
<Include name="feature-available-for-plan-trial-business.mdx" />
88

9+
<Alert>
10+
11+
The plugins listed on this page have been deprecated and will be removed from Sentry in a future date.
12+
13+
</Alert>
14+
915
Sentry provides the ability to forward processed error events to certain third-party providers, such as [Segment](https://segment.com) and [Amazon SQS](https://aws.amazon.com/sqs/).
1016

1117
This is often useful when you may want to analyze exceptions more deeply, or empower other teams, such as a Business Intelligence function.

docs/organization/authentication/sso/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Every member who creates a new account via SSO will be given global organization
2424

2525
Our SSO implementation prioritizes security. We aggressively monitor linked accounts and will disable them if there's any reasonable sign that the account’s access may have been revoked. Generally this will be transparent to you, but if the provider is functioning in an unexpected way you may experience more frequent re-authorization requests.
2626

27-
Sessions last for [Django's default session length](https://docs.djangoproject.com/en/1.11/topics/http/sessions/#using-cookie-based-sessions), which is two weeks. For individual organizations with single sign-on, we expire organization access after one day (20 hours).
27+
Sessions last for [Django's default session length](https://docs.djangoproject.com/en/1.11/topics/http/sessions/#using-cookie-based-sessions), which is two weeks.
2828

2929
## Providers
3030

docs/organization/integrations/issue-tracking/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ description: "Learn more about Sentry's issue tracking integrations."
1414
- [Goast.ai](/organization/integrations/issue-tracking/goast/)
1515
- [Height](/organization/integrations/issue-tracking/height/)
1616
- [Incident.io](/organization/integrations/issue-tracking/incidentio/)
17-
- [Jira/Jira Server](/organization/integrations/issue-tracking/jira/)
17+
- [Jira/Jira Server/Jira Data Center](/organization/integrations/issue-tracking/jira/)
1818
- [Kitemaker](/organization/integrations/issue-tracking/kitemaker/)
1919
- [Linear](/organization/integrations/issue-tracking/linear/)
2020
- [Shortcut](/organization/integrations/issue-tracking/shortcut/)

docs/organization/integrations/issue-tracking/jira/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ Sentry owner, manager, or admin permissions, and Jira admin permissions are requ
2828

2929
Jira should now be authorized for all projects under your Sentry organization.
3030

31-
### Jira Server
31+
### Jira Server/Data Center
3232

3333
<Alert>
3434

35-
As of February 2024, Jira has discontinued support for Jira Server. Accordingly, we have stopped maintaining the docs for this integration. The instructions below may be out of date.
35+
As of February 2024, Jira has discontinued support for Jira Server. Accordingly, we have stopped maintaining the integration. You can still use it the same way with its successor, Jira Data Center.
3636

3737
</Alert>
3838

docs/platforms/android/configuration/multi-process-apps.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ The Sentry Android SDK will not automatically initialize in non-main processes b
1515
tools:node="merge" />
1616
```
1717

18-
Alternatively, you can call `SentryAndroid.init(...)`.
18+
Alternatively, you can call `SentryAndroid.init(...)` in each process where you want to initialize Sentry.

0 commit comments

Comments
 (0)