GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(nuxt): Set up Cloudflare from `sentry.cloudflare.config.ts` by JPeer264 · Pull Request #26754 · getsentry/sentry-javascript

Conversation

@JPeer264

@JPeer264 JPeer264 commented Nov 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

follow up to #26285

Description

This sets up @sentry/nuxt on Cloudflare from a sentry.cloudflare.config.ts in the app root. On a Cloudflare preset, the module wraps the Worker entry of Nitro with withSentry and adds the Nitro plugins of the Node setup, so route names, meta tags, middleware, storage, cache and database spans work on Cloudflare too. This works with Nitro 2 (Nuxt 4) and Nitro 3 (Nuxt 5).

// sentry.cloudflare.config.ts
import { defineCloudflareOptions } from '@sentry/cloudflare';

export default defineCloudflareOptions(env => ({
  dsn: env.SENTRY_DSN,
  tracesSampleRate: 1.0,
}));

The handlers run in withEnv with the env that withSentry instruments, so code that reads env from cloudflare:workers, like db0 of Nitro 3, gets the instrumented bindings too. On Nitro 2 and Nitro 3, @sentry/cloudflare creates the D1 spans. Like on Node, the SDK ignores the server spans of requests to the build output (app.baseURL + app.buildAssetsDir).

This also deprecates sentryCloudflareNitroPlugin. When an app has sentry.cloudflare.config.ts and the plugin, the plugin does nothing and logs a warning.

Why

With sentryCloudflareNitroPlugin, the module adds no middleware, storage, cache or database spans, and the baggage meta tag has no route, because the plugin creates it before the route is known.

Known issues

  • nuxt dev does not run the Worker entry, because the cloudflare-dev preset extends nitro-dev. So the module does not wrap anything in dev.
  • The cloudflare-worker (service worker) preset of Nitro 2 has no default export to wrap. There the module only logs a warning.

Sentry traces

Before, Nitro 2 with sentryCloudflareNitroPlugin, /api/storage-test has only the http.server span: https://sentry-sdks.sentry.io/explore/traces/trace/b35a22b46b6f422d96954dacdac2b169/?project=4510555608449024&timestamp=1795360390
Before, Nitro 2 with sentryCloudflareNitroPlugin, /api/db-test has no database spans: https://sentry-sdks.sentry.io/explore/traces/trace/9a45858334834dd7aa6128aeee46c5b0/?project=4510555608449024&timestamp=1795360390
After, Nitro 2, /api/storage-test has middleware and cache spans: https://sentry-sdks.sentry.io/explore/traces/trace/da68b8bebd09438baee03d50d4697300/?project=4510555608449024&timestamp=1795360223
After, Nitro 2, /api/db-test has D1 spans from @sentry/cloudflare: https://sentry-sdks.sentry.io/explore/traces/trace/3854bccf179e416e8c2329e5d2fca05a/?project=4510555608449024&timestamp=1795360223
After, Nitro 3, /api/storage-test has middleware and cache spans: https://sentry-sdks.sentry.io/explore/traces/trace/d628817679c542909abcd6cf31ffca66/?project=4510555608449024&timestamp=1795361326
After, Nitro 3, /api/db-test has D1 spans from @sentry/cloudflare: https://sentry-sdks.sentry.io/explore/traces/trace/98d7910d5b0c491dacf1b84ddbb6ae14/?project=4510555608449024&timestamp=1795365743
Node, Nitro 2, /api/storage-test has the same middleware and cache spans: https://sentry-sdks.sentry.io/explore/traces/trace/dedb120e79a84db48d42025513022e5e/?project=4510555608449024&timestamp=1795431729
Node, Nitro 2, /api/db-test has db0 spans from @sentry/nuxt: https://sentry-sdks.sentry.io/explore/traces/trace/3ec8c1026f824b6398120a7ec3fa4eee/?project=4510555608449024&timestamp=1795431729
Node, Nitro 3, /api/storage-test has the same middleware and cache spans: https://sentry-sdks.sentry.io/explore/traces/trace/015523693d2e4b08b0000b3c5cc16cae/?project=4510555608449024&timestamp=1795431770
Node, Nitro 3, /api/db-test has db0 spans from @sentry/nuxt: https://sentry-sdks.sentry.io/explore/traces/trace/ae507aa3f3d1487696f6745b340e7d5b/?project=4510555608449024&timestamp=1795431770

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented Nov 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: e84181b (PR test merge using develop at 69dbad1)

