Skip to content

Commit 1d4b9cc

Browse files
authored
feat(wasm): Add initial docs for WASM (#2737)
1 parent ae2f390 commit 1d4b9cc

File tree

18 files changed

+257
-29
lines changed

18 files changed

+257
-29
lines changed

src/docs/contributing/approach/write-data-management.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This file is `/sensitive-data/index.mdx`. It explains how to scrub or filter dat
5151

5252
For data scrubbing that the SDK DOES NOT support, add the name of the SDK to the `PlatformSection notSupported` statement, which ensures the content won't display. For example:
5353

54-
`<PlatformSection notSupported={["flutter", "apple", "perl", "native.breakpad", "native.crashpad", "native.minidumps", "native.ue4", "go", "ruby", "native", "elixir"]}>`
54+
`<PlatformSection notSupported={["flutter", "apple", "perl", "native.breakpad", "native.crashpad", "native.minidumps", "native.wasm", "native.ue4", "go", "ruby", "native", "elixir"]}>`
5555

5656
Add the code sample to these directories:
5757

src/includes/upload-dif/native.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
```bash
2+
sentry-cli upload-dif -o <org> -p <project> /path/to/myfile.debug.wasm
3+
4+
> Found 2 debug information files
5+
> Prepared debug information files for upload
6+
> Uploaded 2 missing debug information files
7+
> File processing complete:
8+
9+
PENDING 1ddb3423-950a-3646-b17b-d4360e6acfc9 (MyApp; x86_64 executable)
10+
PENDING 1ddb3423-950a-3646-b17b-d4360e6acfc9 (MyApp; x86_64 debug companion)
11+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
```bash
2+
wasm-split /path/to/myfile.wasm -d /path/to/myfile.debug.wasm --strip
3+
sentry-cli upload-dif -o <org> -p <project> /path/to/files
4+
5+
> Found 1 debug information files
6+
> Prepared debug information files for upload
7+
> Uploaded 1 missing debug information files
8+
> File processing complete:
9+
10+
PENDING 1ddb3423-950a-3646-b17b-d4360e6acfc9 (mylib; wasm debug companion)
11+
```

src/platforms/common/configuration/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Configuration
33
notSupported:
4-
["native.ue4", "native.breakpad", "native.crashpad", "native.minidumps"]
4+
["native.ue4", "native.breakpad", "native.crashpad", "native.minidumps", "native.wasm"]
55
description: "Additional configuration options for the SDK."
66
sidebar_order: 5
77
---

src/platforms/common/data-management/debug-files.mdx

Lines changed: 57 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ in debug files includes original function names, paths to source files and line
1616
numbers, source code context, or the placement of variables in memory. Sentry
1717
can use some of this information and display it on the issue details page.
1818

19+
<PlatformSection notSupported={["native.wasm"]}>
20+
1921
Each major platform uses different debug information files. We currently support
2022
the following formats:
2123

@@ -26,9 +28,12 @@ the following formats:
2628
- [_PDB files_](#pe-and-pdb) for Windows
2729
- [_Breakpad symbols_](#breakpad-symbols) for all
2830
platforms
31+
- [_WASM files_](#wasm) for WebAssembly
2932
- [_ProGuard mappings_](#proguard-mappings) for
3033
Java and Android
3134

35+
</PlatformSection>
36+
3237
<Note>
3338

3439
Source maps, while also being debug information files, are handled
@@ -49,13 +54,6 @@ servers for automatic downloads.
4954

5055
Sentry differentiates in four kinds of debug information:
5156

52-
- **Unwind Information:** Enables Sentry to extract stack traces from Minidumps
53-
and other binary crash formats of optimized builds. This process is referred
54-
to as "stack unwinding" or "stack walking". Since this is also required when
55-
throwing exceptions in C++, this information is often included in the
56-
executable or library. If an uploaded file contains this information, it shows
57-
the `unwind` tag.
58-
5957
- **Debug Information:** Provides function names, paths to source files, line
6058
numbers and inline frames. The process of resolving this information from
6159
instruction addresses is called "symbolication". This information is
@@ -75,6 +73,15 @@ Sentry differentiates in four kinds of debug information:
7573
upload it to display source context in stack traces in Sentry. These bundles
7674
show up with the `sources` tag.
7775

76+
- **Unwind Information:** Enables Sentry to extract stack traces from Minidumps
77+
and other binary crash formats of optimized builds. This process is referred
78+
to as "stack unwinding" or "stack walking". Since this is also required when
79+
throwing exceptions in C++, this information is often included in the
80+
executable or library. If an uploaded file contains this information, it shows
81+
the `unwind` tag. Note that on some platforms no actual unwinding takes place.
82+
For instance, WebAssembly currently does not have the equivalent of minidumps
83+
which means we do not require that type of information in such cases.
84+
7885
Compilers place the above debug information in different files passed on the
7986
target platform, architecture, build flags or optimization level. Consequently,
8087
Sentry might not need all of the above information to process crash reports.
@@ -83,6 +90,8 @@ Still, it is always a good idea to provide all available debug information.
8390
`sentry-cli` can be used to list properties of supported debug files and
8491
validate their contents. See [_Debug Information Files in sentry-cli_](/product/cli/dif/) for more information.
8592

93+
<PlatformSection notSupported={["native.wasm"]}>
94+
8695
The remainder of this section describes the file formats in detail.
8796

8897
### MachO and dSYM
@@ -211,13 +220,29 @@ that is not required to process minidumps. Most notably, inline functions are
211220
not declared, such that Sentry is not able to display inline frames in stack
212221
traces.
213222

223+
### WASM
224+
225+
</PlatformSection>
226+
227+
For WebAssembly, we support [DWARF in WASM containers](https://yurydelendik.github.io/webassembly-dwarf/).
228+
Note that we do not support source maps, which are also a format used for WASM
229+
debugging, but have shortcomings that make them impractical for a crash reporting
230+
tool like Sentry.
231+
232+
Since WASM does not specify debug/build IDs yet, we provide a separate tool to
233+
add build IDs and split files called [wasm-split](https://github.com/getsentry/symbolicator/tree/master/wasm-split)
234+
to help you create a debug companion file ready for uploading to Sentry
235+
while removing all debug information from the release binary.
236+
237+
<PlatformSection notSupported={["native.wasm"]}>
238+
214239
### ProGuard Mappings
215240

216241
<PlatformSection supported={["android", "flutter", "react-native"]}>
217242

218243
<Note>
219244

220-
The recommended method for [Android users is to use the Gradle plugin](/platforms/android/proguard/).
245+
The recommended method for [Android users is to use the Gradle plugin](/platforms/android/proguard/).
221246

222247
</Note>
223248

@@ -227,6 +252,8 @@ ProGuard mapping files allow Sentry to resolve obfuscated Java classpaths and
227252
method names into their original form. In that sense, they act as debug
228253
information files for Java and Android applications.
229254

255+
</PlatformSection>
256+
230257
## Debug Identifiers
231258

232259
Each debug information file specifies a unique identifier. Crash reports declare
@@ -236,7 +263,8 @@ correct files. Sentry distinguishes two kinds of identifiers:
236263
- **Code Identifier**: The unique identifier of the executable or dynamic
237264
library -- the code file. The contents of this identifier are
238265
platform-dependent: MachO files use a UUID, ELF files a SHA hash, PE files use
239-
a concatenation of certain header attributes.
266+
a concatenation of certain header attributes. For WebAssembly we use an
267+
embedded UUID in the `build_id` section of the file.
240268

241269
- **Debug Identifier**: The unique identifier of the debug companion file. In
242270
contrast to the code identifier, Sentry enforces the same structure on all
@@ -265,6 +293,8 @@ files that match it in the _Debug Files_ settings screen.
265293
`sentry-cli` can help to print properties of debug information files like their
266294
debug identifier. See [_Checking Debug Information Files_](/product/cli/dif/#checking-files) for more information.
267295

296+
<PlatformSection notSupported={["native.wasm"]}>
297+
268298
### GNU Build Identifiers
269299

270300
For ELF files on Linux, Sentry uses the GNU build identifier to compute the
@@ -304,6 +334,21 @@ files are uploaded in the same invocation of the upload command. Otherwise, the
304334
identifiers diverge and Sentry might not be able to resolve the correct file
305335
for symbolication.
306336

337+
</PlatformSection>
338+
339+
### WASM Build IDs
340+
341+
WebAssembly does not yet support build IDs. The option proposed to
342+
implement build IDs for WebAssembly ([Build ID Section for WASM](https://github.com/WebAssembly/tool-conventions/issues/133))
343+
has not yet found widespread adoption. Instead, we use a custom
344+
extension to WebAssembly.
345+
346+
Our recommendation is to embed a UUID in the `build_id` custom section as
347+
raw binary. Our [`wasm-split`](https://github.com/getsentry/symbolicator/tree/master/wasm-split)
348+
tool can do this for you automatically.
349+
350+
<PlatformSection notSupported={["native.wasm"]}>
351+
307352
### ProGuard UUIDs
308353

309354
Unlike other debug information files, ProGuard files do not have an intrinsic
@@ -324,6 +369,8 @@ def get_proguard_uuid(filename):
324369
return uuid.uuid5(NAMESPACE, f.read())
325370
```
326371

372+
</PlatformSection>
373+
327374
## Uploading Files
328375

329376
The most straightforward way to provide Sentry with debug information file is
@@ -336,17 +383,7 @@ application:
336383
Files can be uploaded using the `upload-dif` command. This command will scan a
337384
given folder recursively for files and upload them to Sentry:
338385

339-
```bash
340-
sentry-cli upload-dif -o <org> -p <project> /path/to/files
341-
342-
> Found 2 debug information files
343-
> Prepared debug information files for upload
344-
> Uploaded 2 missing debug information files
345-
> File processing complete:
346-
347-
PENDING 1ddb3423-950a-3646-b17b-d4360e6acfc9 (MyApp; x86_64 executable)
348-
PENDING 1ddb3423-950a-3646-b17b-d4360e6acfc9 (MyApp; x86_64 debug companion)
349-
```
386+
<PlatformContent includePath="upload-dif" />
350387

351388
For all available options and more information refer to [_Uploading Debug
352389
Information_](/product/cli/dif/#uploading-files).

src/platforms/common/data-management/event-grouping/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ All events have a fingerprint. Events with the same fingerprint are grouped toge
1111

1212
By default, Sentry will run one of our built-in grouping algorithms to generate a fingerprint based on information available within the event such as `stacktrace`, `exception`, and `message`. To extend the default grouping behavior or change it completely, you can use a combination of the following options:
1313

14-
1. In your SDK, using [SDK Fingerprinting](./sdk-fingerprinting/)
14+
1. In your SDK<PlatformSection notSupported={["native.wasm", "native.minidumps"]}>, using [SDK Fingerprinting](./sdk-fingerprinting/)</PlatformSection>
1515
2. In your project, using [Fingerprint Rules](./fingerprint-rules/)
1616
3. In your project, using [Stack Trace Rules](./stack-trace-rules/)
1717

src/platforms/common/data-management/event-grouping/sdk-fingerprinting.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ sidebar_order: 0
44
redirect_from:
55
- ../../../enriching-events/context/fingerprint-override/
66
description: "Learn about overriding default fingerprinting in your SDK."
7+
notSupported:
8+
["native.wasm", "native.minidump"]
79
---
810

911
In supported SDKs, you can override Sentry's default grouping that passes the fingerprint attribute as an array of strings. The length of a fingerprint's array is not restricted. This works similarly to the [fingerprint rules functionality](../fingerprint-rules/), which is always available and can achieve similar results.

src/platforms/common/data-management/sensitive-data/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ There are two great examples for data scrubbing that every company should think
1515
- Authentication credentials, like your AWS password or key.
1616
- Confidential IP (Intellectual Property), such as your favorite color, or your upcoming plans for world domination.
1717

18-
## Personally Identifiable Information (PII)
18+
<PlatformSection notSupported={["apple", "perl", "native.breakpad", "native.crashpad", "native.minidumps", "native.wasm", "native.ue4", "go", "ruby", "native", "elixir", "dart", "flutter"]}>
1919

20-
<PlatformSection notSupported={["apple", "perl", "native.breakpad", "native.crashpad", "native.minidumps", "native.ue4", "go", "ruby", "native", "elixir", "dart", "flutter"]}>
20+
## Personally Identifiable Information (PII)
2121

2222
Our newer SDKs do not purposefully send PII to stay on the safe side. This behavior is controlled by an option called [`send-default-pii`](../../configuration/options/#send-default-pii).
2323

2424
Turning this option on is required for certain features in Sentry to work, but also means you will need to be even more careful about what data is being sent to Sentry (using the options below).
2525

2626
</PlatformSection>
2727

28-
<PlatformSection notSupported={["native.breakpad", "native.crashpad", "native.minidumps", "native.ue4"]}>
28+
<PlatformSection notSupported={["native.breakpad", "native.crashpad", "native.minidumps", "native.wasm", "native.ue4"]}>
2929

3030
If you _do not_ wish to use the default PII behavior, you can also choose to identify users in a more controlled manner, using our [user identity context](../../enriching-events/identify-user/).
3131

3232
</PlatformSection>
3333

34-
<PlatformSection notSupported={["perl", "native.ue4", "native.breakpad", "native.crashpad", "native.minidumps"]}>
34+
<PlatformSection notSupported={["perl", "native.ue4", "native.breakpad", "native.crashpad", "native.minidumps", "native.wasm"]}>
3535

3636
## Scrubbing Data
3737

src/platforms/common/enriching-events/breadcrumbs.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ notSupported:
66
- native.breakpad
77
- native.crashpad
88
- native.minidumps
9+
- native.wasm
910
- native.ue4
1011
---
1112

src/platforms/common/enriching-events/context.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ notSupported:
55
- native.breakpad
66
- native.crashpad
77
- native.minidumps
8+
- native.wasm
89
- native.ue4
910
description: "Custom contexts allow you to attach arbitrary data (strings, lists, dictionaries) to an event."
1011
---

src/platforms/common/enriching-events/identify-user.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ notSupported:
55
- native.breakpad
66
- native.crashpad
77
- native.minidumps
8+
- native.wasm
89
- native.ue4
910
description: "Learn how to configure the SDK to capture the user and gain critical pieces of information that construct a unique identity in Sentry."
1011
---

src/platforms/common/enriching-events/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ notSupported:
66
- native.breakpad
77
- native.crashpad
88
- native.minidumps
9+
- native.wasm
910
---
1011

1112
<PageGrid />

src/platforms/common/enriching-events/scopes.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ notSupported:
99
- native.crashpad
1010
- native.minidumps
1111
- native.ue4
12+
- native.wasm
1213
---
1314

1415
When an event is captured and sent to Sentry, SDKs will merge that event data with extra

src/platforms/common/enriching-events/tags.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: "Tags power UI features such as filters and tag-distribution maps.
1212

1313
We’ll automatically index all tags for an event, as well as the frequency and the last time that Sentry has seen a tag. We also keep track of the number of distinct tags and can assist you in determining hotspots for various issues.
1414

15-
<PlatformSection notSupported={["native.minidumps"]}>
15+
<PlatformSection notSupported={["native.minidumps", "native.wasm"]}>
1616

1717
Defining tags is easy, and will bind them to the [current scope](../scopes/) ensuring all future events within scope contain the same tags:
1818

src/platforms/common/enriching-events/user-feedback.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ notSupported:
1717
- native.breakpad
1818
- native.crashpad
1919
- native.minidumps
20+
- native.wasm
2021
- native.ue4
2122
- dart
2223
- flutter

src/platforms/common/usage/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ notSupported:
77
- native.breakpad
88
- native.crashpad
99
- native.minidumps
10+
- native.wasm
1011
- native.ue4
1112
---
1213

src/platforms/native/common/debug-information.mdx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,31 @@ libraries. If you are not sure which files are required, go to _Project
1414
Settings > Processing Issues_, which shows a list of all the necessary files and
1515
instructions to retrieve them.
1616

17+
<PlatformSection notSupported={["native.wasm"]}>
18+
1719
In addition to Debug Information Files, Sentry needs _Call Frame Information_
1820
(CFI) to extract accurate stack traces from minidumps of optimized release
1921
builds. CFI is usually part of the executables and not copied to debug symbols.
2022
Unless you are uploading Breakpad symbols, be sure to also include the binaries
2123
when uploading files to Sentry.
24+
</PlatformSection>
25+
26+
<PlatformSection supported={["native.wasm"]}>
27+
28+
For WASM, you need to provide both the debug information and the original code
29+
in the same debug information file. To do this, we provide a custom
30+
tool called [wasm-split](https://github.com/getsentry/symbolicator/tree/master/wasm-split)
31+
that can do the splitting for you:
32+
33+
```shell
34+
wasm-split /path/to/file.wasm -d /path/to/file.debug.wasm --strip
35+
```
36+
37+
This command modifies the `file.wasm` in place to add the `build_id`, then removes all
38+
debug information. The debug information is put in a `file.debug.wasm` which
39+
then needs to be uploaded to Sentry.
40+
41+
</PlatformSection>
2242

2343
For more information on uploading debug information and their supported formats,
24-
see [Debug Information Files](/workflow/debug-files/).
44+
see [Debug Information Files](../data-management/debug-files/).

0 commit comments

Comments
 (0)