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): Instrument Nitro v3 cache storage by sentry-junior[bot] · Pull Request #25951 · getsentry/sentry-javascript

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Why: Starting with the RC, Nitro v3 runs defineCachedFunction / defineCachedHandler (and cache route rules) on an ocache storage. That storage only goes through KV storage when the kv cache driver is set, so with the default memory driver (and with fs) our KV driver instrumentation never sees cache reads or writes, and no cache.* spans are produced. Nitro doesn't offer a tracing channel for its cache, and the storage instance is private to Nitro's runtime. It is created in the build-time #nitro/virtual/cache module, though, so a bundler transform wraps that module's createCacheStorage export and the storage gets patched in place. It has to be patched in place because ocache also reads binary and maxEntryBytes from the storage object. The kv driver is skipped because the existing KV instrumentation already covers it. cache.hit comes from the stored entry: it must have a value, be unexpired, and not be marked stale. This PR also undoes the kv workaround in the nuxt-5 E2E app, so the default driver is what gets tested.

How to review: Start with cacheStorageInstrumentationPlugin in vite/storageConfig.ts, then instrumentCacheStorage in runtime/utils/instrumentStorage.ts. The span wrapper is now shared with the KV driver instrumentation, and KV behavior is unchanged.

Unsure about: The transform matches the exact export const createCacheStorage = line that Nitro generates. If Nitro changes that template, the transform does nothing (no crash), but cache spans would disappear again. Is that acceptable, or should we push upstream for a tracing channel or hook in Nitro/ocache? Note this is stacked on #25949.

via Francesco Gringl-Novy.

--

View Session [Sentry]

Sorry, something went wrong.

Uh oh!

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

All reactions
@github-actions

github-actions Bot commented Oct 30, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: cc59724 (PR test merge using develop at 60f2958)

Against: 60f2958 (develop) · base run #65933

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

Path Size % Change Change
@sentry/browser 30.04 kB - -
@sentry/browser - with treeshaking flags 28.23 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.12 kB - -
@sentry/browser (incl. Tracing) 52.2 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.2 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.17 kB - -
@sentry/browser (incl. Tracing, Replay) 92.73 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.52 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.08 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 110.51 kB - -
@sentry/browser (incl. Feedback) 47.66 kB - -
@sentry/browser (incl. sendFeedback) 30.62 kB - -
@sentry/browser (incl. FeedbackAsync) 35.62 kB - -
@sentry/browser (incl. Metrics) 31.36 kB - -
@sentry/browser (incl. Logs) 31.64 kB - -
@sentry/browser (incl. Metrics & Logs) 32.3 kB - -
@sentry/react 32.04 kB - -
@sentry/react (incl. Tracing) 54.86 kB - -
@sentry/vue 38.21 kB - -
@sentry/vue (incl. Tracing) 55.14 kB - -
@sentry/svelte 30.05 kB - -
@sentry/remix (Remix 3 client bundle) 57.96 kB - -
CDN Bundle 31.79 kB - -
CDN Bundle (incl. Tracing) 52.58 kB - -
CDN Bundle (incl. Logs, Metrics) 34.58 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.14 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 75.61 kB - -
CDN Bundle (incl. Tracing, Replay) 90.63 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.25 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 96 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.6 kB - -
CDN Bundle - uncompressed 92.69 kB - -
CDN Bundle (incl. Tracing) - uncompressed 155.13 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 101.03 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 162.76 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 231.11 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 275.27 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 282.9 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.07 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 294.69 kB - -
@sentry/nextjs (client) 58.23 kB - -
@sentry/sveltekit (client) 53.26 kB - -
@sentry/core/server 44.53 kB - -
@sentry/core/browser 13.99 kB - -
@sentry/node 149.49 kB -0.01% -4 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.3 kB - -
@sentry/node - without tracing 88.39 kB -0.01% -6 B 🔽
@sentry/node - without channel injection 138.45 kB -0.01% -2 B 🔽
@sentry/aws-serverless 97.3 kB -0.01% -7 B 🔽
@sentry/cloudflare (withSentry) - minified 204.35 kB - -
@sentry/cloudflare (withSentry) 474.32 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 229.66 kB - -

