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(nextjs): Record cache spans for `use cache` functions by s1gr1d · Pull Request #24302 · getsentry/sentry-javascript

Conversation

@s1gr1d

@s1gr1d s1gr1d commented Sep 10, 2026

Copy link
Copy Markdown
Member

First merge: #24301

use cache reads and writes are invisible in traces. This wraps get/set on Next's cache-handler registry (@next/cache-handlers-map, plus the dev-only private handler) with cache.get/cache.put spans.

Decisions:

  • Keys are SHA-1 digests, because raw keys serialize function arguments (PII).
  • cache.hit mirrors Next: entries past expire count as misses. Tag discards stay hits (undetectable at the handler).
  • Hits carry cache.item_age, cache.ttl, and cache.tags. The first and last are pending sentry-conventions upstreaming.
  • Guards live on globalThis (the module loads once per bundle). Both initorderings work: next start and dev server.

Related to #12888. But the legacy incremental cache (fetch/ISR) stays uncovered.

Cache Fill
image


Cache Get
image

Closes #24289

Sorry, something went wrong.

Uh oh!

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

sentry[bot] reacted with hooray emoji
All reactions
  • 🎉 1 reaction
s1gr1d added 3 commits September 10, 2026 14:24
@s1gr1d
test(nextjs): Add E2E assertions for use cache functions
6c2fa19
@s1gr1d
add .fail
a4b4b57
@s1gr1d
feat(nextjs): Record cache spans for use cache functions
1a9ac26
@s1gr1d
s1gr1d requested a review from a team as a code owner September 10, 2026 12:43
@s1gr1d
s1gr1d requested review from mydea and nicohrubec and removed request for a team September 10, 2026 12:43
@github-actions

github-actions Bot commented Sep 10, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 28.96 kB - -
@sentry/browser - with treeshaking flags 27.26 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.15 kB - -
@sentry/browser (incl. Tracing) 50.48 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 50.48 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.47 kB - -
@sentry/browser (incl. Tracing, Replay) 89.98 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.1 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 94.68 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 107.69 kB - -
@sentry/browser (incl. Feedback) 46.46 kB - -
@sentry/browser (incl. sendFeedback) 34.01 kB - -
@sentry/browser (incl. FeedbackAsync) 39.12 kB - -
@sentry/browser (incl. Metrics) 29.98 kB - -
@sentry/browser (incl. Logs) 30.24 kB - -
@sentry/browser (incl. Metrics & Logs) 30.91 kB - -
@sentry/react 30.72 kB - -
@sentry/react (incl. Tracing) 52.77 kB - -
@sentry/vue 36.2 kB - -
@sentry/vue (incl. Tracing) 52.71 kB - -
@sentry/svelte 28.98 kB - -
CDN Bundle 30.7 kB - -
CDN Bundle (incl. Tracing) 50.97 kB - -
CDN Bundle (incl. Logs, Metrics) 32.98 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 52.95 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.67 kB - -
CDN Bundle (incl. Tracing, Replay) 88.52 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.48 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 94.59 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.59 kB - -
CDN Bundle - uncompressed 90.83 kB - -
CDN Bundle (incl. Tracing) - uncompressed 152.27 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.41 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 158.24 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.82 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 271.84 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 277.79 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 285.54 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 291.48 kB - -
@sentry/nextjs (client) 55.09 kB - -
@sentry/sveltekit (client) 50.88 kB - -
@sentry/core/server 37.13 kB - -
@sentry/core/browser 13.66 kB - -
@sentry/node 129.82 kB +0.02% +21 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.83 kB - -
@sentry/node - without tracing 89.62 kB +0.04% +34 B 🔺
@sentry/node - without channel injection 108.7 kB +0.02% +21 B 🔺
@sentry/aws-serverless 97.83 kB +0.02% +19 B 🔺
@sentry/cloudflare (withSentry) - minified 203.21 kB - -
@sentry/cloudflare (withSentry) 505.9 kB - -

View base workflow run

All reactions

Sorry, something went wrong.

Uh oh!

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

@s1gr1d
s1gr1d requested a review from chargome September 10, 2026 13:08
@s1gr1d

s1gr1d commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

bugbot run

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

cursor[bot]
cursor Bot reviewed Sep 10, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

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

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.

Stale Bugbot comment from a previous run.

Sorry, something went wrong.

Uh oh!

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

All reactions
@s1gr1d
upgrade sentry-conventions
421ed43
@s1gr1d
s1gr1d requested review from a team as code owners September 11, 2026 08:04
@s1gr1d
s1gr1d requested review from JPeer264 and logaretm and removed request for a team September 11, 2026 08:04
chargome
chargome approved these changes Sep 11, 2026
View reviewed changes

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

Nice!

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread packages/nextjs/src/server/index.ts Resolved

Uh oh!

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

s1gr1d added 2 commits September 11, 2026 13:36
@s1gr1d
improve tests
0a7a61b
@s1gr1d
integration improvements and only enabled with spans
62db407
@s1gr1d

s1gr1d commented Sep 11, 2026

Copy link
Copy Markdown
Member Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

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

cursor[bot]
cursor Bot reviewed Sep 11, 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.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 62db407. Configure here.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread packages/nextjs/src/server/index.ts Resolved

Uh oh!

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

Comment thread packages/nextjs/src/server/useCacheInstrumentation.ts Resolved

Uh oh!

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

sentry[bot]
sentry Bot reviewed Sep 11, 2026
View reviewed changes
Comment thread packages/nextjs/src/server/useCacheInstrumentation.ts Resolved

Uh oh!

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

@s1gr1d
move hasSpansEnabled gate into instrumentation setup
7fcd925
Base automatically changed from sig/nextjs-use-cache-tests to develop September 11, 2026 12:21
s1gr1d added 2 commits September 11, 2026 14:23
@s1gr1d
improve test comment (dev)
acf0483
@s1gr1d
Merge branch 'develop' into sig/nextjs-use-cache-instrument
9b50f47
@s1gr1d
s1gr1d merged commit 4977731 into develop Sep 11, 2026
86 checks passed

Uh oh!

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

@s1gr1d
s1gr1d deleted the sig/nextjs-use-cache-instrument branch September 11, 2026 14:04
This was referenced Sep 16, 2026
publish: getsentry/[email protected] getsentry/publish#9545
Closed
publish: getsentry/[email protected] getsentry/publish#9615
Closed
@github-actions github-actions Bot mentioned this pull request Sep 23, 2026
use cache data-cache spans: instrument the cache-handler registry #24289
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

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

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

use cache data-cache spans: instrument the cache-handler registry

Uh oh!

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

2 participants

@s1gr1d @chargome
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.