Against: 69dbad1 (develop) · base run #67826

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 30.54 kB - -
@sentry/browser - with treeshaking flags 28.73 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.6 kB - -
@sentry/browser (incl. Tracing) 53.67 kB - -
@sentry/browser (incl. Tracing Core) 40.59 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 53.67 kB - -
@sentry/browser (incl. Tracing, Profiling) 56.57 kB - -
@sentry/browser (incl. Tracing, Replay) 93.6 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 82.46 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 98.43 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 111.4 kB - -
@sentry/browser (incl. Feedback) 48.4 kB - -
@sentry/browser (incl. sendFeedback) 31.11 kB - -
@sentry/browser (incl. FeedbackAsync) 36.17 kB - -
@sentry/browser (incl. Metrics) 31.86 kB - -
@sentry/browser (incl. Logs) 32.13 kB - -
@sentry/browser (incl. Metrics & Logs) 32.8 kB - -
@sentry/react 32.56 kB - -
@sentry/react (incl. Tracing) 56.38 kB - -
@sentry/vue 38.75 kB - -
@sentry/vue (incl. Tracing) 56.68 kB - -
@sentry/svelte 30.57 kB - -
@sentry/effect (client) 42.25 kB - -
@sentry/effect (client, incl. Tracing) 54.97 kB - -
@sentry/effect (client, incl. Tracing, Logs, Metrics) 66.35 kB - -
@sentry/remix (Remix 3 client bundle) 59.39 kB - -
CDN Bundle 32.54 kB - -
CDN Bundle (incl. Tracing) 54.15 kB - -
CDN Bundle (incl. Logs, Metrics) 35.27 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 56.63 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 76.22 kB - -
CDN Bundle (incl. Tracing, Replay) 91.94 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 94.47 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.39 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.86 kB - -
CDN Bundle - uncompressed 94.92 kB - -
CDN Bundle (incl. Tracing) - uncompressed 160.25 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 103.26 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 167.88 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 233.61 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 280.65 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 288.28 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 292.58 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 300.2 kB - -
@sentry/nextjs (client) 60.09 kB - -
@sentry/sveltekit (client) 55.03 kB - -
@sentry/core/server 45.83 kB - -
@sentry/core/browser 14.46 kB - -
@sentry/node 156.41 kB -0.01% -2 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.45 kB - -
@sentry/node - without tracing 89.28 kB -0.01% -4 B 🔽
@sentry/node - without channel injection 145.33 kB -0.01% -1 B 🔽
@sentry/aws-serverless 99.92 kB -0.01% -3 B 🔽
@sentry/cloudflare (withSentry) - minified 211.93 kB - -
@sentry/cloudflare (withSentry) 491.77 kB - -
@sentry/cloudflare (withSentry, instrumented CommonJS package) - minified 214.88 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 237.17 kB - -

View base workflow run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Nov 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Optional E2E tests

