Skip to content

ref(core): Drop unused and test-only internal exports - #26744

Open
sentry-junior[bot] wants to merge 4 commits into
developfrom
feat/core-drop-unused-internal-exports
Open

sentry-junior[bot] wants to merge 4 commits into
developfrom
feat/core-drop-unused-internal-exports

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

What

Removes internal exports from @sentry/core that no other package uses:

  • _INTERNAL_captureSerializedLog, _INTERNAL_captureSerializedMetric, _INTERNAL_captureMetric, INTERNAL_getSegmentSpan (from @sentry/core)
  • _INTERNAL_getTunnelPaths (from @sentry/core/server)
  • _INTERNAL_FLAG_BUFFER_SIZE, _INTERNAL_MAX_FLAGS_PER_SPAN (from @sentry/core), which were only imported by the browser and node feature flag integration tests

Why

This is the first step in cleaning up _INTERNAL_-prefixed exports. These exports only add surface area. Each symbol is still exported from its own module, so core keeps using it internally.

The two feature flag constants are now inlined in the integration tests (100 and 10). If the SDK values change, those tests would fail and need updating, which is fine for test fixtures.

_INTERNAL_resetTunnelDefaults is also test-only, but it's a function that tests in several packages call. It can't be inlined, so it stays for now.

via @mydea.

--

View Session [Sentry]

Remove _INTERNAL_captureSerializedLog, _INTERNAL_captureSerializedMetric,
_INTERNAL_captureMetric, INTERNAL_getSegmentSpan, _INTERNAL_getTunnelPaths,
_INTERNAL_FLAG_BUFFER_SIZE and _INTERNAL_MAX_FLAGS_PER_SPAN from the public
entry points. Nothing outside core uses them; the integration tests now
inline the two feature flag constants.

Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: ad873af (PR test merge using develop at 2a131c9)

Against: 2a131c9 (develop) · base run #67474

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

Path Size % Change Change
@sentry/browser 30.26 kB - -
@sentry/browser - with treeshaking flags 28.45 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.33 kB - -
@sentry/browser (incl. Tracing) 52.9 kB - -
@sentry/browser (incl. Tracing Core) 40.32 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.9 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.77 kB - -
@sentry/browser (incl. Tracing, Replay) 92.95 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.78 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.3 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 110.88 kB - -
@sentry/browser (incl. Feedback) 48.2 kB - -
@sentry/browser (incl. sendFeedback) 30.84 kB - -
@sentry/browser (incl. FeedbackAsync) 35.87 kB - -
@sentry/browser (incl. Metrics) 31.58 kB - -
@sentry/browser (incl. Logs) 31.86 kB - -
@sentry/browser (incl. Metrics & Logs) 32.52 kB - -
@sentry/react 32.27 kB - -
@sentry/react (incl. Tracing) 55.49 kB - -
@sentry/vue 38.45 kB - -
@sentry/vue (incl. Tracing) 55.82 kB - -
@sentry/svelte 30.27 kB - -
@sentry/effect (client) 301.05 kB - -
@sentry/effect (client, incl. Tracing) 308.22 kB - -
@sentry/effect (client, incl. Tracing, Logs, Metrics) 311.08 kB - -
@sentry/remix (Remix 3 client bundle) 58.52 kB - -
CDN Bundle 32.19 kB - -
CDN Bundle (incl. Tracing) 53.28 kB - -
CDN Bundle (incl. Logs, Metrics) 34.97 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.84 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 76.05 kB - -
CDN Bundle (incl. Tracing, Replay) 91.2 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.82 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 96.63 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.17 kB - -
CDN Bundle - uncompressed 93.98 kB - -
CDN Bundle (incl. Tracing) - uncompressed 157.52 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 102.32 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 165.14 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 232.55 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 277.79 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 285.42 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 289.72 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 297.34 kB - -
@sentry/nextjs (client) 59.26 kB - -
@sentry/sveltekit (client) 54.15 kB - -
@sentry/core/server 45.72 kB -0.06% -27 B 🔽
@sentry/core/browser 14.41 kB - -
@sentry/node 155.71 kB -0.01% -2 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.46 kB - -
@sentry/node - without tracing 88.94 kB -0.01% -1 B 🔽
@sentry/node - without channel injection 144.65 kB +0.01% +5 B 🔺
@sentry/aws-serverless 99.56 kB -0.01% -5 B 🔽
@sentry/cloudflare (withSentry) - minified 209.05 kB - -
@sentry/cloudflare (withSentry) 485.09 kB - -
@sentry/cloudflare (withSentry, instrumented CommonJS package) - minified 1.04 MB -0.05% -490 B 🔽
@sentry/nextjs/cloudflare (withSentry) - minified 234.28 kB - -

View base workflow run

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 6 not successful, 58 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Failing after 48s Details
❌ CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) Failing after 27s Details
❌ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Failing after 27s Details
❌ CI: Optional E2E Tests / E2E node-openai-decisions Test (optional) Failing after 39s Details
❌ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Failing after 1m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 51s Details
✅ CI: Optional E2E Tests / E2E astro-7 (static trace lifecycle) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E express-5 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 40s Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E express-5 (deno) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-without-tracing-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 47s Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (bun) Test (optional) Successful in 58s Details
✅ CI: Optional E2E Tests / E2E express-5 (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-14-supabase Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 30s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 32s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry (static trace lifecycle) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-eve Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) Successful in 53s Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 40s Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 59s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 (MCP SDK OpenTelemetry) Test (optional) Successful in 28s Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (cloudflare) Test (optional) Successful in 28s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (development) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 58s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel (cloudflare) Test (optional) Successful in 31s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel Test (optional) Successful in 48s Details
✅ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (deno) Test (optional) Successful in 52s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 40s Details
✅ CI: Optional E2E Tests / E2E node-eve (content off) Test (optional) Successful in 56s Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E node-eve (0.x) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (kv-cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-cloudflare Test (optional) Successful in 30s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 32s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E solidstart-2-tunnel Test (optional) Successful in 43s Details

@mydea
mydea marked this pull request as ready for review November 23, 2026 09:41
getSpanDescendants,
getStatusMessage,
getRootSpan,
INTERNAL_getSegmentSpan,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no action required: I think the longterm plan should be to replace getRootSpan with getSegmentSpan. The INTERNAL_ prefix in this case was used to discourage users from using that API because in a streaming world, users shouldn't have to care about the segment span of a span. Not sure if this has aged well enough to keep that strong discouragement, so maybe a getSegmentSpan API is generally fine to have in v12.

@msonnb

msonnb commented Nov 23, 2026

Copy link
Copy Markdown
Member

_INTERNAL_captureSerializedLog, _INTERNAL_captureSerializedMetric, and _INTERNAL_captureMetric are still being used in the Electron SDK. We should probably replace them there first.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants