Skip to content
Draft
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 @@ -180,6 +180,12 @@ On Shopify Oxygen, never import anything directly from `@sentry/cloudflare`. Onl

</Alert>

<Alert level="warning" title="No request isolation">

`wrapRequestHandler` doesn't isolate requests from each other. Scope data you set during a request, for example with `setTag` or `setUser`, can show up on events from other concurrent or later requests in the same isolate. Use `wrapRequestHandler` only on runtimes that can't enable `nodejs_compat`, such as Shopify Oxygen. On Cloudflare Workers, wrap your handler with `Sentry.withSentry()` instead, as described in the [Cloudflare guide](/platforms/javascript/guides/cloudflare/).

</Alert>

</SplitSectionText>
<SplitSectionCode>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ On Shopify Oxygen, never import anything directly from `@sentry/cloudflare`. Onl

</Alert>

<Alert level="warning" title="No request isolation">

`wrapRequestHandler` doesn't isolate requests from each other. Scope data you set during a request, for example with `setTag` or `setUser`, can show up on events from other concurrent or later requests in the same isolate. Use `wrapRequestHandler` only on runtimes that can't enable `nodejs_compat`, such as Shopify Oxygen. For Remix on Cloudflare Workers, follow the [Remix on Cloudflare guide](/platforms/javascript/guides/cloudflare/frameworks/remix/) instead.

</Alert>

```ts {filename:server.ts}
import { wrapRequestHandler } from "@sentry/cloudflare/request";
import { instrumentBuild } from "@sentry/remix/cloudflare";
Expand Down
10 changes: 6 additions & 4 deletions docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,23 @@ Choose the features you want to configure, and this guide will show you how:
<SplitSection>
<SplitSectionText>

Run the command for your preferred package manager to add the Sentry SDK to your application:
Run the command for your preferred package manager to add the Sentry Remix and Cloudflare SDKs to your application.

With npm, add `--legacy-peer-deps`: `@remix-run/cloudflare` requires `@cloudflare/workers-types` version 4, while Wrangler 4 requires version 5.

</SplitSectionText>
<SplitSectionCode>

```bash {tabTitle:npm}
npm install @sentry/remix --save
npm install @sentry/remix @sentry/cloudflare --save --legacy-peer-deps
```

```bash {tabTitle:yarn}
yarn add @sentry/remix
yarn add @sentry/remix @sentry/cloudflare
```

```bash {tabTitle:pnpm}
pnpm add @sentry/remix
pnpm add @sentry/remix @sentry/cloudflare
```

</SplitSectionCode>
Expand Down
11 changes: 3 additions & 8 deletions docs/platforms/javascript/guides/cloudflare/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ Not using Vite? See the <PlatformLink to="/install/wrangler/">Wrangler setup</Pl
<SplitSection>
<SplitSectionText>

Add the Sentry plugin to your existing `vite.config.ts`, next to `cloudflare()`. Both behaviors are experimental in this version, so turn them on explicitly.
Add the Sentry plugin to your existing `vite.config.ts`, next to `cloudflare()`. Both of its behaviors are on by default.

`autoInstrumentation` wraps your Worker entry, and any Durable Object, Workflow or Agents SDK class in your wrangler config, at build time, so you don't have to call `Sentry.withSentry()` yourself. `useDiagnosticsChannelInjection` instruments bundled dependencies such as database clients, which is the only way to trace them in the Workers runtime, where the SDK can't patch them at runtime.
`autoInstrumentation` wraps your Worker entry, and any Durable Object, Workflow or Agents SDK class in your wrangler config, at build time, so you don't have to call `Sentry.withSentry()` yourself. `buildTimeInstrumentation` instruments bundled dependencies such as database clients, which is the only way to trace them in the Workers runtime, where the SDK can't patch them at runtime.

To see its options, which packages it instruments, and how to opt out of either behavior, see <PlatformLink to="/install/vite-plugin/">Vite Plugin</PlatformLink>.

Expand All @@ -99,12 +99,7 @@ To see its options, which packages it instruments, and how to opt out of either
export default defineConfig({
plugins: [
cloudflare(),
+ sentryCloudflareVitePlugin({
+ _experimental: {
+ autoInstrumentation: true,
+ useDiagnosticsChannelInjection: true,
+ },
+ }),
+ sentryCloudflareVitePlugin(),
],
});
```
Expand Down
Loading
Loading