GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(nuxt): Remove redundant Nitro 3 route-name plugin by mydea · Pull Request #24880 · getsentry/sentry-javascript Conversation
Member
Stacked on #24869. On Nitro 3, Unlike the storage duplication (#24869), this produced no duplicate spans — just redundant, idempotent attribute writes — so there's no behavior change, only a cleanup. The v3 🤖 Generated with Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
size-limit report 📦
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
9891641 to
f882315
Compare
fb27207 to
f4bd6ae
Compare
874455e to
9cfef61
Compare
f4bd6ae to
2a97f05
Compare
|
|
||
| if (isNitroV3) { | ||
| addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/handler.server')); | ||
| addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/update-route-name.server')); | ||
| // On Nitro 3, the parametrized route name and `url.path.parameter.*` attributes are set by | ||
| // `@sentry/server-utils`' `nitroIntegration` (auto-injected via `@sentry/node` defaults) for | ||
| // API routes, and by `route-detector.server` for SSR page routes, so no Nuxt route-name | ||
| // plugin is needed. Legacy Nitro (v2) has no such channels and keeps its own. | ||
| } else { | ||
| addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/handler-legacy.server')); | ||
| addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/update-route-name-legacy.server')); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Bug: Removing update-route-name.server results in generic API route transaction names when tracing is disabled, as the replacement nitroIntegration is only active with tracing.
Severity: MEDIUM
The update-route-name.server plugin should be retained to ensure API route names are correctly parameterized for all users, including those who do not have performance tracing enabled. This guarantees consistent behavior regardless of the user's tracing configuration.
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: packages/nuxt/src/module.ts#L112-L121
Potential issue: The pull request removes the `update-route-name.server` Nitro plugin,
assuming that the `nitroIntegration` will handle API route naming. However, the
`nitroIntegration` is only added to default integrations when tracing is enabled (e.g.,
`tracesSampleRate` is set). For users who only use Sentry for error tracking without
tracing, or who set `defaultIntegrations: false`, this change will cause Nitro API
routes to have generic, unparameterized transaction names. The removed plugin was the
sole mechanism ensuring correct route naming in these common configurations.
Did we get this right? 👍 / 👎 to inform future reviews.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
On Nitro 3, `@sentry/server-utils`' `nitroIntegration` (auto-injected via `@sentry/node`'s defaults) already sets the parametrized route name and `url.path.parameter.*` attributes for API routes, and `route-detector.server` handles SSR page routes. Nuxt's `update-route-name.server` set the same attributes on the same span — redundant work with no extra telemetry — so it is removed for Nitro 3. Legacy Nitro (v2), which has no native tracing channels, keeps its own plugin, and the shared `updateRouteBeforeResponse` hook stays for the legacy and Cloudflare paths. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
9cfef61 to
b515709
Compare
2a97f05 to
01d3ad1
Compare
|
actually, this fails on nuxt 5, so closing this pr |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.