Skip to content

Conversation

@BYK
Copy link
Member

@BYK BYK commented Nov 13, 2025

Implements full Spotlight spec with support for multiple framework-specific
environment variable prefixes. Adds defensive environment variable access
for both process.env and import.meta.env to support various bundlers.

Supported environment variables (in priority order):

  • SENTRY_SPOTLIGHT (base/official)
  • PUBLIC_SENTRY_SPOTLIGHT (SvelteKit, Astro, Qwik)
  • NEXT_PUBLIC_SENTRY_SPOTLIGHT (Next.js)
  • VITE_SENTRY_SPOTLIGHT (Vite)
  • NUXT_PUBLIC_SENTRY_SPOTLIGHT (Nuxt)
  • REACT_APP_SENTRY_SPOTLIGHT (Create React App)
  • VUE_APP_SENTRY_SPOTLIGHT (Vue CLI)
  • GATSBY_SENTRY_SPOTLIGHT (Gatsby)

Refactors envToBool utility from node-core to core package for shared usage.
Adds resolveSpotlightOptions utility to ensure consistent precedence rules
across Browser and Node SDKs.

Includes comprehensive test coverage for all new utilities and integration
tests for environment variable precedence behavior.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 13, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.6 kB - -
@sentry/browser - with treeshaking flags 23.09 kB - -
@sentry/browser (incl. Tracing) 41.26 kB - -
@sentry/browser (incl. Tracing, Profiling) 45.53 kB - -
@sentry/browser (incl. Tracing, Replay) 79.73 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.4 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 84.42 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 96.58 kB - -
@sentry/browser (incl. Feedback) 41.27 kB - -
@sentry/browser (incl. sendFeedback) 29.27 kB - -
@sentry/browser (incl. FeedbackAsync) 34.2 kB - -
@sentry/react 26.29 kB - -
@sentry/react (incl. Tracing) 43.22 kB - -
@sentry/vue 29.09 kB - -
@sentry/vue (incl. Tracing) 43.03 kB - -
@sentry/svelte 24.61 kB - -
CDN Bundle 26.95 kB +0.18% +47 B 🔺
CDN Bundle (incl. Tracing) 41.85 kB +0.11% +45 B 🔺
CDN Bundle (incl. Tracing, Replay) 78.38 kB +0.07% +47 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 83.85 kB +0.06% +43 B 🔺
CDN Bundle - uncompressed 78.92 kB +0.11% +83 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 124.08 kB +0.07% +83 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 240.11 kB +0.04% +83 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 252.87 kB +0.04% +83 B 🔺
@sentry/nextjs (client) 45.34 kB - -
@sentry/sveltekit (client) 41.64 kB - -
@sentry/node-core 50.85 kB -0.02% -7 B 🔽
@sentry/node 158.04 kB +0.01% +1 B 🔺
@sentry/node - without tracing 92.72 kB -0.02% -11 B 🔽
@sentry/aws-serverless 106.48 kB -0.02% -16 B 🔽

View base workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Nov 13, 2025

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,762 - 8,506 +3%
GET With Sentry 1,376 16% 1,283 +7%
GET With Sentry (error only) 6,015 69% 5,918 +2%
POST Baseline 1,199 - 1,171 +2%
POST With Sentry 496 41% 497 -0%
POST With Sentry (error only) 1,046 87% 1,014 +3%
MYSQL Baseline 3,264 - 3,215 +2%
MYSQL With Sentry 454 14% 421 +8%
MYSQL With Sentry (error only) 2,672 82% 2,603 +3%

View base workflow run

…ration

- Add support for multiple framework/bundler-specific environment variables with proper precedence
  - SENTRY_SPOTLIGHT (highest priority - base name, supported natively by many bundlers)
  - PUBLIC_SENTRY_SPOTLIGHT (SvelteKit, Astro, Qwik)
  - NEXT_PUBLIC_SENTRY_SPOTLIGHT (Next.js)
  - VITE_SENTRY_SPOTLIGHT (Vite)
  - NUXT_PUBLIC_SENTRY_SPOTLIGHT (Nuxt.js)
  - REACT_APP_SENTRY_SPOTLIGHT (Create React App)
  - VUE_APP_SENTRY_SPOTLIGHT (Vue CLI)
  - GATSBY_SENTRY_SPOTLIGHT (Gatsby)
- Add defensive environment variable access via process.env (transformed by all major bundlers)
- Move envToBool utility from node-core to core for shared usage
- Add resolveSpotlightOptions utility for consistent precedence rules
- Update node-core and aws-serverless to use shared utilities
- Add comprehensive tests for all new utilities and SDK integration

Note: import.meta.env is intentionally not checked because bundlers only replace static
references (e.g., import.meta.env.VITE_VAR) at build time, not dynamic access. All major
bundlers transform process.env references, making it the universal solution.
@BYK BYK force-pushed the feat/spotlight-environment-variable-support branch from 92ffd33 to 6cb5513 Compare November 13, 2025 22:51
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.

2 participants