Skip to content

Commit 35a845c

Browse files
committed
* 'master' of https://github.com/getsentry/sentry-docs: fix(native): add another `crashpad` benefit on macOS to the backend tradeoffs (#13535) chore(develop): Update frontend router testing guidance (#13538) Bump API schema to 1bf27325 (#13537) Fix HTTP headers section in data collected for Java and Android SDK (#13530) Add "Data Collected" page for Unreal Engine SDK (#13532) feat(seer): Update seer docs (#13448) Add an FAQ to trace propagation cheat sheet (#13528) Remove note about 40M SourceMap Limit (#13499) docs(js): Create SvelteKit Quick Start guide (Wizard setup) (#13480) add godot and maui to platforms with screenshot (#13493)
2 parents 0c32d4d + 2b3040f commit 35a845c

File tree

24 files changed

+303
-287
lines changed

24 files changed

+303
-287
lines changed

develop-docs/frontend/using-rtl.mdx

+40-10
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,53 @@ const organization = OrganizationFixture({access: ['org:admin'], features: ['my-
3232
render(<Example />, {organization});
3333
```
3434

35-
Router context can be overriden in the same way.
35+
## Testing route changes
36+
37+
When using `render()`, an in-memory router is used, which will react to navigations with `useNavigate()` or interations with `Link` components. If your component relies on the URL, you can define the initial state in `initialRouterConfig`. You can access the current router state by referencing the returned `router` class, as well as navigate programmatically with `router.navigate()`.
3638

3739
```tsx
38-
const {organization, router, routerContext} = initializeOrg({
39-
organization: {features: ['global-views', 'open-membership']},
40-
router: {
40+
const {router} = render(<TestComponent />, {
41+
initialRouterConfig: {
4142
location: {
42-
pathname: '/organizations/org-slug/issues/',
43-
query: {environment: 'prod'},
43+
pathname: '/foo/',
44+
query: {page: '1'},
4445
},
45-
params: {},
4646
},
4747
});
4848

49-
render(<Example />, {context: routerContext, organization});
50-
await userEvent.click(something);
51-
expect(router.push).toHaveBeenCalledTimes(1);
49+
// Uses passes in config to set initial location
50+
expect(router.location.pathname).toBe('/foo');
51+
expect(router.location.query.page).toBe('1');
52+
53+
// Clicking links goes to the correct location
54+
await userEvent.click(screen.getByRole('link', {name: 'Go to /bar/'}));
55+
56+
// Can check current route on the returned router
57+
expect(router.location.pathname).toBe('/bar/');
58+
59+
// Can test manual route changes with router.navigate
60+
router.navigate('/new/path/');
61+
router.navigate(-1); // Simulates clicking the back button
62+
```
63+
64+
If you need to test route param values (as in `useParams()`), the `route` will need to be provided in the config:
65+
66+
```tsx
67+
function TestComponent() {
68+
const {id} = useParams();
69+
return <div>{id}</div>;
70+
}
71+
72+
const {router} = render(<TestComponent />, {
73+
initialRouterConfig: {
74+
location: {
75+
pathname: '/foo/123/',
76+
},
77+
route: '/foo/:id/',
78+
}
79+
});
80+
81+
expect(screen.getByText('123')).toBeInTheDocument();
5282
```
5383

5484
## Querying

develop-docs/sdk/telemetry/traces/trace-propagation-cheat-sheet.mdx

+6
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,9 @@ This is a cheat sheet where you can see how the trace propagation work in SDKs i
3737
| present | 0 | no | null | no | no | - |
3838
| present | 0 | no | 0 | no | no | - |
3939
| present | 0 | no | 1 | no | no | - |
40+
41+
## FAQ
42+
43+
**Why are we sometimes sampling even if `traces_sample_rate` is 0? Why are we sometimes unsampling if `traces_sample_rate` is 1?**
44+
45+
A `traces_sample_rate` between 0 and 1 is only taken into account if there is no incoming trace and the SDK has to make its own sampling decision. If there is an incoming trace, the parent sampling decision always takes precedence over `traces_sample_rate`.

docs/platforms/android/data-management/data-collected.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Many of the categories listed here require you to enable the <PlatformLink to="/
1212

1313
## HTTP Headers
1414

15-
By default, the Sentry SDK doesn't send any HTTP headers. Even when sending HTTP headers is enabled, we have a [denylist](https://github.com/getsentry/sentry-java/blob/main/sentry/src/main/java/io/sentry/util/HttpUtils.java#L21-L34) in place, which filters out any headers that contain sensitive data.
15+
By default, the Sentry SDK doesn't send any headers for outgoing HTTP request. Even when sending HTTP headers is enabled, we have a [denylist](https://github.com/getsentry/sentry-java/blob/main/sentry/src/main/java/io/sentry/util/HttpUtils.java#L21-L34) in place, which filters out any headers that contain sensitive data.
1616

1717
To start sending HTTP headers, set <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii=true`</PlatformLink>.
1818

docs/platforms/java/common/data-management/data-collected.mdx

+11-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,17 @@ For many of the categories listed here it is required to enable the <PlatformLin
1212

1313
## HTTP Headers
1414

15-
By default, the Sentry SDK doesn't send any HTTP headers. Even when sending HTTP headers is enabled, we have a [denylist](https://github.com/getsentry/sentry-java/blob/main/sentry/src/main/java/io/sentry/util/HttpUtils.java#L21-L34) in place, which filters out any headers that contain sensitive data.
15+
### Outgoing Requests
1616

17-
To start sending HTTP headers, set <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii=true`</PlatformLink>.
17+
By default, the Sentry SDK doesn't send any headers for outgoing HTTP requests. Even when sending HTTP headers is enabled, we have a [denylist](https://github.com/getsentry/sentry-java/blob/main/sentry/src/main/java/io/sentry/util/HttpUtils.java#L21-L34) in place, which filters out any headers that contain sensitive data.
18+
19+
To send all HTTP headers, set <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii=true`</PlatformLink>.
20+
21+
### Incoming Requests
22+
23+
By default, the Sentry SDK sends headers for incoming HTTP requests to Sentry but filters out any headers that contain sensitive data. (See the [list of headers](https://github.com/getsentry/sentry-java/blob/main/sentry/src/main/java/io/sentry/util/HttpUtils.java#L21-L34) that are filtered).
24+
25+
To send all HTTP headers, set <PlatformLink to="/configuration/options/#send-default-pii">`sendDefaultPii=true`</PlatformLink>.
1826

1927
## Cookies
2028

@@ -52,7 +60,7 @@ The request body of incoming HTTP requests can be sent to Sentry. Whether it's s
5260

5361
## Source Context
5462

55-
Our build tool plugins for Gradle and Maven can upload your source code to Sentry, which can then used to show the lines of code where an error happened in the Issue Details page.
63+
Our build tool plugins for Gradle and Maven can upload your source code to Sentry, which can then used to show the lines of code where an error happened in the Issue Details page.
5664

5765
To opt into sending this source context to Sentry, you have to enable the feature as described in <PlatformLink to="/source-context/">the Source Context documentation</PlatformLink>.
5866

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: SvelteKit
3+
description: "Learn how to set up and configure Sentry in your SvelteKit application using the installation wizard, capture your first errors, and view them in Sentry."
34
sdk: sentry.javascript.sveltekit
45
categories:
56
- javascript
@@ -8,110 +9,71 @@ categories:
89
- server-node
910
---
1011

11-
Sentry's SvelteKit SDK enables automatic reporting of errors and performance data.
12-
13-
## Compatibility
14-
15-
The minimum supported SvelteKit version is `2.0.0`.
16-
This SDK works best with **Vite 4.2** and newer. Older Vite versions might not generate source maps correctly.
17-
18-
<Alert>
19-
20-
The SvelteKit SDK is designed to work out of the box with the following SvelteKit adapters:
21-
22-
- [Adapter-auto](https://kit.svelte.dev/docs/adapter-auto) - for Vercel; other platforms might work but we don't guarantee compatibility at this time.
23-
- [Adapter-vercel](https://kit.svelte.dev/docs/adapter-vercel) - only for Node (Lambda) runtimes, not yet Vercel's edge runtime.
24-
- [Adapter-cloudflare](https://kit.svelte.dev/docs/adapter-cloudflare) - supported but requires [additional Setup](/platforms/javascript/guides/cloudflare/frameworks/sveltekit/).
25-
- [Adapter-node](https://kit.svelte.dev/docs/adapter-node).
26-
27-
Other adapters may work but aren't currently supported.
28-
We're looking into extending first-class support to [more adapters](https://kit.svelte.dev/docs/adapters) in the future.
29-
30-
The SvelteKit SDK does not yet work with all non-node server runtimes, such as Vercel's edge runtime.
31-
32-
</Alert>
33-
3412
<PlatformContent includePath="getting-started-prerequisites" />
3513

36-
## Install
14+
## Step 1: Install
3715

38-
Sentry captures data by using an SDK within your application’s runtime.
39-
40-
We recommend installing the SDK by running our installation wizard in the root directory of your project:
16+
To install Sentry using the installation wizard, run the following command within your project:
4117

4218
```bash
4319
npx @sentry/wizard@latest -i sveltekit
4420
```
4521

46-
The wizard will prompt you to log in to Sentry. It will then automatically do the following steps for you:
47-
48-
- create or update SvelteKit files with the default Sentry configuration:
49-
- `hooks.(client|server).js` to initialize the SDK and instrument [SvelteKit's hooks](https://kit.svelte.dev/docs/hooks)
50-
- `vite.config.js` to add source maps upload and auto-instrumentation via Vite plugins.
51-
- create a `.sentryclirc` file with an auth token to upload source maps (this file is automatically added to `.gitignore`)
52-
- add an example page to your app to verify your Sentry setup
22+
The wizard then guides you through the setup process, asking you to enable additional (optional) Sentry features for your application beyond error monitoring.
5323

54-
After the wizard setup is completed, the SDK will automatically capture unhandled errors, and monitor performance.
55-
You can also <PlatformLink to="/usage/">manually capture errors</PlatformLink>.
24+
<PlatformContent includePath="getting-started-features-expandable" />
5625

57-
<Alert>
26+
This guide assumes that you enable all features and allow the wizard to create an example page. You can add or remove features at any time, but setting them up now will save you the effort of configuring them manually later.
5827

59-
If the setup through the wizard doesn't work for you, you can also <PlatformLink to="/manual-setup/">set up the SDK manually</PlatformLink>.
28+
<Expandable title="What does the installation wizard change inside your application?">
6029

61-
</Alert>
30+
- Creates or updates `hooks.(client|server).js` to initialize the SDK and instrument [SvelteKit's hooks](https://kit.svelte.dev/docs/hooks)
31+
- Creates or updates `vite.config.js` to add source maps upload and auto-instrumentation via Vite plugins
32+
- Creates `.sentryclirc` with an auth token to upload source maps (this file is automatically added to `.gitignore`)
33+
- Adds an example page to your application to help verify your Sentry setup
6234

63-
## Configure
35+
</Expandable>
6436

65-
Configuration should happen as early as possible in your application's lifecycle.
37+
## Step 2: Verify Your Setup
6638

67-
To complete your configuration, add <PlatformLink to="/configuration/options/">options</PlatformLink> to your `Sentry.init()` calls.
68-
Here you can also set context data - data about the <PlatformLink to="/enriching-events/identify-user/">user</PlatformLink>, for example, or <PlatformLink to="/enriching-events/tags/">tags</PlatformLink>, or even <PlatformLink to="/enriching-events/context/">arbitrary data</PlatformLink> - which will be added to every event sent to Sentry.
39+
If you haven't tested your Sentry configuration yet, let's do it now. You can confirm that Sentry is working properly and sending data to your Sentry project by using the example page and route created by the installation wizard:
6940

41+
1. Open the example page `/sentry-example-page` in your browser
42+
2. Click the "Throw Sample Error" button. This triggers two errors:
43+
- a frontend error
44+
- an error within the API route
7045

71-
## Verify
46+
Sentry captures both of these errors for you. Additionally, the button click starts a trace to measure the time it takes for the API request to complete.
7247

73-
This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.
48+
<Alert level="success" title="Tip">
7449

75-
Add a button to a frontend component that throws an error:
76-
77-
```javascript {filename:src/routes/sentry/+page.svelte} {3}
78-
<button
79-
on:click={() => {
80-
throw new Error("Sentry Frontend Error");
81-
}}
82-
>
83-
Throw error
84-
</button>
85-
```
50+
Don't forget to explore the example files' code in your project to understand what's happening after your button click.
8651

87-
Or throw an error in one of your `load` functions:
52+
</Alert>
8853

89-
```javascript {filename:src/routes/sentry/+page.js} {2}
90-
export const load = () => {
91-
throw new Error("Sentry Load Error");
92-
};
93-
```
54+
### View Captured Data in Sentry
9455

95-
Or throw an error in an API route:
56+
Now, head over to your project on [Sentry.io](https://sentry.io) to view the collected data (it takes a couple of moments for the data to appear).
9657

97-
```javascript {filename:src/routes/sentry/+server.js} {2}
98-
export const GET = () => {
99-
throw new Error("Sentry API Error");
100-
};
101-
```
58+
<PlatformContent includePath="getting-started-browser-sandbox-warning" />
10259

103-
The possibilities are endless!
60+
<PlatformContent includePath="getting-started-verify-locate-data" />
10461

105-
<Alert>
62+
## Next Steps
10663

107-
Errors triggered from within Browser DevTools are sandboxed and will not trigger error monitoring. Keep this in mind when verifying your Sentry SDK installation.
64+
At this point, you should have integrated Sentry into your SvelteKit application and should already be sending error and performance data to your Sentry project.
10865

109-
</Alert>
66+
Now's a good time to customize your setup and look into more advanced topics.
67+
Our next recommended steps for you are:
11068

111-
<Alert>
69+
- Learn how to [manually capture errors](/platforms/javascript/guides/sveltekit/usage/)
70+
- Continue to [customize your configuration](/platforms/javascript/guides/sveltekit/configuration/)
71+
- Get familiar with [Sentry's product features](/product) like tracing, insights, and alerts
11272

113-
Learn more about manually capturing an error or message in our <PlatformLink to="/usage/">Usage documentation</PlatformLink>.
73+
<Expandable permalink={false} title="Are you having problems setting up the SDK?">
11474

115-
</Alert>
75+
- If you encountered issues with our installation wizard, try [setting up Sentry manually](/platforms/javascript/guides/sveltekit/manual-setup/)
76+
- Find various support topics in [troubleshooting](/platforms/javascript/guides/sveltekit/troubleshooting/)
77+
- [Get support](https://sentry.zendesk.com/hc/en-us/)
11678

117-
To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and select your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
79+
</Expandable>

0 commit comments

Comments
 (0)