Skip to content

Commit 670906c

Browse files
authored
Merge branch 'master' into cameroncooke/docs/snapshotpreviews-metadata
2 parents e212c79 + 5d47d29 commit 670906c

23 files changed

Lines changed: 156 additions & 183 deletions

File tree

docs/cli/snapshots.mdx

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -58,40 +58,7 @@ If you only upload a subset of your snapshots per CI run — for example, becaus
5858
sentry-cli build snapshots ./snapshots --app-id web-frontend --selective
5959
```
6060

61-
When an upload is marked as selective, Sentry only diffs the snapshots you uploaded. Any snapshot that exists in the base build but was not included in the upload is treated as unchanged (skipped) rather than removed.
62-
63-
### Detecting Removals and Renames in Selective Mode
64-
65-
By default, `--selective` cannot detect removals or renames because Sentry cannot distinguish a deliberately deleted snapshot from one that was not part of the subset. To enable removal and rename detection, pass the full list of image file names from your test suite using one of:
66-
67-
- `--all-image-file-names <NAMES>` — a comma-separated list of all image file names.
68-
- `--all-image-file-names-file <PATH>` — a path to a file (`.txt`, `.csv`, etc.) containing all image file names, one per line.
69-
- `--all-image-file-names-as-regex <PATTERNS>` — a comma-separated list of regex patterns matching all image file names.
70-
- `--all-image-file-names-as-regex-file <PATH>` — a path to a file containing regex patterns, one per line.
71-
72-
<Alert level="warning">
73-
These four flags are mutually exclusive — you can only use one per upload.
74-
</Alert>
75-
76-
All four flags implicitly enable `--selective`.
77-
78-
```bash
79-
# Literal names
80-
sentry-cli build snapshots ./snapshots \
81-
--app-id web-frontend \
82-
--all-image-file-names "homepage.png,settings/profile.png,settings/billing.png"
83-
84-
# Regex patterns
85-
sentry-cli build snapshots ./snapshots \
86-
--app-id web-frontend \
87-
--all-image-file-names-as-regex ".*\.png"
88-
```
89-
90-
With the image names or patterns provided, Sentry can tell apart three categories of missing images:
91-
92-
- **Skipped** — matched by the list/pattern but not uploaded (part of the test suite, just not run in this CI job).
93-
- **Removed** — not matched and not uploaded (deliberately deleted from the test suite).
94-
- **Renamed** — a new image has the same content hash as a missing one.
61+
When an upload is marked as selective, Sentry only diffs the snapshots you uploaded. Any snapshot that exists in the base build but was not included in the upload is treated as unchanged rather than removed. Removals and renames cannot be detected when using `--selective`, because Sentry cannot distinguish a deliberately deleted snapshot from one that was not part of the subset.
9562

9663
## Diff Threshold
9764

@@ -116,12 +83,8 @@ sentry-cli build snapshots [OPTIONS] --app-id <APP_ID> <PATH>
11683
| `--auth-token <TOKEN>` | Sentry auth token. Can also be set via `SENTRY_AUTH_TOKEN`. |
11784
| `-o`, `--org <ORG>` | Sentry organization slug. Can also be set via `SENTRY_ORG`. |
11885
| `-p`, `--project <PROJECT>` | Sentry project slug. Can also be set via `SENTRY_PROJECT`. |
119-
| `--selective` | Mark the upload as a subset. Use when uploading only a portion of your snapshots (for example, affected tests only). |
120-
| `--all-image-file-names <NAMES>` | Comma-separated list of all image file names in the full test suite. Enables removal and rename detection in selective mode. Implicitly enables `--selective`. Mutually exclusive with the other `--all-image-*` flags. |
121-
| `--all-image-file-names-file <PATH>` | Path to a file (`.txt`, `.csv`, etc.) containing all image file names, one per line. Enables removal and rename detection in selective mode. Implicitly enables `--selective`. Mutually exclusive with the other `--all-image-*` flags. |
122-
| `--all-image-file-names-as-regex <PATTERNS>` | Comma-separated list of regex patterns matching all image file names in the full test suite. Enables removal and rename detection in selective mode. Implicitly enables `--selective`. Mutually exclusive with the other `--all-image-*` flags. |
123-
| `--all-image-file-names-as-regex-file <PATH>` | Path to a file containing regex patterns matching all image file names, one per line. Enables removal and rename detection in selective mode. Implicitly enables `--selective`. Mutually exclusive with the other `--all-image-*` flags. |
124-
| `--diff-threshold <THRESHOLD>` | Float between `0.0` and `1.0`. Sentry only reports images as changed if the percentage of changed pixels exceeds this value. |
86+
| `--selective` | Mark the upload as a subset. Use when uploading only a portion of your snapshots (for example, affected tests only). |
87+
| `--diff-threshold <THRESHOLD>` | Float between `0.0` and `1.0`. Sentry only reports images as changed if the percentage of changed pixels exceeds this value. |
12588
| `--head-sha <SHA>` | Commit SHA for the upload. Auto-detected in CI. |
12689
| `--base-sha <SHA>` | Base commit SHA for comparison (PR only). Auto-detected from merge-base. |
12790
| `--vcs-provider <PROVIDER>` | VCS provider (for example, `github`). Auto-detected from the git remote. |

docs/organization/data-storage-location/index.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ Here’s a list of the types of data that will be stored in whichever data stora
2727

2828
- Error events, activity, and issue links
2929
- Transactions
30+
- Spans
3031
- Profiles
32+
- Logs
33+
- Metrics
3134
- Release health
3235
- Releases, debug symbols, and source maps
3336
- Debug symbol metadata and source map metadata
@@ -103,7 +106,10 @@ If you have a self-hosted Sentry account, you can [follow these instructions](/c
103106

104107
- Error events, activity, and issue links
105108
- Transactions
109+
- Spans
106110
- Profiles
111+
- Logs
112+
- Metrics
107113
- Session Replays
108114
- Cron check-ins
109115
- Uptime checks

docs/platforms/native/advanced-usage/backend-tradeoffs/index.mdx

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ title: Backend Tradeoffs
33
description: "How to choose the right crash backend in the Native SDK."
44
sidebar_order: 1000
55
---
6-
The Native SDK lets users decide at compile-time between three crash backends:
6+
The Native SDK lets users decide at compile-time between multiple crash backends:
77

88
* `crashpad`
9+
* `native`
910
* `breakpad`
1011
* `inproc`
1112

@@ -16,7 +17,7 @@ Currently, `crashpad` is the default on all desktop platforms because it
1617
* has an external `handler` process that allows for external snapshots and sending crash reports immediately (instead of on the next successful start of your application)
1718
* further, snapshotting, report management, and uploading outside the crashed process are safer because the `crashpad_handler` is not affected by any corruptions that led to a crash
1819
* supports more error types on [Linux](/platforms/native/advanced-usage/signal-handling/#signals-of-interest) and Windows (`abort()` and other `fast-fail` crashes, handling of heap corruptions)
19-
* on macOS, the `crashpad_handler` will receive `EXC_CRASH` Mach exceptions, which the kernel generates during process exit if a terminal POSIX signal hasn't been handled. None of the two other backends will catch this exception.
20+
* on macOS, the `crashpad_handler` will receive `EXC_CRASH` Mach exceptions, which the kernel generates during process exit if a terminal POSIX signal hasn't been handled. None of the other backends will catch this exception.
2021
* is more maintained upstream (although most changes affect new platforms like Fuchsia)
2122
* is the primary target for Sentry-developed extensions to the upstream implementation of backend handlers (most of which aren't a particular upside vs. the other backends, but changes to reach parity), including
2223
* client-side stack traces (this is currently not available on `breakpad`)
@@ -41,11 +42,11 @@ Sentry decided on `crashpad` as the default on all platforms because it offers n
4142
* you want to distribute your application via the macOS App Store
4243
* you want to define crash hooks on macOS because there, error handling happens entirely in the `crashpad_handler`, whereas on Linux and Windows, at least the initial handling happens in your process, after which `crashpad_handler` takes over and snapshots the process to send a crash report
4344

44-
In the above cases, if you cannot loosen the requirements of your environment, you have to choose an in-process backend (meaning either `breakpad` or `inproc`).
45+
In the above cases, if you cannot loosen the requirements of your environment, you have to choose another backend (meaning either `native`, `breakpad`, or `inproc`).
4546

46-
### How do I decide between `breakpad` or `inproc`?
47+
### How do I decide between `native`, `breakpad`, and `inproc`?
4748

48-
Both backends are comparable in how they differ from `crashpad`. However, there are also considerable differences between the two:
49+
`native` is the closest alternative to `crashpad` because it keeps crash handling out of process. If your constraints rule out an additional executable, the remaining options are `breakpad` and `inproc`, which are comparable in how they differ from `crashpad` and `native`. However, there are also considerable differences between the two:
4950

5051
* `inproc` only provides the backtrace of the crashing thread. `breakpad` records all threads in the minidump.
5152
* similar to `crashpad`, `breakpad` uses the lowest level error handling mechanism on each platform (macOS: mach exception ports, Windows: `UnhandledExceptionFilter`, Linux: signal handlers), it does cover a smaller range of errors, though, as mentioned above.
@@ -54,7 +55,15 @@ Both backends are comparable in how they differ from `crashpad`. However, there
5455
* if the handler thread is unavailable (for example, because synchronization failed, the thread crashed, or never started), `inproc` falls back to processing directly in the signal handler.
5556
* on macOS, the handler thread uses a frame-pointer-based stack walker for arm64 and x86-64, which avoids the limitations that previously made `inproc` unusable on recent macOS versions.
5657
* `inproc` is exceptionally lightweight and written entirely in C, meaning it does not rely on a weighty C++ runtime library, which is also more often affected by ABI incompatibilities
57-
* `breakpad` generates minidumps (like `crashpad` does), whereas `inproc` follows the Sentry event structure and primarily defers to the OS-provided unwinder and symbolication capabilities. Sentry processing infrastructure can extract more information from the provided minidump than from just a stack trace and registers. However, it also means that the crash context inside the minidump will remain opaque until it is processed in the backend. In contrast, if required, a local `relay` instance (or another application-level proxy) could process an entire `inproc` event with only JSON parsing capabilities.
58+
* `breakpad` generates minidumps (like `crashpad` and `native` by default), whereas `inproc` follows the Sentry event structure and primarily defers to the OS-provided unwinder and symbolication capabilities. Sentry processing infrastructure can extract more information from the provided minidump than from just a stack trace and registers. However, it also means that the crash context inside the minidump will remain opaque until it is processed in the backend. In contrast, if required, a local `relay` instance (or another application-level proxy) could process an entire `inproc` event with only JSON parsing capabilities.
59+
60+
### So when do I choose `native`?
61+
62+
Since SDK version [0.13.2](https://github.com/getsentry/sentry-native/releases/tag/0.13.2), the Native SDK comes with a new experimental out-of-process backend called `native`. It is implemented as part of the Native SDK and built on the SDK's own event, envelope, transport, attachment, options, and hook infrastructure.
63+
64+
The main advantages are tighter integration with the Native SDK and no external crash-handler dependency. As an out-of-process backend, `native` runs crash handling in the lightweight `sentry-crash` daemon and can send crash reports at crash time, similar to `crashpad`. Because crash collection is implemented in the SDK, `native` can call SDK-level hooks such as `before_screenshot`, and can [report an event, a minidump, or both](/platforms/native/configuration/backends/native/). The backend is also fully compatible with TSAN and ASAN builds.
65+
66+
Consider `native` when you want out-of-process crash handling with SDK-managed crash collection, when you need sanitizer compatibility, or when `crashpad` does not fit your deployment model.
5867

5968
### So when do I choose `inproc`?
6069

@@ -75,8 +84,26 @@ If you dive into the details, you will find many trade-offs in the selection of
7584

7685
Sentry suggests the following sequence for your backend evaluations:
7786

78-
* `crashpad` (default)
87+
* `crashpad` (default on Windows, macOS, and Linux), or `native` (experimental)
7988
* `breakpad`
80-
* `inproc`
81-
82-
from most feature-complete to least, where a step down should only be triggered by environmental inhibitors. With the above, you now have exemplary decision points to help guide you before you start evaluating your error reporting scenario.
89+
* `inproc` (default on Android)
90+
91+
from most feature-complete to least, where a step down should only be triggered by environmental inhibitors, as summarized in the following table:
92+
93+
| Feature | `crashpad` | `native` | `breakpad` | `inproc` |
94+
| ------- | ---------- | -------- | ---------- | -------- |
95+
| Deployment | Library <sup>1</sup> + executable | Library <sup>1</sup> + executable | Library <sup>1</sup> | Library <sup>1</sup> |
96+
| Crash handler | Out-of-process | Out-of-process | In-process | In-process |
97+
| Crash upload | At crash time | At crash time | Next restart | Next restart |
98+
| Crash report | Minidump | Event/minidump/both | Minidump | Event |
99+
| Screenshots | Windows <sup>2</sup> | Windows | Windows | Windows |
100+
| Stack walking | Server-side<br />+ client-side build option | Client-side<br />+ server-side minidump mode | Server-side | Client-side |
101+
| Captured threads | All | All | All | Crashing |
102+
| Crash hooks | ✅ Windows/Linux<br />❌ macOS || ✅ Windows/macOS<br />⚠️ Linux (no context) ||
103+
| Windows WER / fast-fail |||||
104+
| macOS App Sandbox |||||
105+
106+
* <sup>1</sup> The library supports shared and static builds.
107+
* <sup>2</sup> The `before_screenshot` hook is not supported with `crashpad`.
108+
109+
With the above, you now have exemplary decision points to help guide you before you start evaluating your error reporting scenario.

docs/platforms/native/common/configuration/options.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ Whether Crashpad should delay application shutdown until the upload of the crash
6666

6767
</SdkOption>
6868

69+
<SdkOption name="crash_reporting_mode" type="sentry_crash_reporting_mode_t" defaultValue="SENTRY_CRASH_REPORTING_MODE_NATIVE_WITH_MINIDUMP" availableSince="0.13.2">
70+
71+
Controls which crash report format the `native` backend sends when the application crashes. This setting only affects the `native` backend. See [Crash Reporting Modes](/platforms/native/configuration/backends/native/#crash-reporting-modes).
72+
73+
</SdkOption>
74+
75+
<SdkOption name="minidump_mode" type="sentry_minidump_mode_t" defaultValue="SENTRY_MINIDUMP_MODE_SMART" availableSince="0.13.2">
76+
77+
Controls how much memory the `native` backend captures in minidumps. This setting only affects the `native` backend and crash reporting modes that send a minidump. See [Minidump Capture Modes](/platforms/native/configuration/backends/native/#minidump-capture-modes).
78+
79+
</SdkOption>
80+
6981
<SdkOption name="propagate_traceparent" type="bool" defaultValue="false" availableSince="0.11.3">
7082

7183
Controls whether the SDK should propagate the W3C `traceparent` HTTP header alongside the `sentry-trace` header for [distributed tracing](https://docs.sentry.io/platforms/native/tracing/trace-propagation/custom-instrumentation/).

docs/platforms/native/common/enriching-events/screenshots/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ og_image: /og-images/platforms-native-common-enriching-events-screenshots.png
88

99
Sentry makes it possible to automatically take a screenshot and include it as an <PlatformLink to="/enriching-events/attachments/">attachment</PlatformLink> when a user experiences an error, an exception, or a crash.
1010

11-
This feature is currently only available on Windows and has a few limitations. For example, the `inproc` and `breakpad` backends use local exception handlers for capturing the screenshot and therefore rely on the exception handler being called. Only the `crashpad` backend with an external handler process is able to capture screenshots of fast-fail crashes that bypass Structured Exception Handling ([`SEH`](https://learn.microsoft.com/en-us/windows/win32/debug/structured-exception-handling)). Another example where a screenshot might not be available is when the event happens before the screen starts to load. So inherently, this feature is a best effort solution.
11+
This feature is currently only available on Windows and has a few limitations. For example, the `inproc` and `breakpad` backends use local exception handlers for capturing the screenshot and therefore rely on the exception handler being called. Only the `crashpad` and `native` backends can capture screenshots of fast-fail crashes that bypass Structured Exception Handling ([`SEH`](https://learn.microsoft.com/en-us/windows/win32/debug/structured-exception-handling)) because screenshot capture happens out-of-process. However, `crashpad` does not support the `before_screenshot` hook, because the screenshot is captured out-of-process and the SDK cannot communicate the hook result to the `crashpad_handler`. The `native` backend calls `before_screenshot` during crash handling and communicates the result to the `sentry-crash` daemon, which captures the screenshot out-of-process. Another example where a screenshot might not be available is when the event happens before the screen starts to load. So inherently, this feature is a best effort solution.
1212

1313
## Enabling Screenshots
1414

docs/platforms/native/configuration/backends/crashpad.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ locking in place.
4747
4848
When using the Crashpad backend on macOS, the status of crashed sessions can not be reliably determined, and may be classified as [`abnormal`](/product/releases/health/release-details/) exits instead.
4949
50-
If you want to deploy your application to the macOS App Store or distribute it "sandboxed" outside, the crashpad client will fail to start the `crashpad_handler` executable (due to sandbox restrictions). For these deployment targets, we recommend using the `breakpad` backend.
50+
If you want to deploy your application to the macOS App Store or distribute it "sandboxed" outside, the crashpad client will fail to start the `crashpad_handler` executable (due to sandbox restrictions). For these deployment targets, use the [`native`](/platforms/native/configuration/backends/native/) backend, or `breakpad`/`inproc` if you cannot ship an additional executable.

0 commit comments

Comments
 (0)