Skip to content

Commit 932185b

Browse files
author
Karl Heinz Struggl
committed
Merge branch 'master' into kahest/mobile-sdk-overhead-fixes
2 parents b470281 + 4cbd202 commit 932185b

File tree

89 files changed

+803
-186
lines changed

Some content is hidden

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

89 files changed

+803
-186
lines changed

.github/workflows/lint-404s.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- 'platform-includes/**'
2626
dev-docs:
2727
- 'develop-docs/**'
28-
- uses: oven-sh/setup-bun@v1
28+
- uses: oven-sh/setup-bun@v2
2929
with:
3030
bun-version: latest
3131

develop-docs/engineering-practices/rust.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar_order: 40
77
## Getting Started
88

99
- A quick introduction into the Syntax for first-timers:
10-
[A half-hour to learn Rust](https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/)
10+
[A half-hour to learn Rust](https://fasterthanli.me/articles/a-half-hour-to-learn-rust)
1111
- The Rust Book, comprehensively documenting the language:
1212
[The Rust Programming Language](https://doc.rust-lang.org/book/)
1313
- [The Async Book](https://rust-lang.github.io/async-book/)

develop-docs/self-hosted/index.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,16 @@ By default, there exists no `.env.custom` file. In this case, you can manually a
178178

179179
Please keep in mind to check the `.env` file for changes, when you perform an upgrade of Sentry, so that you can adjust your `.env.custom` accordingly, if required, as `.env` is ignored entirely if `.env.custom` is present.
180180

181+
For all Docker Compose commands, you should specify your `.env.custom`, otherwise the default `.env` file will be used. Some examples are:
182+
183+
```bash
184+
docker compose --env-file .env.custom up -d
185+
186+
# You can also specify the original `.env` file as a fallback if the
187+
# environment variable doesn't exists on the `.env.custom` file.
188+
docker compose --env-file .env --env-file .env.custom up -d
189+
```
190+
181191
### Enhance Sentry image
182192

183193
To install plugins and their dependencies or make other modifications to the Sentry base image, copy `sentry/enhance-image.example.sh` to `sentry/enhance-image.sh` and add necessary steps there. For example, you can use `apt-get` to install dependencies and use `pip` to install plugins.

develop-docs/self-hosted/releases.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ git checkout 23.11.0
3636

3737
We may have some updated configuration, especially for new features, so always check the example config files under the <Link to="https://github.com/getsentry/self-hosted/blob/master/sentry/">sentry directory</Link> and see if you need to update your existing configuration. We do our best to automate critical configuration updates, but you should always check your configs during upgrades.
3838

39-
Finally, to upgrade, just run `./install.sh`.
39+
If you have a `.env.custom` file, make sure to copy new environment variables from the `.env` file into the `.env.custom` file before running the install script.
4040

41+
Finally, to upgrade, run `./install.sh`. Upon completion, run `docker compose up -d` (or if you have `.env.custom` file, run `docker compose --env-file .env --env-file .env.custom up -d`).
4142

4243
### Hard Stops
4344

docs/concepts/data-management/event-grouping/stack-trace-rules.mdx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,27 @@ description: "Learn how to use stack trace rules to group incoming events based
66

77
<Include name="only-error-issues-note.mdx" />
88

9-
If you use stack traces for grouping, the stack trace rules (previously known as _grouping enhancements_) influence the data that's fed into the grouping algorithm. These rules can be configured on a per-project basis in **[Project] > Settings > Issue Grouping > Stack Trace Rules**.
9+
Stack trace rules improve issue tracking by ensuring accurate grouping and better classification of stack frames as in-app or system. This helps focus on relevant code, reduces noise, and minimizes false positives. By tailoring rules to your project, you can streamline debugging and maintain consistency across teams or multiple applications.
1010

11-
Each line is a single rule; one or multiple match expressions are followed by one or multiple actions to be executed when all expressions match. All rules are executed from top to bottom on all frames in the stack trace.
11+
When you set stack trace rules (previously known as _grouping enhancements_) for grouping in Sentry, they influence the data that's fed into the grouping algorithm. These rules can be configured on a per-project basis by going to your project settings and then clicking on "Issue Grouping".
12+
13+
Here are a few things to note about stack trace rules:
14+
15+
- Each rule is written on a single line.
16+
- Rules consist of one or more match expressions followed by one or more actions triggered when all expressions match.
17+
- Rules are applied sequentially, from top to bottom, across all frames in the stack trace.
18+
19+
In addition, the stack trace rules using the below matchers and actions can also be applied to incoming profiles to improve frame classification (in-app vs system, for example).
20+
21+
Allowed Matchers:
22+
* `stack.abs_path`
23+
* `stack.module`
24+
* `stack.function`
25+
* `stack.package`
26+
27+
Allowed Actions:
28+
* `+app`
29+
* `-app`
1230

1331
The syntax for stack trace rules is similar to:
1432

docs/platforms/android/data-management/sensitive-data/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Sensitive data may appear in the following areas:
5454
- User context → Automated behavior is controlled via <PlatformIdentifier name="send-default-pii" />.
5555
- HTTP context → Query strings may be picked up in some frameworks as part of the HTTP request context.
5656
- Transaction Names → In certain situations, transaction names might contain sensitive data. For example, a browser's pageload transaction might have a raw URL like `/users/1234/details` as its name (where `1234` is a user id, which may be considered PII). In most cases, our SDKs can parameterize URLs and routes successfully, that is, turn `/users/1234/details` into `/users/:userid/details`. However, depending on the framework, your routing configuration, race conditions, and a few other factors, the SDKs might not be able to completely parameterize all of your URLs.
57+
- HTTP Spans → Most SDKs will include the HTTP query string and fragment as a data attribute, which means the HTTP span may need to be scrubbed.
5758

5859
For more details and data filtering instructions, see <PlatformLink to="/configuration/filtering/">Filtering Events</PlatformLink>.
5960

docs/platforms/apple/common/data-management/sensitive-data/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Sensitive data may appear in the following areas:
5858
- User context → Automated behavior is controlled via <PlatformIdentifier name="send-default-pii" />.
5959
- HTTP context → Query strings may be picked up in some frameworks as part of the HTTP request context.
6060
- Transaction Names → In certain situations, transaction names might contain sensitive data. For example, a browser's pageload transaction might have a raw URL like `/users/1234/details` as its name (where `1234` is a user id, which may be considered PII). In most cases, our SDKs can parameterize URLs and routes successfully, that is, turn `/users/1234/details` into `/users/:userid/details`. However, depending on the framework, your routing configuration, race conditions, and a few other factors, the SDKs might not be able to completely parameterize all of your URLs.
61+
- HTTP Spans → Most SDKs will include the HTTP query string and fragment as a data attribute, which means the HTTP span may need to be scrubbed.
6162

6263
For more details and data filtering instructions, see <PlatformLink to="/configuration/filtering/">Filtering Events</PlatformLink>.
6364

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: SDK Overhead
3+
description: "Learn about Sentry's Apple SDK overhead and how you can tailor your configuration to minimize it."
4+
sidebar_order: 7500
5+
---
6+
7+
Adding new features or dependencies to your app incurs additional costs on resources - CPU time, memory usage, and network bandwidth, among other things. Sentry SDKs are no different. This document adds transparency to the possible overhead that using our SDK can add, and help you find the feature set and configurations that work best for you.
8+
9+
## General Approach
10+
11+
The SDK is designed to have minimal to no impact on user experience. To achieve this, we utilize an array of tools to continuously measure and optimize the performance of our implementations.
12+
13+
We also employ various techniques to ensure we don't add strain on the system's resources along the hot path. On Mobile, this very often means that we offload processing steps, I/O, and other things to a background thread, or we postpone processing to a later time if possible.
14+
15+
If you find (for example via local Profiling, or using Sentry to improve the performance of your app) that the SDK does not operate within the guidelines mentioned below, please [open an issue](https://github.com/getsentry/sentry-cocoa/issues/new/choose) on our SDK repo and make sure you provide as much context as you can.
16+
17+
## Error Monitoring
18+
19+
During regular operation, error monitoring incurs little to no overhead. Once an error or crash occurs, the user experience is compromised, and any crash handling routines operate under time constraints imposed by the system. This means that these implementations are highly optimized to perform the required work as quickly as possible.
20+
21+
The SDK also provides methods to manually capture events: <PlatformLink to="/usage/#capturing-errors">`captureError`</PlatformLink> and <PlatformLink to="/usage/#capturing-messages">`captureMessage`</PlatformLink>. These methods perform some complex operations, such as capturing stack trace information, and while they are highly optimized as well, calling them in tight loops should be avoided.
22+
23+
<PlatformSection supported={["apple.ios", "apple.visionos"]}>
24+
25+
## Screenshots and View Hierarchy
26+
27+
If you activate these features, the SDK will capture <PlatformLink to="/enriching-events/screenshots">Screenshots</PlatformLink> and <PlatformLink to="/enriching-events/viewhierarchy">View Hierarchy</PlatformLink> of the app's UI at the time of an error or crash. This incurs a small overhead that is unnoticeable during normal operation.
28+
29+
If your app raises many errors in a tight loop, it can become too much to process quickly enough, and UI jank can be the result, so make sure you handle such cases appropriately. The SDK provides callbacks to fine-tune when to capture <PlatformLink to="/enriching-events/screenshots#customize-screenshot-capturing">Screenshots</PlatformLink> and <PlatformLink to="/enriching-events/viewhierarchy#customize-view-hierarchy-capturing">View Hierarchy</PlatformLink>, which can also be used to reduce performance impact in scenarios where you don't need screenshots or view hierarchies.
30+
31+
</PlatformSection>
32+
33+
## Breadcrumbs
34+
35+
<PlatformLink to="/enriching-events/breadcrumbs">Breadcrumbs</PlatformLink> are collected through automated integrations or by manually adding them. To have them readily available for every event generated by the SDK, they are continuously persisted, and managed in a performant buffer. This shouldn't impact user experience.
36+
37+
Capturing excessive numbers of breadcrumbs (for example, creating breadcrumbs for all log messages) can cause significant performance overhead. To mitigate this, review and adapt your app's usage of breadcrumbs. For example, increase the min-level of log messages that create breadcrumbs from `warn` to `error`.
38+
39+
Note that increasing the max number of breadcrumbs **does not** improve performance and can even have a detrimental effect.
40+
41+
## Tracing and Performance Monitoring
42+
43+
As stated in our <Link to="/product/performance/performance-overhead">product docs on the topic</Link>, Tracing adds some overhead, but should have minimal impact on the performance of your application. In typical scenarios, the expected overhead is less than 3% of the app's resource utilization.
44+
45+
<PlatformSection supported={["apple.ios", "apple.macos"]}>
46+
47+
## Profiling
48+
49+
As stated in our <Link to="/product/explore/profiling/performance-overhead">product docs on the topic</Link>, Profiling adds some overhead, but should have minimal impact on the performance of your application. In typical scenarios, the expected overhead is less than 5% of the app's resource utilization.
50+
51+
</PlatformSection>
52+
53+
<PlatformSection supported={["apple.ios"]}>
54+
55+
## Session Replay
56+
57+
As stated in our <Link to="/product/explore/session-replay/mobile/performance-overhead">product docs on the topic</Link>, Session Replay adds some overhead, but should have minimal impact on the performance of your application. For more details on the measured overhead, read the <PlatformLink to="/session-replay/performance-overhead/">performance overhead docs for this SDK</PlatformLink>.
58+
59+
Note that this feature is still under development. We're working on performance improvements to mitigate a known issue where active Session Replay recording can currently introduce slow frames, especially on older iOS devices (for example iPhone 8).
60+
61+
</PlatformSection>

docs/platforms/dart/data-management/sensitive-data/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Sensitive data may appear in the following areas:
4848
- User context → Automated behavior is controlled via <PlatformIdentifier name="send-default-pii" />.
4949
- HTTP context → Query strings may be picked up in some frameworks as part of the HTTP request context.
5050
- Transaction Names → In certain situations, transaction names might contain sensitive data. For example, a browser's pageload transaction might have a raw URL like `/users/1234/details` as its name (where `1234` is a user id, which may be considered PII). In most cases, our SDKs can parameterize URLs and routes successfully, that is, turn `/users/1234/details` into `/users/:userid/details`. However, depending on the framework, your routing configuration, race conditions, and a few other factors, the SDKs might not be able to completely parameterize all of your URLs.
51+
- HTTP Spans → Most SDKs will include the HTTP query string and fragment as a data attribute, which means the HTTP span may need to be scrubbed.
5152

5253
For more details and data filtering instructions, see <PlatformLink to="/configuration/filtering/">Filtering Events</PlatformLink>.
5354

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: SDK Overhead
3+
description: "Learn about Sentry's Dart SDK overhead and how you can tailor your configuration to minimize it."
4+
sidebar_order: 7500
5+
---
6+
7+
Adding new features or dependencies to your app incurs additional costs on resources - CPU time, memory usage, and network bandwidth, among other things. Sentry SDKs are no different. This document adds transparency to the possible overhead that using our SDK can add, and help you find the feature set and configurations that work best for you.
8+
9+
## General Approach
10+
11+
The SDK is designed to have minimal to no impact on user experience. To achieve this, we utilize an array of tools to continuously measure and optimize the performance of our implementations.
12+
13+
We also employ various techniques to ensure we don't add strain on the system's resources along the hot path. On Mobile, this very often means that we offload some tasks to native implementations, use debouncing when appropriate, or we postpone processing to a later time if possible.
14+
15+
If you find (for example via local Profiling, or using Sentry to improve the performance of your app) that the SDK does not operate within the guidelines mentioned below, please [open an issue](https://github.com/getsentry/sentry-dart/issues/new/choose) on our SDK repo and make sure you provide as much context as you can.
16+
17+
## Error Monitoring
18+
19+
During regular operation, error monitoring incurs little to no overhead. Once an error or crash occurs, the user experience is compromised, and any crash handling routines operate under time constraints imposed by the system. This means that these implementations are highly optimized to perform the required work as quickly as possible.
20+
21+
The SDK also provides methods to manually capture events: <PlatformLink to="/usage/#capturing-errors">`captureError`</PlatformLink> and <PlatformLink to="/usage/#capturing-messages">`captureMessage`</PlatformLink>. These methods perform some complex operations, such as capturing stack trace information, and while they are highly optimized as well, calling them in tight loops should be avoided.
22+
23+
## Breadcrumbs
24+
25+
<PlatformLink to="/enriching-events/breadcrumbs">Breadcrumbs</PlatformLink> are collected through automated integrations or by manually adding them. To have them readily available for every event generated by the SDK, they are continuously persisted, and managed in a performant buffer. This shouldn't impact user experience.
26+
27+
Capturing excessive numbers of breadcrumbs (for example, creating breadcrumbs for all log messages) can cause significant performance overhead. To mitigate this, review and adapt your app's usage of breadcrumbs. For example, increase the min-level of log messages that create breadcrumbs from `warn` to `error`.
28+
29+
Note that increasing the max number of breadcrumbs **does not** improve performance and can even have a detrimental effect.
30+
31+
## Tracing and Performance Monitoring
32+
33+
As stated in our <Link to="/product/performance/performance-overhead">product docs on the topic</Link>, Tracing adds some overhead, but should have minimal impact on the performance of your application. In typical scenarios, the expected overhead is less than 3% of the app's resource utilization.

0 commit comments

Comments
 (0)