Skip to content

Commit 5e423b1

Browse files
committed
onboarding source-context option
1 parent 40df21a commit 5e423b1

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

platform-includes/debug-symbols-apple/_default.mdx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
Sentry requires dSYMs (debug information files) to symbolicate your stack traces. The symbolication process unscrambles the stack traces to reveal the function, file names, and line numbers of the crash.
22

3+
You can also upload your code for source context. This feature allows Sentry to display snippets of your code next to the event stack traces.
4+
5+
<OnboardingOptionButtons
6+
options={[{ id:"source-context", checked: false }]}
7+
/>
8+
39
Every solution requires a **Sentry Auth Token**. You can create tokens on the [Organization Auth Tokens](https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/) settings page.
410

511
To view uploaded dSYMs in your project, select an existing project from the "Projects" page, then go to **Settings > Debug Files**. You can upload dSYMs using:
@@ -25,7 +31,7 @@ For this to work, your project settings for `DEBUG_INFORMATION_FORMAT` must be s
2531

2632
<OrgAuthTokenNote />
2733

28-
```bash
34+
```bash {"onboardingOptions": {"source-context": "1"}}
2935
sentry-cli debug-files upload --auth-token ___ORG_AUTH_TOKEN___ \
3036
--include-sources \
3137
--org ___ORG_SLUG___ \
@@ -44,7 +50,7 @@ Sentry can display snippets of your code next to event stack traces. This featur
4450

4551
<OrgAuthTokenNote />
4652

47-
```ruby {tabTitle:Current Fastlane plugin}
53+
```ruby {tabTitle:"Current Fastlane plugin", "onboardingOptions": {"source-context": "4"}}
4854
sentry_debug_files_upload(
4955
auth_token: '___ORG_AUTH_TOKEN___',
5056
org_slug: '___ORG_SLUG___',
@@ -53,7 +59,7 @@ sentry_debug_files_upload(
5359
)
5460
```
5561

56-
```ruby {tabTitle:Fastlane plugin before 1.20.0}
62+
```ruby {tabTitle:"Fastlane plugin before 1.20.0", "onboardingOptions": {"source-context": "4"}}
5763
sentry_upload_dif(
5864
auth_token: '___ORG_AUTH_TOKEN___',
5965
org_slug: '___ORG_SLUG___',
@@ -94,7 +100,7 @@ Another option is to use warnings, and then set `GCC_TREAT_WARNINGS_AS_ERRORS` t
94100

95101
<OrgAuthTokenNote />
96102

97-
```bash {tabTitle:Warn on failures - nonblocking}
103+
```bash {tabTitle:"Warn on failures - nonblocking", "onboardingOptions": {"source-context": "9"}}
98104
if [[ "$(uname -m)" == arm64 ]]; then
99105
export PATH="/opt/homebrew/bin:$PATH"
100106
fi
@@ -103,7 +109,9 @@ if which sentry-cli >/dev/null; then
103109
export SENTRY_ORG=___ORG_SLUG___
104110
export SENTRY_PROJECT=___PROJECT_SLUG___
105111
export SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
106-
ERROR=$(sentry-cli debug-files upload --include-sources "$DWARF_DSYM_FOLDER_PATH" 2>&1 >/dev/null)
112+
ERROR=$(sentry-cli debug-files upload \
113+
--include-sources \
114+
"$DWARF_DSYM_FOLDER_PATH" 2>&1 >/dev/null)
107115
if [ ! $? -eq 0 ]; then
108116
echo "warning: sentry-cli - $ERROR"
109117
fi
@@ -112,7 +120,7 @@ echo "warning: sentry-cli not installed, download from https://github.com/getsen
112120
fi
113121
```
114122

115-
```bash {tabTitle:Error on failures - blocking}
123+
```bash {tabTitle:"Error on failures - blocking", "onboardingOptions": {"source-context": "9"}}
116124
if [[ "$(uname -m)" == arm64 ]]; then
117125
export PATH="/opt/homebrew/bin:$PATH"
118126
fi
@@ -121,7 +129,9 @@ if which sentry-cli >/dev/null; then
121129
export SENTRY_ORG=___ORG_SLUG___
122130
export SENTRY_PROJECT=___PROJECT_SLUG___
123131
export SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
124-
ERROR=$(sentry-cli debug-files upload --include-sources "$DWARF_DSYM_FOLDER_PATH" --force-foreground 2>&1 >/dev/null)
132+
ERROR=$(sentry-cli debug-files upload \
133+
--include-sources \
134+
"$DWARF_DSYM_FOLDER_PATH" --force-foreground 2>&1 >/dev/null)
125135
if [ ! $? -eq 0 ]; then
126136
echo "error: sentry-cli - $ERROR"
127137
fi

src/components/onboarding/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,22 @@ const optionDetails: Record<
4848
</span>
4949
),
5050
},
51+
'source-context': {
52+
name: 'Source context',
53+
description: (
54+
<span>
55+
Upload your source code to allow Sentry to display snippets of your code next to the event stack traces.
56+
</span>
57+
),
58+
},
5159
};
5260

5361
const OPTION_IDS = [
5462
'error-monitoring',
5563
'performance',
5664
'profiling',
5765
'session-replay',
66+
'source-context',
5867
] as const;
5968

6069
type OptionId = (typeof OPTION_IDS)[number];

0 commit comments

Comments
 (0)