Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ Our next recommended steps for you are:
- Explore [practical guides](/guides) on what to monitor, log, track, and investigate after setup
- Learn how to <PlatformLink to="/usage">manually capture errors</PlatformLink>
- Continue to <PlatformLink to="/configuration">customize your configuration</PlatformLink>
- Make use of [React Router-specific features](/platforms/javascript/guides/react-router/features/)
- Get familiar with [Sentry's product features](/product/) like tracing, insights, and alerts

<Expandable permalink={false} title="Are you having problems setting up the SDK?">
Expand Down
16 changes: 0 additions & 16 deletions docs/platforms/javascript/guides/react-router/features/index.mdx

This file was deleted.

This file was deleted.

49 changes: 11 additions & 38 deletions docs/platforms/javascript/guides/react-router/manual-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -196,49 +196,16 @@ startTransition(() => {

### Configure Server-Side Sentry

<Expandable level="warning" title="Limited Node support for auto-instrumentation" permalink>
<Expandable level="warning" title="Limited Node support for OpenTelemetry auto-instrumentation" permalink>

Automatic server-side instrumentation is currently only supported on:
Sentry's OpenTelemetry-based auto-instrumentation (loaded through `instrument.server.mjs`) is currently only supported on:

- **Node 20:** Version \<20.19
- **Node 22:** Version \<22.12

If you're on a different version, you have two options:
This restriction **doesn't** affect tracing for loaders, actions, middleware, and request handlers. Those are instrumented through React Router's [instrumentation API](https://reactrouter.com/how-to/instrumentation) (the `instrumentations` export shown below, React Router 7.15+), which works on all Node versions.

1. **Recommended**: Use the <PlatformLink to="/features/instrumentation-api/">Instrumentation API</PlatformLink> (React Router 7.9.5+) for automatic tracing without Node version restrictions
2. **Alternative**: Use our manual server wrappers (shown below)

For server loaders use `wrapServerLoader`:

```ts
import * as Sentry from "@sentry/react-router";

export const loader = Sentry.wrapServerLoader(
{
name: "Load Some Data",
description: "Loads some data from the db",
},
async ({ params }) => {
// ... your loader logic
}
);
```

For server actions use `wrapServerAction`:

```ts
import * as Sentry from "@sentry/react-router";

export const action = Sentry.wrapServerAction(
{
name: "Submit Form Data",
description: "Processes form submission data",
},
async ({ request }) => {
// ... your action logic
}
);
```
On unsupported Node versions, you'll only lose auto-instrumentation for lower-level operations such as outgoing HTTP requests and database queries.

</Expandable>

Expand Down Expand Up @@ -296,7 +263,9 @@ Sentry.init({
<SplitSection>
<SplitSectionText>

Next, replace the default `handleRequest` and `handleError` functions in your `entry.server.tsx` file with Sentry's wrapped versions:
Next, replace the default `handleRequest` and `handleError` functions in your `entry.server.tsx` file with Sentry's wrapped versions, and export `instrumentations` to enable automatic tracing.

Exporting `instrumentations` uses React Router's [instrumentation API](https://reactrouter.com/how-to/instrumentation) (React Router 7.15+) to automatically create spans for all loaders, actions, middleware, and request handlers — no need to wrap them individually.

</SplitSectionText>
<SplitSectionCode>
Expand All @@ -320,6 +289,10 @@ Next, replace the default `handleRequest` and `handleError` functions in your `e
+ logErrors: false
+});

+// Automatically instruments all server loaders, actions, middleware,
+// and request handlers. Requires React Router 7.15+.
+export const instrumentations = [Sentry.createSentryServerInstrumentation()];

// ... rest of your server entry
```

Expand Down
7 changes: 6 additions & 1 deletion redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,10 @@ const userDocsRedirects = [
source: '/platforms/javascript/guides/aws-lambda/cjs-npm__v9.x/',
destination: '/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x/',
},
{
source: '/platforms/javascript/guides/react-router/features/instrumentation-api/',
destination: '/platforms/javascript/guides/react-router/manual-setup/',
},
Comment thread
sentry[bot] marked this conversation as resolved.
{
source: '/platforms/javascript/guides/nextjs/sourcemaps/uploading/',
destination: '/platforms/javascript/guides/nextjs/sourcemaps/',
Expand Down Expand Up @@ -1868,7 +1872,8 @@ const userDocsRedirects = [
},
{
source: '/product/insights/mobile-vitals/screen-loads/',
destination: '/product/dashboards/sentry-dashboards/mobile/mobile-vitals/screen-loads/',
destination:
'/product/dashboards/sentry-dashboards/mobile/mobile-vitals/screen-loads/',
},
{
source: '/product/insights/mobile-vitals/:path*',
Expand Down
Loading