All optional checks were successful. 12 successful. See the run.

Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E nuxt-5 (kv-cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (development) Test (optional) Successful in 53s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel (cloudflare) Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel Test (optional) Successful in 40s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-cloudflare Test (optional) Successful in 31s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E nuxt-4-sourcemaps (Vite server) Test (optional) Successful in 30s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps enabled by Sentry) Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (no upload) Test (optional) Successful in 33s Details
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JPeer264
JPeer264 added this pull request to stack #26767 November 23, 2026 13:15
@JPeer264
JPeer264 force-pushed the jp/nuxt-cloudflare-instrument-server branch from 3a602e9 to 20c3ddf Compare November 24, 2026 07:05
@JPeer264 JPeer264 self-assigned this Nov 24, 2026
sentry-warden[bot]
sentry-warden Bot reviewed Nov 24, 2026
View reviewed changes
Comment thread packages/nuxt/src/runtime/plugins/cloudflare-entry.server.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@JPeer264
JPeer264 marked this pull request as ready for review November 24, 2026 07:37
@JPeer264
JPeer264 requested a review from s1gr1d November 24, 2026 07:37
@javascript-sdk-gitflow
javascript-sdk-gitflow Bot requested review from chargome and nicohrubec November 24, 2026 07:38
s1gr1d
s1gr1d reviewed Nov 24, 2026
View reviewed changes
Comment thread packages/nuxt/src/runtime/plugins/sentry-cloudflare.server.ts Outdated
Comment on lines +72 to +73
* @deprecated Add an `instrument.server.ts` file to the root of the Nuxt app instead. Its default export returns the
* options of `@sentry/cloudflare`, and the Sentry Nuxt module wraps the Worker with `withSentry`.

@s1gr1d s1gr1d Nov 24, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @deprecated Add an `instrument.server.ts` file to the root of the Nuxt app instead. Its default export returns the
* options of `@sentry/cloudflare`, and the Sentry Nuxt module wraps the Worker with `withSentry`.
* @deprecated Add an `instrument.server.ts` file with the Sentry setup to the root of the Nuxt app instead. Its default export returns the
* options of `@sentry/cloudflare`, and the Sentry Nuxt module wraps the Worker with `withSentry`.

