Visitar URL original
feat(browser): Extract resource spans into `resourcesIntegration` by logaretm · Pull Request #26276 · getsentry/sentry-javascript · GitHub
Skip to content

feat(browser): Extract resource spans into resourcesIntegration - #26276

Draft
logaretm wants to merge 1 commit into
awad/fetch-tracing-integrationfrom
awad/resources-integration
Draft

logaretm wants to merge 1 commit into
awad/fetch-tracing-integrationfrom
awad/resources-integration

Conversation

@logaretm

Copy link
Copy Markdown
Member

Resource spans were always bundled with browser tracing. This PR moves them into resourcesIntegration, which browserTracingIntegration registers by default.

I added tests that it only adds resource spans to pageload and navigation spans, and that browserTracingIntegration registers it.

resourcesIntegration adds ~1 KB gzip on top of browserTracingCoreIntegration.

import { init, browserTracingCoreIntegration, resourcesIntegration } from '@sentry/browser';

init({
  integrations: [browserTracingCoreIntegration(), resourcesIntegration()],
});

`browserTracingIntegration` registers it by default, so nothing changes for its users. `browserTracingCoreIntegration` users only bundle it when they add it.
@logaretm
logaretm added this pull request to stack #26263 November 11, 2026 10:11
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: dae5171 (PR test merge using awad/fetch-tracing-integration at 9df3ae2)

Against: 9face8a (awad/fetch-tracing-integration) · base run #65603

⚠️ Baseline mismatch: 5 awad/fetch-tracing-integration commit(s) in the PR build are missing from the baseline. Their size changes also affect this comparison. Compare commits. Re-run once awad/fetch-tracing-integration's baseline build for 9df3ae2 finishes.

Path Size % Change Change
@sentry/browser 29.92 kB - -
@sentry/browser - with treeshaking flags 28.08 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.97 kB - -
@sentry/browser (incl. Tracing) 52.6 kB +0.6% +311 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 52.61 kB +0.6% +309 B 🔺
@sentry/browser (incl. Tracing, Profiling) 55.51 kB +0.42% +231 B 🔺
@sentry/browser (incl. Tracing, Replay) 92.55 kB -0.17% -150 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.23 kB -0.17% -137 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 97.26 kB -0.18% -173 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 110.09 kB -0.31% -334 B 🔽
@sentry/browser (incl. Feedback) 47.52 kB - -
@sentry/browser (incl. sendFeedback) 35.02 kB - -
@sentry/browser (incl. FeedbackAsync) 40.13 kB - -
@sentry/browser (incl. Metrics) 31.48 kB - -
@sentry/browser (incl. Logs) 31.77 kB - -
@sentry/browser (incl. Metrics & Logs) 32.45 kB - -
@sentry/react 31.78 kB - -
@sentry/react (incl. Tracing) 54.99 kB +0.43% +235 B 🔺
@sentry/vue 38.33 kB - -
@sentry/vue (incl. Tracing) 55.66 kB +0.59% +321 B 🔺
@sentry/svelte 29.95 kB - -
@sentry/remix (Remix 3 client bundle) 58.21 kB +0.51% +290 B 🔺
CDN Bundle 31.72 kB - -
CDN Bundle (incl. Tracing) 53.12 kB +0.44% +228 B 🔺
CDN Bundle (incl. Logs, Metrics) 34.52 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.69 kB +0.54% +294 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 76 kB - -
CDN Bundle (incl. Tracing, Replay) 91.39 kB +0.24% +216 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 94.01 kB +0.31% +288 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 97.56 kB +0.28% +270 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 100.11 kB +0.23% +222 B 🔺
CDN Bundle - uncompressed 92.76 kB - -
CDN Bundle (incl. Tracing) - uncompressed 157.15 kB +0.73% +1.13 kB 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 101.29 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 164.93 kB +0.7% +1.13 kB 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 233.18 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 279.17 kB +0.41% +1.13 kB 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 286.94 kB +0.4% +1.13 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 292.88 kB +0.39% +1.13 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 300.63 kB +0.38% +1.13 kB 🔺
@sentry/nextjs (client) 58.02 kB +0.51% +291 B 🔺
@sentry/sveltekit (client) 53.1 kB +0.53% +275 B 🔺
@sentry/core/server 44.39 kB - -
@sentry/core/browser 14.02 kB - -
@sentry/node 157.65 kB +0.01% +14 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.31 kB - -
@sentry/node - without tracing 97.23 kB +0.02% +18 B 🔺
@sentry/node - without channel injection 137.97 kB +0.02% +20 B 🔺
@sentry/aws-serverless 106.08 kB +0.03% +24 B 🔺
@sentry/cloudflare (withSentry) - minified 203.81 kB - -
@sentry/cloudflare (withSentry) 506.45 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 225.49 kB - -
@sentry/browser (incl. Tracing Core) 40.18 kB added added

View base workflow run

@github-actions

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 2 not successful, 24 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Failing after 45s Details
❌ CI: Optional E2E Tests / E2E nextjs-16-cacheComponents (cloudflare) Test (optional) Failing after 10m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-cloudflare Test (optional) Successful in 31s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E astro-7-static 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 nuxt-5 (tunnel-dev) Test (optional) Successful in 51s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) Successful in 2m Details

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.

1 participant