View base workflow run

sentry-junior[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

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

@github-actions

github-actions Bot commented Oct 30, 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. 7 successful. See the run.

Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (kv-cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-cloudflare Test (optional) Successful in 27s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 36s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (tunnel-dev) Test (optional) Successful in 1m Details
sentry-junior[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

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

@mydea
mydea added this pull request to stack #26016 November 3, 2026 10:56
@mydea mydea self-assigned this Nov 3, 2026
@mydea
mydea force-pushed the feat/nuxt-nitro-v3-cache-instrumentation branch from 9a64d17 to 0d9ba54 Compare November 3, 2026 11:55
mydea
mydea reviewed Nov 3, 2026
View reviewed changes
Comment thread packages/nuxt/src/runtime/utils/instrumentStorage.ts Resolved

Uh oh!

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

mydea
mydea reviewed Nov 3, 2026
View reviewed changes
Comment thread packages/nuxt/src/runtime/utils/instrumentStorage.ts Resolved

Uh oh!

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

Base automatically changed from fix/nuxt-5-nitro-rc to develop November 4, 2026 09:51
mydea
mydea reviewed Nov 4, 2026
View reviewed changes
Comment thread packages/nuxt/src/runtime/utils/instrumentStorage.ts Resolved

Uh oh!

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

mydea
mydea reviewed Nov 4, 2026
View reviewed changes
Comment thread packages/nuxt/src/runtime/utils/instrumentStorage.ts Resolved

Uh oh!

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

mydea
mydea reviewed Nov 4, 2026
View reviewed changes
Comment thread dev-packages/e2e-tests/test-applications/nuxt-5/tests/cache.test.ts Resolved

Uh oh!

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

mydea
mydea reviewed Nov 4, 2026
View reviewed changes
Comment thread packages/nuxt/src/runtime/utils/instrumentStorage.ts Resolved

Uh oh!

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

@mydea
mydea force-pushed the feat/nuxt-nitro-v3-cache-instrumentation branch from 2222437 to b919c0d Compare November 4, 2026 12:18
@mydea
mydea marked this pull request as ready for review November 4, 2026 13:44
@mydea
mydea requested review from a team as code owners November 4, 2026 13:44
@mydea
mydea requested review from Lms24, andreiborza, chargome, logaretm, mydea and s1gr1d and removed request for a team November 4, 2026 13:44
cursor[bot]
cursor Bot reviewed Nov 4, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b919c0d. Configure here.

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/instrumentStorage.ts Resolved

Uh oh!

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

Comment thread packages/nuxt/test/runtime/utils/instrumentStorage.test.ts Resolved

Uh oh!

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

logaretm
logaretm reviewed Nov 5, 2026
View reviewed changes

@logaretm logaretm 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.

I think the approach is a bit risky since it matches user code. I know we have precedents for that.

But I think I can PR tracing channels to ocache upstream since Nitro's ecosystem doesn't mind it.

Sorry, something went wrong.

Uh oh!

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

All reactions
@mydea

mydea commented Nov 11, 2026

Copy link
Copy Markdown
Member

I think the approach is a bit risky since it matches user code. I know we have precedents for that.But I think I can PR tracing channels to ocache upstream since Nitro's ecosystem doesn't mind it.

yeah that would be nicer! should we still merge this like this or would you prefer to postpone this/do this differently for now @logaretm ?

sentry-junior[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

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

logaretm
logaretm approved these changes Nov 12, 2026
View reviewed changes
@logaretm Linear Code

logaretm commented Nov 12, 2026

Copy link
Copy Markdown
Member

let's merge it, i think the tracing channel solution will take sometime to get merged, and when it does we can rip this one out as long as nitro remains in rc.

sentry-junior[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

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

sentry-junior Bot and others added 10 commits November 13, 2026 08:59
@sentry-junior @mydea
ref(server-runtime-injection): Say when hook registration fails becau…
5ec2b5e
…se the deployment is missing a file (#26272)

**Why:** Follow-up to #26271. When `Module.register()` fails with
`ERR_MODULE_NOT_FOUND`, the always-on warning used to just repeat Node's
"Cannot find module …". That reads like an SDK bug, when the real cause
is that a build tracer didn't ship all of
`@sentry/server-runtime-injection`. The warning now says so. I checked
on Node 22 that `error.code` survives the trip back from the loader
thread. The warning still fires once per process: issue #26121 asks for
it to be quiet, but staying silent would hide that channel integrations
aren't recording anything (see #25677).

**How to review:** It's a single branch in the `catch` block of
`registerDiagnosticsChannelInjection()`, plus one unit test.

Refs #26121

<!-- junior-request-attribution:start -->
via **Francesco Gringl-Novy**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AD0CA8FXFXAS%3A1794383205.954799 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/slack%3AD0CA8FXFXAS%3A1794383205.954799)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0CA8FXFXAS%3A1794383205.954799/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Francesco Gringl-Novy <[email protected]>
@sentry-junior @mydea
feat(nuxt): Instrument Nitro v3 cache storage
98d18f2
Nitro v3 keeps cached functions and handlers in an ocache storage that
only goes through KV storage with the `kv` cache driver, so the default
`memory` and the `fs` drivers produced no cache spans. Wrap the
storage that the `#nitro/virtual/cache` module creates at build time.

Co-Authored-By: Francesco Gringl-Novy <[email protected]>
@sentry-junior
test(nuxt): Type cache storage mock set options
2e9978a
@sentry-junior
ref(nuxt): Rely on startSpan to set error status for cache spans
fc16ac1
@sentry-junior
ref(nuxt): Use handleCallbackErrors for cache span errors
cf1e2d3
@sentry-junior
ref(nuxt): Wrap cache span in handleCallbackErrors
72a11ca
@sentry-junior
ref(nuxt): Drop explicit OK status on cache spans
871217e
@sentry-junior
ref(nuxt): Hardcode cache storage mechanism type
9b2efb4
@sentry-junior
test(nuxt): Add kv cache driver variant to nuxt-5 cache tests
7e80366
@sentry-junior
test(nuxt): Use conventions constants in cache storage tests
9414e89
@mydea
mydea force-pushed the feat/nuxt-nitro-v3-cache-instrumentation branch from 2b9a192 to 9414e89 Compare November 13, 2026 07:59
@mydea
mydea requested a review from a team November 13, 2026 07:59
@mydea
mydea merged commit a72b2d8 into develop Nov 13, 2026
74 checks passed

Uh oh!

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

@mydea
mydea deleted the feat/nuxt-nitro-v3-cache-instrumentation branch November 13, 2026 09:45
@sentry-release-bot sentry-release-bot Bot mentioned this pull request Nov 16, 2026
publish: getsentry/[email protected] getsentry/publish#10451
Closed
51 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@logaretm logaretm logaretm approved these changes
@chargome chargome Awaiting requested review from chargome chargome was automatically assigned from getsentry/team-javascript-sdks-framework
@s1gr1d s1gr1d Awaiting requested review from s1gr1d s1gr1d was automatically assigned from getsentry/team-javascript-sdks-framework
@Lms24 Lms24 Awaiting requested review from Lms24 Lms24 was automatically assigned from getsentry/team-javascript-sdks-browser
@mydea mydea Awaiting requested review from mydea mydea was automatically assigned from getsentry/team-javascript-sdks-server
@andreiborza andreiborza Awaiting requested review from andreiborza andreiborza was automatically assigned from getsentry/team-javascript-sdks-server

Uh oh!

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

Assignees

@mydea mydea

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

@mydea @logaretm
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.