Not sure if we should leave the second sentence "Its default export ..." as it's almost too internal-technical information for users.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JPeer264 JPeer264 Nov 24, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed without hesitation

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/nuxt/src/vite/cloudflare.ts Outdated
*/
export function setupCloudflareEntry(nuxt: Nuxt, optionsFile: string): void {
nuxt.hook('nitro:init', nitro => {
if (nuxt.options._prepare || !isCloudflarePreset(nitro.options.preset)) {

@s1gr1d s1gr1d Nov 24, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (nuxt.options._prepare || !isCloudflarePreset(nitro.options.preset)) {
if (nuxt.options._prepare || nitro.options.dev || !isCloudflarePreset(nitro.options.preset)) {

cloudflare-dev (which is used in dev) would also be matched here. But we should probably skip this in dev, no? Did you check/test devmode already?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JPeer264 JPeer264 Nov 24, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. In nuxt dev, with Nitro 2, uses the cloudflare-dev preset, which apparently extends nitro-dev, so there is no Worker entry to wrap as it's not really using miniflare, and the module printed a wrong warning which is gone now.

Nitro 3 dev, which actually runs miniflare fails currently also without Sentry, so I couldn't test it there. I will do a follow up there.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

s1gr1d reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread packages/nuxt/src/vite/utils.ts
Comment on lines +38 to +51
export async function findCloudflareOptionsFile(
nuxt?: Nuxt,
options?: SentryNuxtModuleOptions,
): Promise<string | undefined> {
return findConfigFile('instrument.server', nuxt, options);
}

async function findConfigFile(
basename: string,
nuxt?: Nuxt,
options?: SentryNuxtModuleOptions,
): Promise<string | undefined> {
const possibleFileExtensions = ['ts', 'js', 'mjs', 'cjs', 'mts', 'cts'];
const relativePaths = possibleFileExtensions.map(ext => `sentry.${type}.config.${ext}`);
const relativePaths = possibleFileExtensions.map(ext => `${basename}.${ext}`);

@s1gr1d s1gr1d Nov 24, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We deprecated and removed support for the instrument.server file in v11. It's a bit weird if this file comes back again. Maybe we could rename it to sentry.cf.config.ts, sentry.cloudflare.config.ts or sentry.workers.config.ts?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JPeer264 JPeer264 Nov 24, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. I like sentry.cloudflare.config.ts actually most (since it is our Cloudflare SDK, even though "workers" would be more accurate). I like it so much that is something we could and should actually support everywhere by default.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

s1gr1d reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@JPeer264 JPeer264 Nov 24, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved it now to the new config file name.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/nuxt/src/vite/addServerConfig.ts Outdated
// eslint-disable-next-line no-console
console.warn(
`[Sentry] Found \`${basename(configPath)}\`, but the Nitro preset targets Cloudflare, where this file is not used. Set up the SDK with \`sentryCloudflareNitroPlugin\` instead: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/cloudflare-workers/`,
`[Sentry] Found \`${basename(configPath)}\`, but the Nitro preset targets Cloudflare, where this file is not used. Set up the SDK in \`instrument.server.ts\` instead: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/cloudflare-workers/`,

@s1gr1d s1gr1d Nov 24, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`[Sentry] Found \`${basename(configPath)}\`, but the Nitro preset targets Cloudflare, where this file is not used. Set up the SDK in \`instrument.server.ts\` instead: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/cloudflare-workers/`,
`[Sentry] Found \`${basename(configPath)}\`, but the Nitro preset targets Cloudflare, where this file is not used. Set up the SDK in \`......\` instead: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/cloudflare-workers/`,

Make sure this name is matched with whatever is used in the end.

Also, we need to update the docs because this is showing the old setup. I would propose we still show the deprecated setup steps in the docs (in case people are on old versions - we can also add versioned docs for that) and also show a mini migration guide.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JPeer264 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@JPeer264 JPeer264 Nov 24, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's work on this together since it seems you already have a clear idea in your head on how this could work out.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/nuxt/src/runtime/plugins/cloudflare-entry.server.ts

// `withSentry` sets no transaction name, so errors captured during the request would have none.
// This is the same best-effort name the Node SDK sets when a request starts.
nitroApp.hooks.hook('request', (event: H3Event) => {

@s1gr1d s1gr1d Nov 24, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test for this request hook for a v1 and v2 H3Event?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JPeer264 JPeer264 Nov 24, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yap, added

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JPeer264 JPeer264 changed the title feat(nuxt): Set up Cloudflare from instrument.server.ts feat(nuxt): Set up Cloudflare from sentry.cloudflare.config.ts Nov 24, 2026
@JPeer264
JPeer264 requested a review from s1gr1d November 24, 2026 14:17
@JPeer264
JPeer264 force-pushed the jp/nuxt-cloudflare-instrument-server branch from cd30cce to 5edb5da Compare November 24, 2026 14:48
@JPeer264

JPeer264 commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

@s1gr1d FYI after the rebase I had to adjust the code to make the tests pass: 5edb5da. So the PR got a bit bigger.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

s1gr1d
s1gr1d approved these changes Nov 24, 2026
View reviewed changes

@s1gr1d s1gr1d left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a mini comment, otherwise good

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/nuxt/src/runtime/utils/wrapCloudflareEntry.ts
Comment on lines +37 to +41
const options = optionsCallbackWithMetadata(env);
return {
...options,
ignoreSpans: [...(options.ignoreSpans || []), ...getBuildAssetRequestFilters(buildAssetsPath)],
};

@s1gr1d s1gr1d Nov 24, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sdk setup uses _INTERNAL_captureOptionsSetByUser, should we maybe also check that here? so it captures the user options first

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JPeer264 JPeer264 Nov 25, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smart move, added.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
JPeer264 and others added 10 commits November 25, 2026 01:53
@JPeer264 @claude
feat(nuxt): Set up Cloudflare from instrument.server.ts
90e71de
On a Cloudflare preset, the Nuxt module now wraps the Nitro Worker entry
with `withSentry` of `@sentry/cloudflare` and gets the options from the
default export of `instrument.server.ts` in the app root. This is the same
file that the Cloudflare Vite plugin reads. Nitro builds the Worker itself,
with Rollup in Nitro 2 and with its own Vite build in Nitro 3, so the
Cloudflare Vite plugin cannot wrap it. The client reports the Nuxt SDK name.

With Rollup, the bundler plugin of the module replaces the entry when Rollup
resolves it. Vite resolves the entry before it asks the plugin, so there the
plugin replaces the code of the entry module in `transform`.

When the Nitro entry exports a `$DurableObject` class, as with the
`cloudflare_durable` preset, the module also wraps it with
`instrumentDurableObjectWithSentry`, so a request that Nitro sends to it
with `durableFetch` continues the trace of the Worker.

With this file, the module also adds the Nitro plugins of the Node setup
(errors, route names, meta tags, middleware, storage and database spans)
and names the transaction of each request. On Cloudflare, the orchestrion
transform now imports `tracingChannel` from the workerd facade of
`@sentry/cloudflare`, which defers the events of module-scope calls until a
request runs.

`withSentry` instruments the bindings of the `env` that it gives to the
handlers. db0 of Nitro 2 reads the D1 bindings from this `env`, but db0 of
Nitro 3 reads them from the `env` of `cloudflare:workers`. So the wrapped
entry runs each handler, and each method of the Nitro Durable Object, in
`withEnv` of `cloudflare:workers` with the instrumented `env`. Then the
code of the app that reads `env` from `cloudflare:workers` also gets the
instrumented bindings. The database instrumentation of the module leaves
out the databases with the `cloudflare-d1` connector, so on Nitro 2 and
Nitro 3, `@sentry/cloudflare` creates the one span of each D1 query.

`sentryCloudflareNitroPlugin` is deprecated. In an app that has
`instrument.server.ts` and also the plugin, the plugin does nothing and
prints a warning, so `withSentry` is the only wrapper of a request.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JPeer264
fixup! feat(nuxt): Set up Cloudflare from instrument.server.ts
35a94ff
@JPeer264
fixup! feat(nuxt): Set up Cloudflare from instrument.server.ts
7388fe7
@JPeer264
fixup! feat(nuxt): Set up Cloudflare from instrument.server.ts
0c8be18
@JPeer264
fixup! feat(nuxt): Set up Cloudflare from instrument.server.ts
40735ad
@JPeer264
fixup! feat(nuxt): Set up Cloudflare from instrument.server.ts
f759eba
@JPeer264
fixup! feat(nuxt): Set up Cloudflare from instrument.server.ts
f51b356
@JPeer264
fixup! feat(nuxt): Set up Cloudflare from instrument.server.ts
f505a78
@JPeer264
fixup! feat(nuxt): Set up Cloudflare from instrument.server.ts
e72d045
@JPeer264
fixup! feat(nuxt): Set up Cloudflare from instrument.server.ts
74d0341
@JPeer264
JPeer264 force-pushed the jp/nuxt-cloudflare-instrument-server branch from 2ec5522 to 74d0341 Compare November 25, 2026 06:53
@JPeer264
JPeer264 merged commit 3a5de4a into develop Nov 25, 2026
77 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@JPeer264
JPeer264 deleted the jp/nuxt-cloudflare-instrument-server branch November 25, 2026 07:08
@sentry-release-bot sentry-release-bot Bot mentioned this pull request Nov 25, 2026
publish: getsentry/[email protected] getsentry/publish#10573
Closed
51 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sentry-warden sentry-warden[bot] sentry-warden[bot] left review comments
@s1gr1d s1gr1d s1gr1d approved these changes
@chargome chargome Awaiting requested review from chargome
@nicohrubec nicohrubec Awaiting requested review from nicohrubec

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@JPeer264 JPeer264

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@JPeer264 @s1gr1d
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.