diff --git a/dev-packages/browser-integration-tests/suites/feedback/attachTo/test.ts b/dev-packages/browser-integration-tests/suites/feedback/attachTo/test.ts index 81c68caa672c..03f18f7d8874 100644 --- a/dev-packages/browser-integration-tests/suites/feedback/attachTo/test.ts +++ b/dev-packages/browser-integration-tests/suites/feedback/attachTo/test.ts @@ -67,7 +67,7 @@ sentryTest('should capture feedback with custom button', async ({ getLocalTestUr name: 'sentry.javascript.browser', packages: expect.anything(), settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, request: { diff --git a/dev-packages/browser-integration-tests/suites/feedback/captureFeedback/test.ts b/dev-packages/browser-integration-tests/suites/feedback/captureFeedback/test.ts index 7f5184e269a2..47792c18faf1 100644 --- a/dev-packages/browser-integration-tests/suites/feedback/captureFeedback/test.ts +++ b/dev-packages/browser-integration-tests/suites/feedback/captureFeedback/test.ts @@ -67,7 +67,7 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => { name: 'sentry.javascript.browser', packages: expect.anything(), settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, request: { diff --git a/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/hasSampling/test.ts b/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/hasSampling/test.ts index f21ad0fbfd63..4807ea395220 100644 --- a/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/hasSampling/test.ts +++ b/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/hasSampling/test.ts @@ -101,7 +101,7 @@ sentryTest('should capture feedback', async ({ forceFlushReplay, getLocalTestUrl name: 'sentry.javascript.browser', packages: expect.anything(), settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, request: { diff --git a/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackCsp/test.ts b/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackCsp/test.ts index 043d39134752..bf3f5cdeb9f3 100644 --- a/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackCsp/test.ts +++ b/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackCsp/test.ts @@ -67,7 +67,7 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => { name: 'sentry.javascript.browser', packages: expect.anything(), settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, request: { diff --git a/dev-packages/browser-integration-tests/suites/integrations/ContextLines/inline/test.ts b/dev-packages/browser-integration-tests/suites/integrations/ContextLines/inline/test.ts index 080dd5d75a50..754f81515e83 100644 --- a/dev-packages/browser-integration-tests/suites/integrations/ContextLines/inline/test.ts +++ b/dev-packages/browser-integration-tests/suites/integrations/ContextLines/inline/test.ts @@ -33,7 +33,7 @@ sentryTest( stacktrace: { frames: [ { - pre_context: ['', '', '', ' ', ' ', ' '], + pre_context: ['', '', ' ', ' ', ' '], context_line: ' ', post_context: [ diff --git a/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts b/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts index 7eb24001ecd5..991d63f09932 100644 --- a/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts +++ b/dev-packages/browser-integration-tests/suites/integrations/ContextLines/scriptTag/test.ts @@ -35,8 +35,6 @@ sentryTest( { lineno: 12, pre_context: [ - ' ', @@ -45,7 +43,7 @@ sentryTest( ], context_line: ' ', post_context: [ - expect.stringContaining('', ' ', '', '', @@ -55,7 +53,6 @@ sentryTest( { lineno: 7, pre_context: [ - '', '', '', ' ', @@ -69,8 +66,6 @@ sentryTest( ' ', ' ', ' ', - expect.stringContaining('Some text...', ], }, ], diff --git a/dev-packages/browser-integration-tests/suites/integrations/supabase/db-operations/init.js b/dev-packages/browser-integration-tests/suites/integrations/supabase/db-operations/init.js index b3b48979f1e0..1e93dfea4606 100644 --- a/dev-packages/browser-integration-tests/suites/integrations/supabase/db-operations/init.js +++ b/dev-packages/browser-integration-tests/suites/integrations/supabase/db-operations/init.js @@ -10,7 +10,6 @@ Sentry.init({ dsn: 'https://public@dsn.ingest.sentry.io/1337', integrations: [Sentry.browserTracingIntegration(), Sentry.supabaseIntegration({ supabaseClient })], tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }); // Simulate database operations diff --git a/dev-packages/browser-integration-tests/suites/manual-client/browser-context/test.ts b/dev-packages/browser-integration-tests/suites/manual-client/browser-context/test.ts index bb963a975049..08230c7a4bfd 100644 --- a/dev-packages/browser-integration-tests/suites/manual-client/browser-context/test.ts +++ b/dev-packages/browser-integration-tests/suites/manual-client/browser-context/test.ts @@ -42,7 +42,7 @@ sentryTest('allows to setup a client manually & capture exceptions', async ({ ge version: expect.any(String), packages: [{ name: expect.any(String), version: expect.any(String) }], settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, contexts: { diff --git a/dev-packages/browser-integration-tests/suites/public-api/captureException/simpleError/test.ts b/dev-packages/browser-integration-tests/suites/public-api/captureException/simpleError/test.ts index e8474472af35..d8fb041085cf 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/captureException/simpleError/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/captureException/simpleError/test.ts @@ -40,7 +40,7 @@ sentryTest('should capture correct SDK metadata', async ({ getLocalTestUrl, page }, ], settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }); }); diff --git a/dev-packages/browser-integration-tests/suites/public-api/dataCollection/errors/test.ts b/dev-packages/browser-integration-tests/suites/public-api/dataCollection/errors/test.ts index 3cff0488be65..27ba53fb0078 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/dataCollection/errors/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/dataCollection/errors/test.ts @@ -2,11 +2,8 @@ import { expect } from '@playwright/test'; import { sentryTest } from '../../../../utils/fixtures'; import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers'; -sentryTest( - 'sets sdk.settings.infer_ip to "auto" on errors when dataCollection.userInfo: true', - async ({ getLocalTestUrl, page }) => { - const url = await getLocalTestUrl({ testDir: __dirname }); - const eventData = await envelopeRequestParser(await waitForErrorRequestOnUrl(page, url)); - expect(eventData.sdk?.settings?.infer_ip).toBe('auto'); - }, -); +sentryTest('sets sdk.settings.infer_ip to "auto" on errors by default', async ({ getLocalTestUrl, page }) => { + const url = await getLocalTestUrl({ testDir: __dirname }); + const eventData = await envelopeRequestParser(await waitForErrorRequestOnUrl(page, url)); + expect(eventData.sdk?.settings?.infer_ip).toBe('auto'); +}); diff --git a/dev-packages/browser-integration-tests/suites/public-api/dataCollection/init.js b/dev-packages/browser-integration-tests/suites/public-api/dataCollection/init.js index 262278a96ee1..bd0421b32761 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/dataCollection/init.js +++ b/dev-packages/browser-integration-tests/suites/public-api/dataCollection/init.js @@ -6,5 +6,4 @@ Sentry.init({ traceLifecycle: 'static', dsn: 'https://public@dsn.ingest.sentry.io/1337', tracesSampleRate: 1, - dataCollection: { userInfo: true }, }); diff --git a/dev-packages/browser-integration-tests/suites/public-api/dataCollection/performance/test.ts b/dev-packages/browser-integration-tests/suites/public-api/dataCollection/performance/test.ts index d692b4cfd91b..7d048c9e9b48 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/dataCollection/performance/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/dataCollection/performance/test.ts @@ -6,16 +6,13 @@ import { waitForTransactionRequestOnUrl, } from '../../../../utils/helpers'; -sentryTest( - 'sets user.ip_address to "auto" on transactions when dataCollection.userInfo: true', - async ({ getLocalTestUrl, page }) => { - if (shouldSkipTracingTest()) { - sentryTest.skip(); - } +sentryTest('sets user.ip_address to "auto" on transactions by default', async ({ getLocalTestUrl, page }) => { + if (shouldSkipTracingTest()) { + sentryTest.skip(); + } - const url = await getLocalTestUrl({ testDir: __dirname }); - const req = await waitForTransactionRequestOnUrl(page, url); - const transaction = envelopeRequestParser(req); - expect(transaction.sdk?.settings?.infer_ip).toBe('auto'); - }, -); + const url = await getLocalTestUrl({ testDir: __dirname }); + const req = await waitForTransactionRequestOnUrl(page, url); + const transaction = envelopeRequestParser(req); + expect(transaction.sdk?.settings?.infer_ip).toBe('auto'); +}); diff --git a/dev-packages/browser-integration-tests/suites/public-api/dataCollection/replay/init.js b/dev-packages/browser-integration-tests/suites/public-api/dataCollection/replay/init.js index 2da79b2d7e7f..687dd524d917 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/dataCollection/replay/init.js +++ b/dev-packages/browser-integration-tests/suites/public-api/dataCollection/replay/init.js @@ -17,5 +17,4 @@ Sentry.init({ replaysSessionSampleRate: 1.0, replaysOnErrorSampleRate: 0.0, integrations: [window.Replay], - dataCollection: { userInfo: true }, }); diff --git a/dev-packages/browser-integration-tests/suites/public-api/dataCollection/replay/test.ts b/dev-packages/browser-integration-tests/suites/public-api/dataCollection/replay/test.ts index d000822fed03..401dbbafef66 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/dataCollection/replay/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/dataCollection/replay/test.ts @@ -3,7 +3,7 @@ import { sentryTest } from '../../../../utils/fixtures'; import { getReplayEvent, shouldSkipReplayTest, waitForReplayRequest } from '../../../../utils/replayHelpers'; sentryTest( - 'sets sdk.settings.infer_ip to "auto" on replay events when dataCollection.userInfo: true', + 'sets sdk.settings.infer_ip to "auto" on replay events by default', async ({ getLocalTestUrl, page, browserName }) => { // We only test this against the NPM package and replay bundles // and only on chromium as most performance entries are only available in chromium diff --git a/dev-packages/browser-integration-tests/suites/public-api/dataCollection/sessions/init.js b/dev-packages/browser-integration-tests/suites/public-api/dataCollection/sessions/init.js index cc8ee8dd2a48..596d13f7af7b 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/dataCollection/sessions/init.js +++ b/dev-packages/browser-integration-tests/suites/public-api/dataCollection/sessions/init.js @@ -5,6 +5,5 @@ window.Sentry = Sentry; Sentry.init({ traceLifecycle: 'static', dsn: 'https://public@dsn.ingest.sentry.io/1337', - dataCollection: { userInfo: true }, release: '1.0', }); diff --git a/dev-packages/browser-integration-tests/suites/public-api/dataCollection/sessions/test.ts b/dev-packages/browser-integration-tests/suites/public-api/dataCollection/sessions/test.ts index 5a3d7e41d814..f8b8e01f18e9 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/dataCollection/sessions/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/dataCollection/sessions/test.ts @@ -2,11 +2,8 @@ import { expect } from '@playwright/test'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; -sentryTest( - 'sets attrs.ip_address user to {{auto}} on sessions when dataCollection.userInfo: true', - async ({ getLocalTestUrl, page }) => { - const url = await getLocalTestUrl({ testDir: __dirname }); - const session = await getFirstSentryEnvelopeRequest(page, url); - expect((session as any).attrs.ip_address).toBe('{{auto}}'); - }, -); +sentryTest('sets attrs.ip_address user to {{auto}} on sessions by default', async ({ getLocalTestUrl, page }) => { + const url = await getLocalTestUrl({ testDir: __dirname }); + const session = await getFirstSentryEnvelopeRequest(page, url); + expect((session as any).attrs.ip_address).toBe('{{auto}}'); +}); diff --git a/dev-packages/browser-integration-tests/suites/public-api/logger/integration/test.ts b/dev-packages/browser-integration-tests/suites/public-api/logger/integration/test.ts index f16fc7170120..67e267f1bc9f 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/logger/integration/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/logger/integration/test.ts @@ -24,7 +24,7 @@ sentryTest('should capture console object calls', async ({ getLocalTestUrl, page }, { version: 2, - ingest_settings: { infer_ip: 'never', infer_user_agent: 'never' }, + ingest_settings: { infer_ip: 'auto', infer_user_agent: 'auto' }, items: [ { timestamp: expect.any(Number), diff --git a/dev-packages/browser-integration-tests/suites/public-api/logger/scopeAttributes/test.ts b/dev-packages/browser-integration-tests/suites/public-api/logger/scopeAttributes/test.ts index 5c3e4c7d2ec8..6b57b5896456 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/logger/scopeAttributes/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/logger/scopeAttributes/test.ts @@ -23,7 +23,7 @@ sentryTest('captures logs with scope attributes', async ({ getLocalTestUrl, page }, { version: 2, - ingest_settings: { infer_ip: 'never', infer_user_agent: 'never' }, + ingest_settings: { infer_ip: 'auto', infer_user_agent: 'auto' }, items: [ { timestamp: expect.any(Number), diff --git a/dev-packages/browser-integration-tests/suites/public-api/logger/simple/test.ts b/dev-packages/browser-integration-tests/suites/public-api/logger/simple/test.ts index 0a464d896c5d..e50cb7c84709 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/logger/simple/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/logger/simple/test.ts @@ -24,7 +24,7 @@ sentryTest('should capture all logging methods', async ({ getLocalTestUrl, page }, { version: 2, - ingest_settings: { infer_ip: 'never', infer_user_agent: 'never' }, + ingest_settings: { infer_ip: 'auto', infer_user_agent: 'auto' }, items: [ { timestamp: expect.any(Number), diff --git a/dev-packages/browser-integration-tests/suites/public-api/metrics/simple/test.ts b/dev-packages/browser-integration-tests/suites/public-api/metrics/simple/test.ts index a50d6c8b2b78..2cc5e0b461d0 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/metrics/simple/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/metrics/simple/test.ts @@ -28,7 +28,7 @@ sentryTest('should capture all metric types', async ({ getLocalTestUrl, page }) }, { version: 2, - ingest_settings: { infer_ip: 'never', infer_user_agent: 'never' }, + ingest_settings: { infer_ip: 'auto', infer_user_agent: 'auto' }, items: [ { timestamp: expect.any(Number), diff --git a/dev-packages/browser-integration-tests/suites/public-api/setUser/init.js b/dev-packages/browser-integration-tests/suites/public-api/setUser/init.js index bf5f5ae32c4f..d9c534b801cd 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/setUser/init.js +++ b/dev-packages/browser-integration-tests/suites/public-api/setUser/init.js @@ -5,5 +5,4 @@ window.Sentry = Sentry; Sentry.init({ traceLifecycle: 'static', dsn: 'https://public@dsn.ingest.sentry.io/1337', - dataCollection: { userInfo: true }, }); diff --git a/dev-packages/browser-integration-tests/suites/public-api/setUser/unset_user/test.ts b/dev-packages/browser-integration-tests/suites/public-api/setUser/unset_user/test.ts index f3aa1eb1a4a7..42101d30f97b 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/setUser/unset_user/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/setUser/unset_user/test.ts @@ -10,7 +10,7 @@ sentryTest('should unset user', async ({ getLocalTestUrl, page }) => { expect(eventData[0].message).toBe('no_user'); - // because dataCollection.userInfo: true + // because user info is collected by default expect(eventData[0].sdk?.settings?.infer_ip).toBe('auto'); expect(eventData[1].message).toBe('user'); @@ -22,6 +22,6 @@ sentryTest('should unset user', async ({ getLocalTestUrl, page }) => { expect(eventData[2].message).toBe('unset_user'); - // because dataCollection.userInfo: true + // because user info is collected by default expect(eventData[2].sdk?.settings?.infer_ip).toBe('auto'); }); diff --git a/dev-packages/browser-integration-tests/suites/public-api/startSpan/streamed/test.ts b/dev-packages/browser-integration-tests/suites/public-api/startSpan/streamed/test.ts index 8aacd9528d57..c056f1846f11 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/startSpan/streamed/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/startSpan/streamed/test.ts @@ -63,7 +63,7 @@ sentryTest( { content_type: 'application/vnd.sentry.items.span.v2+json', item_count: 4, type: 'span' }, { version: 2, - ingest_settings: { infer_ip: 'never', infer_user_agent: 'never' }, + ingest_settings: { infer_ip: 'auto', infer_user_agent: 'auto' }, items: expect.any(Array), }, ], diff --git a/dev-packages/browser-integration-tests/suites/public-api/withScope/init.js b/dev-packages/browser-integration-tests/suites/public-api/withScope/init.js index bf5f5ae32c4f..d9c534b801cd 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/withScope/init.js +++ b/dev-packages/browser-integration-tests/suites/public-api/withScope/init.js @@ -5,5 +5,4 @@ window.Sentry = Sentry; Sentry.init({ traceLifecycle: 'static', dsn: 'https://public@dsn.ingest.sentry.io/1337', - dataCollection: { userInfo: true }, }); diff --git a/dev-packages/browser-integration-tests/suites/replay/captureReplay/test.ts b/dev-packages/browser-integration-tests/suites/replay/captureReplay/test.ts index 92634cf92b5a..cab26f93b771 100644 --- a/dev-packages/browser-integration-tests/suites/replay/captureReplay/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/captureReplay/test.ts @@ -56,7 +56,7 @@ sentryTest('should capture replays (@sentry/browser export)', async ({ getLocalT version: SDK_VERSION, name: 'sentry.javascript.browser', settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, request: { @@ -105,7 +105,7 @@ sentryTest('should capture replays (@sentry/browser export)', async ({ getLocalT version: SDK_VERSION, name: 'sentry.javascript.browser', settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, request: { diff --git a/dev-packages/browser-integration-tests/suites/replay/captureReplayFromReplayPackage/test.ts b/dev-packages/browser-integration-tests/suites/replay/captureReplayFromReplayPackage/test.ts index 05b419bf9636..6e258d77bf7b 100644 --- a/dev-packages/browser-integration-tests/suites/replay/captureReplayFromReplayPackage/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/captureReplayFromReplayPackage/test.ts @@ -56,7 +56,7 @@ sentryTest('should capture replays (@sentry/replay export)', async ({ getLocalTe version: SDK_VERSION, name: 'sentry.javascript.browser', settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, request: { @@ -105,7 +105,7 @@ sentryTest('should capture replays (@sentry/replay export)', async ({ getLocalTe version: SDK_VERSION, name: 'sentry.javascript.browser', settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, request: { diff --git a/dev-packages/browser-integration-tests/suites/sessions/initial-scope/test.ts b/dev-packages/browser-integration-tests/suites/sessions/initial-scope/test.ts index c7bb2c571f2d..1ee98375505d 100644 --- a/dev-packages/browser-integration-tests/suites/sessions/initial-scope/test.ts +++ b/dev-packages/browser-integration-tests/suites/sessions/initial-scope/test.ts @@ -13,6 +13,7 @@ sentryTest('starts a new session on pageload.', async ({ getLocalTestUrl, page } expect(session).toEqual({ attrs: { environment: 'production', + ip_address: '{{auto}}', release: '0.1', user_agent: expect.any(String), }, diff --git a/dev-packages/browser-integration-tests/suites/sessions/page-lifecycle/test.ts b/dev-packages/browser-integration-tests/suites/sessions/page-lifecycle/test.ts index 03d4491f90ef..b328ca19c88c 100644 --- a/dev-packages/browser-integration-tests/suites/sessions/page-lifecycle/test.ts +++ b/dev-packages/browser-integration-tests/suites/sessions/page-lifecycle/test.ts @@ -19,6 +19,7 @@ sentryTest('starts a session on pageload with page lifecycle (default).', async expect(session).toEqual({ attrs: { environment: 'production', + ip_address: '{{auto}}', release: '0.1', user_agent: expect.any(String), }, diff --git a/dev-packages/browser-integration-tests/suites/sessions/user/test.ts b/dev-packages/browser-integration-tests/suites/sessions/user/test.ts index d4022e4c0614..daf5e8623fdd 100644 --- a/dev-packages/browser-integration-tests/suites/sessions/user/test.ts +++ b/dev-packages/browser-integration-tests/suites/sessions/user/test.ts @@ -15,6 +15,7 @@ sentryTest('updates the session when the user is set after the initial session', expect(initialSession).toEqual({ attrs: { environment: 'production', + ip_address: '{{auto}}', release: '0.1', user_agent: expect.any(String), }, @@ -78,6 +79,7 @@ sentryTest('includes the user id in the subsequent session', async ({ getLocalTe expect(initialSession).toEqual({ attrs: { environment: 'production', + ip_address: '{{auto}}', release: '0.1', user_agent: expect.any(String), }, diff --git a/dev-packages/browser-integration-tests/utils/replayEventTemplates.ts b/dev-packages/browser-integration-tests/utils/replayEventTemplates.ts index 6f6ba2136ea8..10a5f1b2ccb1 100644 --- a/dev-packages/browser-integration-tests/utils/replayEventTemplates.ts +++ b/dev-packages/browser-integration-tests/utils/replayEventTemplates.ts @@ -40,7 +40,7 @@ const DEFAULT_REPLAY_EVENT = { version: SDK_VERSION, name: 'sentry.javascript.browser', settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, request: { diff --git a/dev-packages/cloudflare-integration-tests/expect.ts b/dev-packages/cloudflare-integration-tests/expect.ts index 9931fd30c6a8..71eb5c9963c4 100644 --- a/dev-packages/cloudflare-integration-tests/expect.ts +++ b/dev-packages/cloudflare-integration-tests/expect.ts @@ -54,6 +54,7 @@ export function expectedEvent(event: Event, { sdk }: { sdk: 'cloudflare' | 'hono environment: 'production', platform: 'javascript', sdk: getSdk(sdk), + user: { ip_address: '127.0.0.1' }, ...event, contexts: defaultContexts(event.contexts), }); diff --git a/dev-packages/cloudflare-integration-tests/suites/public-api/startSpan-streamed/test.ts b/dev-packages/cloudflare-integration-tests/suites/public-api/startSpan-streamed/test.ts index cd900f6b2a43..b106a4236344 100644 --- a/dev-packages/cloudflare-integration-tests/suites/public-api/startSpan-streamed/test.ts +++ b/dev-packages/cloudflare-integration-tests/suites/public-api/startSpan-streamed/test.ts @@ -240,7 +240,11 @@ it('sends a streamed span envelope with correct spans for a manually started spa }, 'http.request.header.cf_connecting_ip': { type: 'string', - value: '[Filtered]', + value: '127.0.0.1', + }, + 'user.ip_address': { + type: 'string', + value: '127.0.0.1', }, 'http.request.header.host': { type: 'string', diff --git a/dev-packages/e2e-tests/test-applications/cloudflare-agent/tests/callable.test.ts b/dev-packages/e2e-tests/test-applications/cloudflare-agent/tests/callable.test.ts index 0146f4e8724f..f7bb956d97b4 100644 --- a/dev-packages/e2e-tests/test-applications/cloudflare-agent/tests/callable.test.ts +++ b/dev-packages/e2e-tests/test-applications/cloudflare-agent/tests/callable.test.ts @@ -57,6 +57,9 @@ test('@callable() methods work correctly with Sentry instrumentAgentWithSentry', platform: 'javascript', event_id: expect.stringMatching(/[a-f0-9]{32}/), environment: expect.any(String), + user: { + ip_address: '127.0.0.1', + }, release: expect.any(String), sdk: { integrations: expect.any(Array), diff --git a/dev-packages/e2e-tests/test-applications/cloudflare-local-workers/src/index.ts b/dev-packages/e2e-tests/test-applications/cloudflare-local-workers/src/index.ts index 827e60b65eae..6c7c86bd0c3b 100644 --- a/dev-packages/e2e-tests/test-applications/cloudflare-local-workers/src/index.ts +++ b/dev-packages/e2e-tests/test-applications/cloudflare-local-workers/src/index.ts @@ -27,7 +27,6 @@ export const MyDurableObject = Sentry.instrumentDurableObjectWithSentry( environment: 'qa', // dynamic sampling bias to keep transactions tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }), MyDurableObjectBase, ); @@ -39,7 +38,6 @@ export default Sentry.withSentry( environment: 'qa', // dynamic sampling bias to keep transactions tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }), { async fetch(request, env) { diff --git a/dev-packages/e2e-tests/test-applications/cloudflare-mcp-agent/src/index.ts b/dev-packages/e2e-tests/test-applications/cloudflare-mcp-agent/src/index.ts index cf15a2cdc008..8687e9e9d80d 100644 --- a/dev-packages/e2e-tests/test-applications/cloudflare-mcp-agent/src/index.ts +++ b/dev-packages/e2e-tests/test-applications/cloudflare-mcp-agent/src/index.ts @@ -54,7 +54,6 @@ export const MyMCPAgent = Sentry.instrumentDurableObjectWithSentry( environment: 'qa', tunnel: `http://localhost:3031/`, tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, debug: true, transportOptions: { bufferSize: 1000, @@ -70,7 +69,6 @@ export default Sentry.withSentry( environment: 'qa', tunnel: `http://localhost:3031/`, tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, debug: true, transportOptions: { bufferSize: 1000, diff --git a/dev-packages/e2e-tests/test-applications/cloudflare-mcp/src/index.ts b/dev-packages/e2e-tests/test-applications/cloudflare-mcp/src/index.ts index c715346306eb..598d7a759b02 100644 --- a/dev-packages/e2e-tests/test-applications/cloudflare-mcp/src/index.ts +++ b/dev-packages/e2e-tests/test-applications/cloudflare-mcp/src/index.ts @@ -22,7 +22,6 @@ export default Sentry.withSentry( environment: 'qa', // dynamic sampling bias to keep transactions tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, debug: true, transportOptions: { // We are doing a lot of events at once in this test diff --git a/dev-packages/e2e-tests/test-applications/cloudflare-workers-streaming/src/index.ts b/dev-packages/e2e-tests/test-applications/cloudflare-workers-streaming/src/index.ts index e5c5c6df7aa4..efd4b805647d 100644 --- a/dev-packages/e2e-tests/test-applications/cloudflare-workers-streaming/src/index.ts +++ b/dev-packages/e2e-tests/test-applications/cloudflare-workers-streaming/src/index.ts @@ -81,7 +81,6 @@ export const MyDurableObject = Sentry.instrumentDurableObjectWithSentry( tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, traceLifecycle: 'stream', - dataCollection: { userInfo: true }, transportOptions: { // We are doing a lot of events at once in this test bufferSize: 1000, @@ -98,7 +97,6 @@ export default Sentry.withSentry( tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, traceLifecycle: 'stream', - dataCollection: { userInfo: true }, transportOptions: { // We are doing a lot of events at once in this test bufferSize: 1000, diff --git a/dev-packages/e2e-tests/test-applications/cloudflare-workers/src/index.ts b/dev-packages/e2e-tests/test-applications/cloudflare-workers/src/index.ts index 7705f5ef0721..bc5eec66c8b6 100644 --- a/dev-packages/e2e-tests/test-applications/cloudflare-workers/src/index.ts +++ b/dev-packages/e2e-tests/test-applications/cloudflare-workers/src/index.ts @@ -81,7 +81,6 @@ export const MyDurableObject = Sentry.instrumentDurableObjectWithSentry( environment: 'qa', // dynamic sampling bias to keep transactions tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, transportOptions: { // We are doing a lot of events at once in this test bufferSize: 1000, @@ -98,7 +97,6 @@ export default Sentry.withSentry( environment: 'qa', // dynamic sampling bias to keep transactions tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, transportOptions: { // We are doing a lot of events at once in this test bufferSize: 1000, diff --git a/dev-packages/e2e-tests/test-applications/cloudflare-workersentrypoint/src/index.ts b/dev-packages/e2e-tests/test-applications/cloudflare-workersentrypoint/src/index.ts index 7a3cd63896dc..a5acdfdd7fee 100644 --- a/dev-packages/e2e-tests/test-applications/cloudflare-workersentrypoint/src/index.ts +++ b/dev-packages/e2e-tests/test-applications/cloudflare-workersentrypoint/src/index.ts @@ -68,7 +68,6 @@ export const MyDurableObject = Sentry.instrumentDurableObjectWithSentry( environment: 'qa', // dynamic sampling bias to keep transactions tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, transportOptions: { // We are doing a lot of events at once in this test bufferSize: 1000, @@ -115,7 +114,6 @@ export default Sentry.withSentry( environment: 'qa', // dynamic sampling bias to keep transactions tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, transportOptions: { // We are doing a lot of events at once in this test bufferSize: 1000, diff --git a/dev-packages/e2e-tests/test-applications/deno-streamed/src/app.ts b/dev-packages/e2e-tests/test-applications/deno-streamed/src/app.ts index 5e8b7d123809..b5c6a606b949 100644 --- a/dev-packages/e2e-tests/test-applications/deno-streamed/src/app.ts +++ b/dev-packages/e2e-tests/test-applications/deno-streamed/src/app.ts @@ -21,7 +21,6 @@ Sentry.init({ tunnel: 'http://localhost:3031/', traceLifecycle: 'stream', tracesSampleRate: 1, - dataCollection: { userInfo: true }, }); const port = 3030; diff --git a/dev-packages/e2e-tests/test-applications/deno/src/app.ts b/dev-packages/e2e-tests/test-applications/deno/src/app.ts index 663b62914e51..45da3a4209f8 100644 --- a/dev-packages/e2e-tests/test-applications/deno/src/app.ts +++ b/dev-packages/e2e-tests/test-applications/deno/src/app.ts @@ -24,7 +24,6 @@ Sentry.init({ debug: !!Deno.env.get('DEBUG'), tunnel: 'http://localhost:3031/', tracesSampleRate: 1, - dataCollection: { userInfo: true }, }); const port = 3030; diff --git a/dev-packages/e2e-tests/test-applications/hono-4/src/entry.bun.ts b/dev-packages/e2e-tests/test-applications/hono-4/src/entry.bun.ts index 20026739bc5b..e79fbf71866f 100644 --- a/dev-packages/e2e-tests/test-applications/hono-4/src/entry.bun.ts +++ b/dev-packages/e2e-tests/test-applications/hono-4/src/entry.bun.ts @@ -10,7 +10,6 @@ app.use( dsn: process.env.E2E_TEST_DSN, environment: 'qa', tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, tunnel: 'http://localhost:3031/', }), ); diff --git a/dev-packages/e2e-tests/test-applications/hono-4/src/entry.cloudflare.ts b/dev-packages/e2e-tests/test-applications/hono-4/src/entry.cloudflare.ts index 7eca5f852320..e62a66d14a13 100644 --- a/dev-packages/e2e-tests/test-applications/hono-4/src/entry.cloudflare.ts +++ b/dev-packages/e2e-tests/test-applications/hono-4/src/entry.cloudflare.ts @@ -10,7 +10,6 @@ app.use( dsn: env.E2E_TEST_DSN, environment: 'qa', tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, tunnel: 'http://localhost:3031/', })), ); diff --git a/dev-packages/e2e-tests/test-applications/hono-4/src/instrument.node.ts b/dev-packages/e2e-tests/test-applications/hono-4/src/instrument.node.ts index 68d813d565da..03b74f8ff7c1 100644 --- a/dev-packages/e2e-tests/test-applications/hono-4/src/instrument.node.ts +++ b/dev-packages/e2e-tests/test-applications/hono-4/src/instrument.node.ts @@ -5,6 +5,5 @@ Sentry.init({ dsn: process.env.E2E_TEST_DSN, environment: 'qa', tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, tunnel: 'http://localhost:3031/', }); diff --git a/dev-packages/e2e-tests/test-applications/hydrogen-react-router-7/instrument.server.mjs b/dev-packages/e2e-tests/test-applications/hydrogen-react-router-7/instrument.server.mjs index d32446c964f8..39bcf6e1000b 100644 --- a/dev-packages/e2e-tests/test-applications/hydrogen-react-router-7/instrument.server.mjs +++ b/dev-packages/e2e-tests/test-applications/hydrogen-react-router-7/instrument.server.mjs @@ -4,7 +4,6 @@ Sentry.init({ dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0', // Adds request headers and IP for users, for more info visit: // https://docs.sentry.io/platforms/javascript/guides/react-router/configuration/options/#dataCollection - dataCollection: { userInfo: true }, tracesSampleRate: 1.0, tunnel: `http://localhost:3031/`, // proxy server }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-14/instrumentation-client.ts b/dev-packages/e2e-tests/test-applications/nextjs-14/instrumentation-client.ts index 483eeab426f7..97cc19287aeb 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-14/instrumentation-client.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-14/instrumentation-client.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }); export const onRouterTransitionStart = Sentry.captureRouterTransitionStart; diff --git a/dev-packages/e2e-tests/test-applications/nextjs-14/instrumentation.ts b/dev-packages/e2e-tests/test-applications/nextjs-14/instrumentation.ts index c892d0a37d07..976e1461d1c4 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-14/instrumentation.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-14/instrumentation.ts @@ -8,7 +8,6 @@ export function register() { dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, transportOptions: { // We are doing a lot of events at once in this test bufferSize: 1000, diff --git a/dev-packages/e2e-tests/test-applications/nextjs-15-basepath/instrumentation-client.ts b/dev-packages/e2e-tests/test-applications/nextjs-15-basepath/instrumentation-client.ts index 483eeab426f7..97cc19287aeb 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-15-basepath/instrumentation-client.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-15-basepath/instrumentation-client.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }); export const onRouterTransitionStart = Sentry.captureRouterTransitionStart; diff --git a/dev-packages/e2e-tests/test-applications/nextjs-15-basepath/sentry.edge.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-15-basepath/sentry.edge.config.ts index 66e1d6d26658..490a00cff366 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-15-basepath/sentry.edge.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-15-basepath/sentry.edge.config.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, transportOptions: { // We are doing a lot of events at once in this test bufferSize: 1000, diff --git a/dev-packages/e2e-tests/test-applications/nextjs-15-basepath/sentry.server.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-15-basepath/sentry.server.config.ts index 66e1d6d26658..490a00cff366 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-15-basepath/sentry.server.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-15-basepath/sentry.server.config.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, transportOptions: { // We are doing a lot of events at once in this test bufferSize: 1000, diff --git a/dev-packages/e2e-tests/test-applications/nextjs-15-intl/instrumentation-client.ts b/dev-packages/e2e-tests/test-applications/nextjs-15-intl/instrumentation-client.ts index ca5ee251f8e8..101a053aefc1 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-15-intl/instrumentation-client.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-15-intl/instrumentation-client.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }); export const onRouterTransitionStart = Sentry.captureRouterTransitionStart; diff --git a/dev-packages/e2e-tests/test-applications/nextjs-15-intl/sentry.edge.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-15-intl/sentry.edge.config.ts index 146d35c8e59f..ad18186cb80a 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-15-intl/sentry.edge.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-15-intl/sentry.edge.config.ts @@ -6,5 +6,4 @@ Sentry.init({ dsn: process.env.SENTRY_DSN, tunnel: `http://localhost:3031/`, tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-15-intl/sentry.server.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-15-intl/sentry.server.config.ts index 07272d044d6b..494c476361f1 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-15-intl/sentry.server.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-15-intl/sentry.server.config.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, transportOptions: { bufferSize: 1000, }, diff --git a/dev-packages/e2e-tests/test-applications/nextjs-15/app/ai-test/page.tsx b/dev-packages/e2e-tests/test-applications/nextjs-15/app/ai-test/page.tsx index 632e15b4b535..f0dd971fa642 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-15/app/ai-test/page.tsx +++ b/dev-packages/e2e-tests/test-applications/nextjs-15/app/ai-test/page.tsx @@ -6,7 +6,7 @@ import * as Sentry from '@sentry/nextjs'; export const dynamic = 'force-dynamic'; async function runAITest() { - // First span - telemetry should be enabled automatically but no input/output recorded when dataCollection: { userInfo: true } + // First span - telemetry should be enabled automatically but no input/output recorded by default const result1 = await generateText({ model: new MockLanguageModelV1({ doGenerate: async () => ({ diff --git a/dev-packages/e2e-tests/test-applications/nextjs-15/instrumentation-client.ts b/dev-packages/e2e-tests/test-applications/nextjs-15/instrumentation-client.ts index 483eeab426f7..97cc19287aeb 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-15/instrumentation-client.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-15/instrumentation-client.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }); export const onRouterTransitionStart = Sentry.captureRouterTransitionStart; diff --git a/dev-packages/e2e-tests/test-applications/nextjs-15/sentry.edge.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-15/sentry.edge.config.ts index 6f52d536a9f8..b45f15d46f24 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-15/sentry.edge.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-15/sentry.edge.config.ts @@ -20,7 +20,6 @@ Sentry.init({ return 1.0; }, - dataCollection: { userInfo: true }, transportOptions: { // We are doing a lot of events at once in this test bufferSize: 1000, diff --git a/dev-packages/e2e-tests/test-applications/nextjs-15/sentry.server.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-15/sentry.server.config.ts index d4d1c149eda1..7182b7399e7c 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-15/sentry.server.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-15/sentry.server.config.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, transportOptions: { // We are doing a lot of events at once in this test bufferSize: 1000, diff --git a/dev-packages/e2e-tests/test-applications/nextjs-15/tests/ai-test.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-15/tests/ai-test.test.ts index 4482bfc12adb..36066e978727 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-15/tests/ai-test.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-15/tests/ai-test.test.ts @@ -37,7 +37,7 @@ test.fixme('should create AI spans with correct attributes', async ({ page }) => expect(aiGenerateSpans.length).toBeGreaterThanOrEqual(1); expect(toolCallSpans.length).toBeGreaterThanOrEqual(0); - // First AI call - should have telemetry enabled and record inputs/outputs (dataCollection: { userInfo: true }) + // First AI call - should have telemetry enabled and record inputs/outputs by default /* const firstPipelineSpan = aiPipelineSpans[0]; expect(firstPipelineSpan?.attributes['vercel.ai.model.id']?.value).toBe('mock-model-id'); expect(firstPipelineSpan?.attributes['vercel.ai.model.provider']?.value).toBe('mock-provider'); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-bun/instrumentation-client.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-bun/instrumentation-client.ts index 26472d2e035e..a024284c197b 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-bun/instrumentation-client.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-bun/instrumentation-client.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, integrations: [ Sentry.thirdPartyErrorFilterIntegration({ filterKeys: ['nextjs-16-bun-e2e'], diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-bun/sentry.edge.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-bun/sentry.edge.config.ts index 300ac752cba5..ee00e6481622 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-bun/sentry.edge.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-bun/sentry.edge.config.ts @@ -6,5 +6,4 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-bun/sentry.server.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-bun/sentry.server.config.ts index abf631fb0060..8e509d90b1da 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-bun/sentry.server.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-bun/sentry.server.config.ts @@ -6,6 +6,5 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, tracePropagationTargets: ['http://localhost:3030/propagation/test-outgoing-fetch/check'], }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/instrumentation-client.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/instrumentation-client.ts index 483eeab426f7..97cc19287aeb 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/instrumentation-client.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/instrumentation-client.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }); export const onRouterTransitionStart = Sentry.captureRouterTransitionStart; diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/sentry.edge.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/sentry.edge.config.ts index 1840ec65d483..7233c9208dad 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/sentry.edge.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/sentry.edge.config.ts @@ -6,6 +6,5 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, // debug: true, }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/sentry.server.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/sentry.server.config.ts index c2fcb479a47a..8126dc9b57ac 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/sentry.server.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/sentry.server.config.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, // debug: true, integrations: [Sentry.vercelAIIntegration()], }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/instrumentation-client.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/instrumentation-client.ts index a04c837b6f2c..5fbfb9d3083f 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/instrumentation-client.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/instrumentation-client.ts @@ -7,7 +7,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, // Verify Log type is available beforeSendLog(log: Log) { return log; diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/sentry.edge.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/sentry.edge.config.ts index eb0ae1d8d71b..9880ff53d875 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/sentry.edge.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/sentry.edge.config.ts @@ -15,6 +15,5 @@ Sentry.init({ return 1.0; }, - dataCollection: { userInfo: true }, // debug: true, }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/sentry.server.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/sentry.server.config.ts index 1991634bfb86..2b2baba3b81e 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/sentry.server.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/sentry.server.config.ts @@ -7,7 +7,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, // debug: true, integrations: [Sentry.vercelAIIntegration()], // Verify Log type is available diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/app/ai-test/page.tsx b/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/app/ai-test/page.tsx index 632e15b4b535..f0dd971fa642 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/app/ai-test/page.tsx +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/app/ai-test/page.tsx @@ -6,7 +6,7 @@ import * as Sentry from '@sentry/nextjs'; export const dynamic = 'force-dynamic'; async function runAITest() { - // First span - telemetry should be enabled automatically but no input/output recorded when dataCollection: { userInfo: true } + // First span - telemetry should be enabled automatically but no input/output recorded by default const result1 = await generateText({ model: new MockLanguageModelV1({ doGenerate: async () => ({ diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/instrumentation-client.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/instrumentation-client.ts index e94c472ad110..a2fa4da37b7d 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/instrumentation-client.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/instrumentation-client.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, integrations: [ Sentry.thirdPartyErrorFilterIntegration({ filterKeys: ['nextjs-16-streaming-e2e'], diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/sentry.edge.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/sentry.edge.config.ts index f670bb2ae640..9ace249c414f 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/sentry.edge.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/sentry.edge.config.ts @@ -5,7 +5,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, traceLifecycle: 'stream', integrations: [Sentry.spanStreamingIntegration()], }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/sentry.server.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/sentry.server.config.ts index 924844386908..b31f47abfa96 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/sentry.server.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-streaming/sentry.server.config.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, traceLifecycle: 'stream', integrations: [ Sentry.vercelAIIntegration(), diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-trailing-slash/instrumentation-client.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-trailing-slash/instrumentation-client.ts index 483eeab426f7..97cc19287aeb 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-trailing-slash/instrumentation-client.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-trailing-slash/instrumentation-client.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }); export const onRouterTransitionStart = Sentry.captureRouterTransitionStart; diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-trailing-slash/sentry.edge.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-trailing-slash/sentry.edge.config.ts index 300ac752cba5..ee00e6481622 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-trailing-slash/sentry.edge.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-trailing-slash/sentry.edge.config.ts @@ -6,5 +6,4 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-trailing-slash/sentry.server.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-trailing-slash/sentry.server.config.ts index 300ac752cba5..ee00e6481622 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-trailing-slash/sentry.server.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-trailing-slash/sentry.server.config.ts @@ -6,5 +6,4 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/instrumentation-client.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/instrumentation-client.ts index 145763e4773a..060fd68a8024 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/instrumentation-client.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/instrumentation-client.ts @@ -7,7 +7,6 @@ Sentry.init({ dsn: 'https://public@o12345.ingest.us.sentry.io/67890', // No tunnel option - using tunnelRoute from withSentryConfig tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }); export const onRouterTransitionStart = Sentry.captureRouterTransitionStart; diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/sentry.edge.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/sentry.edge.config.ts index 84dea31ea935..c049a509983e 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/sentry.edge.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/sentry.edge.config.ts @@ -7,6 +7,5 @@ Sentry.init({ dsn: 'https://public@o12345.ingest.us.sentry.io/67890', // No tunnel option - using tunnelRoute from withSentryConfig tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, // debug: true, }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/sentry.server.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/sentry.server.config.ts index 84dea31ea935..c049a509983e 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/sentry.server.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/sentry.server.config.ts @@ -7,6 +7,5 @@ Sentry.init({ dsn: 'https://public@o12345.ingest.us.sentry.io/67890', // No tunnel option - using tunnelRoute from withSentryConfig tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, // debug: true, }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-userfeedback/instrumentation-client.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-userfeedback/instrumentation-client.ts index 3a98f85b6239..116df51984d9 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-userfeedback/instrumentation-client.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-userfeedback/instrumentation-client.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, integrations: [ Sentry.replayIntegration(), Sentry.feedbackIntegration({ diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-userfeedback/sentry.edge.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-userfeedback/sentry.edge.config.ts index d16a59be453e..f9aa41ff3064 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-userfeedback/sentry.edge.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-userfeedback/sentry.edge.config.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, transportOptions: { bufferSize: 1000, }, diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16-userfeedback/sentry.server.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16-userfeedback/sentry.server.config.ts index d16a59be453e..f9aa41ff3064 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16-userfeedback/sentry.server.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16-userfeedback/sentry.server.config.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, transportOptions: { bufferSize: 1000, }, diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16/app/ai-test/page.tsx b/dev-packages/e2e-tests/test-applications/nextjs-16/app/ai-test/page.tsx index 632e15b4b535..f0dd971fa642 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16/app/ai-test/page.tsx +++ b/dev-packages/e2e-tests/test-applications/nextjs-16/app/ai-test/page.tsx @@ -6,7 +6,7 @@ import * as Sentry from '@sentry/nextjs'; export const dynamic = 'force-dynamic'; async function runAITest() { - // First span - telemetry should be enabled automatically but no input/output recorded when dataCollection: { userInfo: true } + // First span - telemetry should be enabled automatically but no input/output recorded by default const result1 = await generateText({ model: new MockLanguageModelV1({ doGenerate: async () => ({ diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16/instrumentation-client.ts b/dev-packages/e2e-tests/test-applications/nextjs-16/instrumentation-client.ts index 053fab6c4666..47ce2790e694 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16/instrumentation-client.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16/instrumentation-client.ts @@ -7,7 +7,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, integrations: [ Sentry.thirdPartyErrorFilterIntegration({ filterKeys: ['nextjs-16-e2e'], diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16/sentry.edge.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16/sentry.edge.config.ts index 1840ec65d483..7233c9208dad 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16/sentry.edge.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16/sentry.edge.config.ts @@ -6,6 +6,5 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, // debug: true, }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16/sentry.server.config.ts b/dev-packages/e2e-tests/test-applications/nextjs-16/sentry.server.config.ts index 28d4bdda4ca1..d8bf4883a137 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16/sentry.server.config.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16/sentry.server.config.ts @@ -7,7 +7,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, // debug: true, integrations: [Sentry.vercelAIIntegration(), Sentry.nodeRuntimeMetricsIntegration({ collectionIntervalMs: 1_000 })], // Verify Log type is available diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16/tests/ai-test.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16/tests/ai-test.test.ts index 930417197316..5d1a8ed277ae 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16/tests/ai-test.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16/tests/ai-test.test.ts @@ -37,7 +37,7 @@ test.fixme('should create AI spans with correct attributes', async ({ page }) => expect(aiGenerateSpans.length).toBeGreaterThanOrEqual(1); expect(toolCallSpans.length).toBeGreaterThanOrEqual(0); - // First AI call - should have telemetry enabled and record inputs/outputs (dataCollection: { userInfo: true }) + // First AI call - should have telemetry enabled and record inputs/outputs by default /* const firstPipelineSpan = aiPipelineSpans[0]; expect(firstPipelineSpan?.attributes['vercel.ai.model.id']?.value).toBe('mock-model-id'); expect(firstPipelineSpan?.attributes['vercel.ai.model.provider']?.value).toBe('mock-provider'); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/instrumentation-client.ts b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/instrumentation-client.ts index 483eeab426f7..97cc19287aeb 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/instrumentation-client.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/instrumentation-client.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }); export const onRouterTransitionStart = Sentry.captureRouterTransitionStart; diff --git a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/instrumentation.ts b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/instrumentation.ts index b90d3be3504a..c2e7ea1b1e2d 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/instrumentation.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/instrumentation.ts @@ -8,7 +8,6 @@ export function register() { dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, transportOptions: { // We are doing a lot of events at once in this test bufferSize: 1000, diff --git a/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/instrumentation-client.ts b/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/instrumentation-client.ts index 483eeab426f7..97cc19287aeb 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/instrumentation-client.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/instrumentation-client.ts @@ -6,7 +6,6 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, }); export const onRouterTransitionStart = Sentry.captureRouterTransitionStart; diff --git a/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/instrumentation.ts b/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/instrumentation.ts index b90d3be3504a..c2e7ea1b1e2d 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/instrumentation.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-pages-dir/instrumentation.ts @@ -8,7 +8,6 @@ export function register() { dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, tunnel: `http://localhost:3031/`, // proxy server tracesSampleRate: 1.0, - dataCollection: { userInfo: true }, transportOptions: { // We are doing a lot of events at once in this test bufferSize: 1000, diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts index 2912f27eec34..11b27509023d 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-3/tests/transactions.test.ts @@ -175,5 +175,5 @@ test('Captures request metadata', async ({ baseURL }) => { }), }); - expect(transactionEvent.user).toEqual(undefined); + expect(transactionEvent.user).toEqual({ ip_address: '::1' }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts index 054193da1a84..662ece5f348a 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-4/tests/transactions.test.ts @@ -147,5 +147,5 @@ test('Captures request metadata', async ({ baseURL }) => { }), }); - expect(transactionEvent.user).toEqual(undefined); + expect(transactionEvent.user).toEqual({ ip_address: '::1' }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts index 6fafa28a162b..ec871f134b42 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/transactions.test.ts @@ -147,5 +147,5 @@ test('Captures request metadata', async ({ baseURL }) => { }), }); - expect(transactionEvent.user).toEqual(undefined); + expect(transactionEvent.user).toEqual({ ip_address: '::1' }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts index e42d821e63d3..0cc2f7d1664d 100644 --- a/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-koa/tests/transactions.test.ts @@ -179,5 +179,5 @@ test('Captures request metadata', async ({ baseURL }) => { }), }); - expect(transactionEvent.user).toEqual(undefined); + expect(transactionEvent.user).toEqual({ ip_address: '::1' }); }); diff --git a/dev-packages/e2e-tests/test-applications/react-17/src/index.tsx b/dev-packages/e2e-tests/test-applications/react-17/src/index.tsx index abd6688c7350..c303ff60fe80 100644 --- a/dev-packages/e2e-tests/test-applications/react-17/src/index.tsx +++ b/dev-packages/e2e-tests/test-applications/react-17/src/index.tsx @@ -39,7 +39,6 @@ Sentry.init({ replaysOnErrorSampleRate: 0.0, tunnel: 'http://localhost:3031', - dataCollection: { userInfo: true }, }); const SentryRoutes = Sentry.withSentryReactRouterV6Routing(Routes); diff --git a/dev-packages/e2e-tests/test-applications/react-router-6/src/index.tsx b/dev-packages/e2e-tests/test-applications/react-router-6/src/index.tsx index 903f2ed53187..d3836730ce39 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-6/src/index.tsx +++ b/dev-packages/e2e-tests/test-applications/react-router-6/src/index.tsx @@ -42,7 +42,6 @@ Sentry.init({ replaysOnErrorSampleRate: 0.0, tunnel: 'http://localhost:3031', - dataCollection: { userInfo: true }, }); const SentryRoutes = Sentry.withSentryReactRouterV6Routing(Routes); diff --git a/dev-packages/e2e-tests/test-applications/react-router-7-spa-streaming/src/main.tsx b/dev-packages/e2e-tests/test-applications/react-router-7-spa-streaming/src/main.tsx index e55bd5f50bf3..b3542ff27301 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-7-spa-streaming/src/main.tsx +++ b/dev-packages/e2e-tests/test-applications/react-router-7-spa-streaming/src/main.tsx @@ -40,7 +40,6 @@ Sentry.init({ replaysSessionSampleRate: 1.0, replaysOnErrorSampleRate: 0.0, tunnel: 'http://localhost:3031', - dataCollection: { userInfo: true }, }); const SentryRoutes = Sentry.withSentryReactRouterV7Routing(Routes); diff --git a/dev-packages/e2e-tests/test-applications/react-router-7-spa/src/main.tsx b/dev-packages/e2e-tests/test-applications/react-router-7-spa/src/main.tsx index 0de47b934838..6c6baad97fc2 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-7-spa/src/main.tsx +++ b/dev-packages/e2e-tests/test-applications/react-router-7-spa/src/main.tsx @@ -41,7 +41,6 @@ Sentry.init({ replaysSessionSampleRate: 1.0, replaysOnErrorSampleRate: 0.0, tunnel: 'http://localhost:3031', - dataCollection: { userInfo: true }, }); const SentryRoutes = Sentry.wrapReactRouterRouting(Routes); diff --git a/dev-packages/e2e-tests/test-applications/react-router-8-spa/src/main.tsx b/dev-packages/e2e-tests/test-applications/react-router-8-spa/src/main.tsx index 0de47b934838..6c6baad97fc2 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-8-spa/src/main.tsx +++ b/dev-packages/e2e-tests/test-applications/react-router-8-spa/src/main.tsx @@ -41,7 +41,6 @@ Sentry.init({ replaysSessionSampleRate: 1.0, replaysOnErrorSampleRate: 0.0, tunnel: 'http://localhost:3031', - dataCollection: { userInfo: true }, }); const SentryRoutes = Sentry.wrapReactRouterRouting(Routes); diff --git a/dev-packages/e2e-tests/test-applications/supabase-nextjs/sentry.edge.config.ts b/dev-packages/e2e-tests/test-applications/supabase-nextjs/sentry.edge.config.ts index 840d81ca60ce..58972d6c07e8 100644 --- a/dev-packages/e2e-tests/test-applications/supabase-nextjs/sentry.edge.config.ts +++ b/dev-packages/e2e-tests/test-applications/supabase-nextjs/sentry.edge.config.ts @@ -8,7 +8,6 @@ Sentry.init({ traceLifecycle: 'static', dsn: 'https://public@dsn.ingest.sentry.io/1337', environment: 'qa', // dynamic sampling bias to keep transactions - dataCollection: { userInfo: true }, tracesSampleRate: 1, tunnel: 'http://localhost:3031/', // proxy server transportOptions: { diff --git a/dev-packages/e2e-tests/test-applications/supabase-nextjs/sentry.server.config.ts b/dev-packages/e2e-tests/test-applications/supabase-nextjs/sentry.server.config.ts index 7d7e395886f3..d5ac22930079 100644 --- a/dev-packages/e2e-tests/test-applications/supabase-nextjs/sentry.server.config.ts +++ b/dev-packages/e2e-tests/test-applications/supabase-nextjs/sentry.server.config.ts @@ -9,7 +9,6 @@ Sentry.init({ dsn: 'https://public@dsn.ingest.sentry.io/1337', environment: 'qa', // dynamic sampling bias to keep transactions tracesSampleRate: 1, - dataCollection: { userInfo: true }, tunnel: 'http://localhost:3031/', // proxy server transportOptions: { // We expect the app to send a lot of events in a short time diff --git a/dev-packages/e2e-tests/test-applications/supabase-nextjs/tests/performance.test.ts b/dev-packages/e2e-tests/test-applications/supabase-nextjs/tests/performance.test.ts index a9e55446a4f1..926073711560 100644 --- a/dev-packages/e2e-tests/test-applications/supabase-nextjs/tests/performance.test.ts +++ b/dev-packages/e2e-tests/test-applications/supabase-nextjs/tests/performance.test.ts @@ -57,9 +57,9 @@ test('Sends client-side Supabase db-operation spans and breadcrumbs to Sentry', const transactionEvent = await pageloadTransactionPromise; - // Client uses default data collection settings (no PII `userInfo`) — URL filters and bodies are not attached to spans/breadcrumbs. - const redactedSelectSpan = expect.objectContaining({ - description: '[redacted] from(todos)', + // Client-side database query data is collected by default. + const selectSpanExpectation = expect.objectContaining({ + description: 'select(*) filter(order, asc) from(todos)', op: 'db', data: expect.objectContaining({ 'db.operation': 'select', @@ -76,26 +76,26 @@ test('Sends client-side Supabase db-operation spans and breadcrumbs to Sentry', origin: 'auto.db.supabase', }); - expect(transactionEvent.spans).toContainEqual(redactedSelectSpan); + expect(transactionEvent.spans).toContainEqual(selectSpanExpectation); const selectSpan = transactionEvent.spans?.find( - (s: { description?: string }) => s.description === '[redacted] from(todos)', + (s: { description?: string }) => s.description === 'select(*) filter(order, asc) from(todos)', ); expect(selectSpan).toBeDefined(); - expect(selectSpan!.data).not.toHaveProperty('db.query'); + expect(selectSpan!.data?.['db.query']).toEqual(['select(*)', 'filter(order, asc)']); expect(transactionEvent.breadcrumbs).toContainEqual({ timestamp: expect.any(Number), type: 'supabase', category: 'db.select', - message: '[redacted] from(todos)', + message: 'select(*) filter(order, asc) from(todos)', }); expect(transactionEvent.breadcrumbs).toContainEqual({ timestamp: expect.any(Number), type: 'supabase', category: 'db.insert', - message: 'insert(...) [redacted] from(todos)', + message: 'insert(...) select(*) from(todos)', }); }); diff --git a/dev-packages/node-integration-tests/suites/express/requestUser/test.ts b/dev-packages/node-integration-tests/suites/express/requestUser/test.ts index 5a6d0237b96a..46b266985321 100644 --- a/dev-packages/node-integration-tests/suites/express/requestUser/test.ts +++ b/dev-packages/node-integration-tests/suites/express/requestUser/test.ts @@ -7,13 +7,13 @@ describe('express user handling', () => { }); createCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createRunner, test) => { - test('ignores user from request', async () => { + test('collects the request IP address by default', async () => { expect.assertions(2); const runner = createRunner() .expect({ event: event => { - expect(event.user).toBeUndefined(); + expect(event.user).toEqual({ ip_address: '::1' }); expect(event.exception?.values?.[0]?.value).toBe('error_1'); }, }) diff --git a/dev-packages/node-integration-tests/suites/public-api/captureException/catched-error/test.ts b/dev-packages/node-integration-tests/suites/public-api/captureException/catched-error/test.ts index 680f4d3b02e6..4d21eca25270 100644 --- a/dev-packages/node-integration-tests/suites/public-api/captureException/catched-error/test.ts +++ b/dev-packages/node-integration-tests/suites/public-api/captureException/catched-error/test.ts @@ -22,15 +22,7 @@ test('should work inside catch block', async () => { frames: expect.arrayContaining([ expect.objectContaining({ context_line: " throw new Error('catched_error');", - pre_context: [ - " traceLifecycle: 'static',", - " dsn: 'https://public@dsn.ingest.sentry.io/1337',", - " release: '1.0',", - ' transport: loggingTransport,', - '});', - '', - 'try {', - ], + pre_context: [" release: '1.0',", ' transport: loggingTransport,', '});', '', 'try {'], post_context: ['} catch (err) {', ' Sentry.captureException(err);', '}'], }), ]), diff --git a/dev-packages/node-integration-tests/suites/public-api/logs/subject.ts b/dev-packages/node-integration-tests/suites/public-api/logs/subject.ts index bb64c10b2bc9..aae3af937a76 100644 --- a/dev-packages/node-integration-tests/suites/public-api/logs/subject.ts +++ b/dev-packages/node-integration-tests/suites/public-api/logs/subject.ts @@ -6,7 +6,6 @@ const client = new Sentry.NodeClient({ transport: loggingTransport, stackParser: Sentry.defaultStackParser, integrations: [], - dataCollection: { userInfo: true }, }); const customScope = new Sentry.Scope(); diff --git a/dev-packages/node-integration-tests/suites/system-error/basic-pii.mjs b/dev-packages/node-integration-tests/suites/system-error/basic-pii.mjs index 005575f98f79..080e8a707c82 100644 --- a/dev-packages/node-integration-tests/suites/system-error/basic-pii.mjs +++ b/dev-packages/node-integration-tests/suites/system-error/basic-pii.mjs @@ -6,7 +6,6 @@ Sentry.init({ traceLifecycle: 'static', dsn: 'https://public@dsn.ingest.sentry.io/1337', transport: loggingTransport, - dataCollection: { userInfo: true }, }); readFileSync('non-existent-file.txt'); diff --git a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument-with-datacollection.mjs b/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument-with-datacollection.mjs deleted file mode 100644 index 4c306a353512..000000000000 --- a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument-with-datacollection.mjs +++ /dev/null @@ -1,13 +0,0 @@ -import * as Sentry from '@sentry/node'; -import { loggingTransport } from '@sentry-internal/node-integration-tests'; - -Sentry.init({ - dsn: 'https://public@dsn.ingest.sentry.io/1337', - release: '1.0', - tracesSampleRate: 1.0, - transport: loggingTransport, - traceLifecycle: 'stream', - dataCollection: { - userInfo: true, - }, -}); diff --git a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument-without-request-data.mjs b/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument-without-request-data.mjs index 8718d7793fd9..c1f011300062 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument-without-request-data.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument-without-request-data.mjs @@ -7,6 +7,5 @@ Sentry.init({ tracesSampleRate: 1.0, transport: loggingTransport, traceLifecycle: 'stream', - dataCollection: { userInfo: true }, integrations: defaults => defaults.filter(i => i.name !== 'RequestData'), }); diff --git a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/test.ts b/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/test.ts index 009e7bde7721..4c341f69902b 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/test.ts @@ -49,8 +49,8 @@ describe('requestData-streamed', () => { }); }); - createEsmAndCjsTests(__dirname, 'server.mjs', 'instrument-with-datacollection.mjs', (createRunner, test) => { - test('applies request data attributes when using dataCollection config', async () => { + createEsmAndCjsTests(__dirname, 'server.mjs', 'instrument.mjs', (createRunner, test) => { + test('applies request data attributes by default', async () => { const runner = createRunner() .expect({ span: container => { diff --git a/packages/astro/test/client/sdk.test.ts b/packages/astro/test/client/sdk.test.ts index 20cad73269e5..0d7d3f68cd46 100644 --- a/packages/astro/test/client/sdk.test.ts +++ b/packages/astro/test/client/sdk.test.ts @@ -42,7 +42,7 @@ describe('Sentry client SDK', () => { { name: 'npm:@sentry/browser', version: SDK_VERSION }, ], settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, }, diff --git a/packages/browser/test/client.test.ts b/packages/browser/test/client.test.ts index efd9aa9cc60d..2eeaef540aa3 100644 --- a/packages/browser/test/client.test.ts +++ b/packages/browser/test/client.test.ts @@ -166,37 +166,10 @@ describe('applyDefaultOptions', () => { describe('SDK metadata', () => { describe('sdk.settings', () => { - it('sets infer_ip to "never" by default', () => { + it('sets infer_ip to "auto" by default', () => { const options = getDefaultBrowserClientOptions({}); const client = new BrowserClient(options); - expect(client.getOptions()._metadata?.sdk?.settings?.infer_ip).toBe('never'); - }); - - it('sets infer_ip to "never" if dataCollection.userInfo is false', () => { - const options = getDefaultBrowserClientOptions({ - dataCollection: { userInfo: false }, - }); - const client = new BrowserClient(options); - - expect(client.getOptions()._metadata?.sdk?.settings?.infer_ip).toBe('never'); - }); - - it('sets infer_ip to "auto" if dataCollection.userInfo is true', () => { - const options = getDefaultBrowserClientOptions({ - dataCollection: { userInfo: true }, - }); - const client = new BrowserClient(options); - - expect(client.getOptions()._metadata?.sdk?.settings?.infer_ip).toBe('auto'); - }); - - it('sets infer_ip to "auto" if dataCollection.userInfo is true', () => { - const options = getDefaultBrowserClientOptions({ - dataCollection: { userInfo: true }, - }); - const client = new BrowserClient(options); - expect(client.getOptions()._metadata?.sdk?.settings?.infer_ip).toBe('auto'); }); @@ -211,7 +184,6 @@ describe('SDK metadata', () => { it("doesn't override already set sdk metadata settings", () => { const options = getDefaultBrowserClientOptions({ - dataCollection: { userInfo: true }, _metadata: { sdk: { settings: { @@ -243,7 +215,7 @@ describe('SDK metadata', () => { expect(client.getOptions()._metadata?.sdk).toEqual({ name: 'sentry.javascript.angular', settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }); }); @@ -279,7 +251,7 @@ describe('SDK metadata', () => { }, }, }, - // Usually, this would cause infer_ip to be set to 'never' + // Usually, this would cause infer_ip to be set to 'auto' // but we're passing it in explicitly, so it should be preserved dataCollection: { userInfo: false }, }); diff --git a/packages/browser/test/integrations/httpclient.test.ts b/packages/browser/test/integrations/httpclient.test.ts index 05b362754bad..aebe86ef5a1a 100644 --- a/packages/browser/test/integrations/httpclient.test.ts +++ b/packages/browser/test/integrations/httpclient.test.ts @@ -91,9 +91,7 @@ describe('httpClientIntegration', () => { describe('fetch', () => { it('filters sensitive request and response headers while keeping safe ones with data collection enabled', () => { - const { fetchHandler, captureEventSpy } = setup({ - dataCollection: { httpHeaders: { request: true, response: true } }, - }); + const { fetchHandler, captureEventSpy } = setup(); triggerFetch(fetchHandler, { requestHeaders: { @@ -125,9 +123,7 @@ describe('httpClientIntegration', () => { }); it('keeps PII headers like x-forwarded-for when collection is enabled', () => { - const { fetchHandler, captureEventSpy } = setup({ - dataCollection: { httpHeaders: { request: true, response: true } }, - }); + const { fetchHandler, captureEventSpy } = setup(); triggerFetch(fetchHandler, { requestHeaders: { @@ -224,9 +220,7 @@ describe('httpClientIntegration', () => { describe('xhr', () => { it('filters sensitive request and response headers with data collection enabled', () => { - const { xhrHandler, captureEventSpy } = setup({ - dataCollection: { httpHeaders: { request: true, response: true } }, - }); + const { xhrHandler, captureEventSpy } = setup(); triggerXhr(xhrHandler, { requestHeaders: { Authorization: 'Bearer super-secret-token', 'X-Custom': 'safe-value' }, @@ -248,9 +242,7 @@ describe('httpClientIntegration', () => { }); it('parses and filters sensitive cookies from the Set-Cookie response header', () => { - const { xhrHandler, captureEventSpy } = setup({ - dataCollection: { httpHeaders: { request: true, response: true } }, - }); + const { xhrHandler, captureEventSpy } = setup(); triggerXhr(xhrHandler, { setCookie: 'session=abc123; theme=dark; connect.sid=secret', diff --git a/packages/core/src/utils/data-collection/resolveDataCollectionOptions.ts b/packages/core/src/utils/data-collection/resolveDataCollectionOptions.ts index 9f4f60ce5a73..f7ef47dd6dda 100644 --- a/packages/core/src/utils/data-collection/resolveDataCollectionOptions.ts +++ b/packages/core/src/utils/data-collection/resolveDataCollectionOptions.ts @@ -18,21 +18,20 @@ const DEFAULTS: ResolvedDataCollection = { * Resolves the effective `DataCollection` configuration from client options. * * Precedence: - * 1. Fields explicitly set in `dataCollection` - * 2. If `sendDefaultPii` is set and `dataCollection` is absent, bridge via `defaultPiiToCollectionOptions` - * 3. Spec defaults + * 1. Spec defaults + * 2. Fields explicitly set in `dataCollection` + * 3. If `sendDefaultPii` is set and `dataCollection` is absent, bridge via `defaultPiiToCollectionOptions` * - * TODO(v11): Remove `sendDefaultPii` support and always fall through to DEFAULTS so that `userInfo: true` - * NOTE: In v10, DEFAULTS only apply when `dataCollection` is explicitly provided. - * When `dataCollection` is absent, the legacy `sendDefaultPii` bridge is used, which defaults to - * `userInfo: false` to preserve backward compatibility. + * TODO(v11): Remove `sendDefaultPii` support and always use DEFAULTS. */ export function resolveDataCollectionOptions(options: { dataCollection?: DataCollection; sendDefaultPii?: boolean; }): ResolvedDataCollection { - // TODO(v11): Remove the sendDefaultPii bridge and always use DEFAULTS. - const base = options.dataCollection != null ? DEFAULTS : defaultPiiToCollectionOptions(options.sendDefaultPii); + const base = + options.dataCollection == null && options.sendDefaultPii != null + ? defaultPiiToCollectionOptions(options.sendDefaultPii) + : DEFAULTS; const dc = options.dataCollection ?? {}; diff --git a/packages/core/test/lib/integrations/supabase.test.ts b/packages/core/test/lib/integrations/supabase.test.ts index 07ef5f583205..fef69305a6fd 100644 --- a/packages/core/test/lib/integrations/supabase.test.ts +++ b/packages/core/test/lib/integrations/supabase.test.ts @@ -331,7 +331,7 @@ describe('Supabase Integration', () => { }); it('includes data when dataCollection.databaseQueryData is true', async () => { - const resolved = resolveDataCollectionOptions({ dataCollection: { databaseQueryData: true } }); + const resolved = resolveDataCollectionOptions({}); currentScopesMocks.getClient.mockReturnValue({ getDataCollectionOptions: () => resolved, } as any); diff --git a/packages/core/test/lib/logs/internal.test.ts b/packages/core/test/lib/logs/internal.test.ts index b4b061c2d1c6..cf2fe913d98f 100644 --- a/packages/core/test/lib/logs/internal.test.ts +++ b/packages/core/test/lib/logs/internal.test.ts @@ -863,7 +863,6 @@ describe('_INTERNAL_captureLog', () => { it('includes partial user data when only some fields are available', () => { const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, - dataCollection: { userInfo: true }, }); const client = new TestClient(options); const scope = new Scope(); @@ -888,7 +887,6 @@ describe('_INTERNAL_captureLog', () => { it('includes user email and username without id', () => { const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, - dataCollection: { userInfo: true }, }); const client = new TestClient(options); const scope = new Scope(); @@ -918,7 +916,6 @@ describe('_INTERNAL_captureLog', () => { it('does not include user data when user object is empty', () => { const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, - dataCollection: { userInfo: true }, }); const client = new TestClient(options); const scope = new Scope(); @@ -936,7 +933,6 @@ describe('_INTERNAL_captureLog', () => { it('combines user data with other log attributes', () => { const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, - dataCollection: { userInfo: true }, release: '1.0.0', environment: 'test', }); @@ -990,7 +986,6 @@ describe('_INTERNAL_captureLog', () => { it('handles user data with non-string values', () => { const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, - dataCollection: { userInfo: true }, }); const client = new TestClient(options); const scope = new Scope(); @@ -1020,7 +1015,6 @@ describe('_INTERNAL_captureLog', () => { it('preserves existing user attributes in log and does not override them', () => { const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, - dataCollection: { userInfo: true }, }); const client = new TestClient(options); const scope = new Scope(); @@ -1063,7 +1057,6 @@ describe('_INTERNAL_captureLog', () => { it('only adds scope user data for attributes that do not already exist', () => { const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, - dataCollection: { userInfo: true }, }); const client = new TestClient(options); const scope = new Scope(); diff --git a/packages/core/test/lib/metrics/internal.test.ts b/packages/core/test/lib/metrics/internal.test.ts index 2fc2993e27c4..e1d114c6566c 100644 --- a/packages/core/test/lib/metrics/internal.test.ts +++ b/packages/core/test/lib/metrics/internal.test.ts @@ -22,7 +22,7 @@ describe('_INTERNAL_captureMetric', () => { }); it('captures and sends metrics', () => { - const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN }); + const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, dataCollection: { userInfo: false } }); const client = new TestClient(options); const scope = new Scope(); scope.setClient(client); @@ -253,11 +253,10 @@ describe('_INTERNAL_captureMetric', () => { expect(buffer?.[0]?.name).toBe('trigger.flush'); }); - it('includes ingest_settings with auto when dataCollection.userInfo is true', () => { + it('includes ingest_settings with auto by default', () => { vi.spyOn(isBrowserModule, 'isBrowser').mockReturnValue(true); - // TODO(v11) Remove `dataCollection` as the defaults should be applied without explicitly adding the option - const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, dataCollection: {} }); + const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN }); const client = new TestClient(options); const scope = new Scope(); scope.setClient(client); @@ -272,10 +271,10 @@ describe('_INTERNAL_captureMetric', () => { expect(envelopeItemPayload.ingest_settings).toEqual({ infer_ip: 'auto', infer_user_agent: 'auto' }); }); - it('includes ingest_settings with never when dataCollection is not set', () => { + it('includes ingest_settings with never when dataCollection.userInfo is false', () => { vi.spyOn(isBrowserModule, 'isBrowser').mockReturnValue(true); - const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN }); + const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, dataCollection: { userInfo: false } }); const client = new TestClient(options); const scope = new Scope(); scope.setClient(client); diff --git a/packages/core/test/lib/tracing/spans/captureSpan.test.ts b/packages/core/test/lib/tracing/spans/captureSpan.test.ts index d6578571238c..3f40374908e2 100644 --- a/packages/core/test/lib/tracing/spans/captureSpan.test.ts +++ b/packages/core/test/lib/tracing/spans/captureSpan.test.ts @@ -435,7 +435,6 @@ describe('captureSpan', () => { tracesSampleRate: 1, release: '1.0.0', environment: 'staging', - dataCollection: { userInfo: true }, }), ); diff --git a/packages/core/test/lib/tracing/spans/envelope.test.ts b/packages/core/test/lib/tracing/spans/envelope.test.ts index e682a8865f8f..14add8ba3747 100644 --- a/packages/core/test/lib/tracing/spans/envelope.test.ts +++ b/packages/core/test/lib/tracing/spans/envelope.test.ts @@ -241,12 +241,11 @@ describe('createStreamedSpanEnvelope', () => { ]); }); - it("includes ingest_settings with 'auto' values when in browser and dataCollection.userInfo is true", () => { + it("includes ingest_settings with 'auto' values when in browser by default", () => { vi.mocked(isBrowser).mockReturnValue(true); const mockSpan = createMockSerializedSpan(); - // TODO(v11) Remove `dataCollection` as the defaults should be applied without explicitly adding the option - const mockClient = new TestClient(getDefaultTestClientOptions({ dataCollection: {} })); + const mockClient = new TestClient(getDefaultTestClientOptions({})); const dsc: Partial = {}; const envelopeItems = createStreamedSpanEnvelope([mockSpan], dsc, mockClient)[1]; @@ -286,8 +285,7 @@ describe('createStreamedSpanEnvelope', () => { it('omits ingest_settings when not in browser', () => { const mockSpan = createMockSerializedSpan(); - // TODO(v11) Remove `dataCollection` as the defaults should be applied without explicitly adding the option - const mockClient = new TestClient(getDefaultTestClientOptions({ dataCollection: {} })); + const mockClient = new TestClient(getDefaultTestClientOptions({})); const dsc: Partial = {}; const envelopeItems = createStreamedSpanEnvelope([mockSpan], dsc, mockClient)[1]; @@ -302,47 +300,5 @@ describe('createStreamedSpanEnvelope', () => { ], ]); }); - - it('sets ingest settings when dataCollection.userInfo is true', () => { - vi.mocked(isBrowser).mockReturnValue(true); - - const mockSpan = createMockSerializedSpan(); - const mockClient = new TestClient(getDefaultTestClientOptions({ dataCollection: { userInfo: true } })); - const dsc: Partial = {}; - - const envelopeItems = createStreamedSpanEnvelope([mockSpan], dsc, mockClient)[1]; - - expect(envelopeItems).toEqual([ - [ - { type: 'span', item_count: 1, content_type: 'application/vnd.sentry.items.span.v2+json' }, - { - version: 2, - ingest_settings: { infer_ip: 'auto', infer_user_agent: 'auto' }, - items: [mockSpan], - }, - ], - ]); - }); - - it('sets ingest settings when dataCollection.userInfo is false', () => { - vi.mocked(isBrowser).mockReturnValue(true); - - const mockSpan = createMockSerializedSpan(); - const mockClient = new TestClient(getDefaultTestClientOptions({ dataCollection: { userInfo: false } })); - const dsc: Partial = {}; - - const envelopeItems = createStreamedSpanEnvelope([mockSpan], dsc, mockClient)[1]; - - expect(envelopeItems).toEqual([ - [ - { type: 'span', item_count: 1, content_type: 'application/vnd.sentry.items.span.v2+json' }, - { - version: 2, - ingest_settings: { infer_ip: 'never', infer_user_agent: 'never' }, - items: [mockSpan], - }, - ], - ]); - }); }); }); diff --git a/packages/core/test/lib/utils/data-collection/resolveDataCollectionOptions.test.ts b/packages/core/test/lib/utils/data-collection/resolveDataCollectionOptions.test.ts index bba37ae7608c..04d785b883bc 100644 --- a/packages/core/test/lib/utils/data-collection/resolveDataCollectionOptions.test.ts +++ b/packages/core/test/lib/utils/data-collection/resolveDataCollectionOptions.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from 'vitest'; +import { defaultPiiToCollectionOptions } from '../../../../src/utils/data-collection/defaultPiiToCollectionOptions'; import { resolveDataCollectionOptions } from '../../../../src/utils/data-collection/resolveDataCollectionOptions'; describe('resolveDataCollectionOptions', () => { @@ -15,28 +16,25 @@ describe('resolveDataCollectionOptions', () => { frameContextLines: 5, }; - describe('with no options', () => { - it('uses restrictive defaults when dataCollection is not set', () => { - const result = resolveDataCollectionOptions({}); - - expect(result.userInfo).toBe(false); - expect(result.httpBodies).toEqual(['incomingRequest', 'outgoingRequest', 'incomingResponse', 'outgoingResponse']); - expect(result.genAI).toEqual({ inputs: true, outputs: true }); - expect(result.graphQL).toEqual({ document: true, variables: true }); - expect(result.databaseQueryData).toBe(false); - expect(result.stackFrameVariables).toBe(true); - expect(result.frameContextLines).toBe(7); + describe('with no dataCollection options', () => { + it('returns spec defaults when neither option is set', () => { + expect(resolveDataCollectionOptions({})).toEqual(SPEC_DEFAULTS); }); it('returns spec defaults when dataCollection is explicitly set to empty object', () => { expect(resolveDataCollectionOptions({ dataCollection: {} })).toEqual(SPEC_DEFAULTS); }); - it('collects all body types by default when dataCollection is set without httpBodies', () => { - const result = resolveDataCollectionOptions({ dataCollection: {} }); - - expect(result.httpBodies).toEqual(['incomingRequest', 'outgoingRequest', 'incomingResponse', 'outgoingResponse']); + it('ignores sendDefaultPii when dataCollection is set', () => { + expect(resolveDataCollectionOptions({ dataCollection: {}, sendDefaultPii: false })).toEqual(SPEC_DEFAULTS); }); + + it.each([true, false])( + 'uses the legacy bridge when sendDefaultPii is %s and dataCollection is absent', + sendDefaultPii => { + expect(resolveDataCollectionOptions({ sendDefaultPii })).toEqual(defaultPiiToCollectionOptions(sendDefaultPii)); + }, + ); }); describe('dataCollection options', () => { @@ -54,7 +52,6 @@ describe('resolveDataCollectionOptions', () => { it('merges user overrides with defaults', () => { const result = resolveDataCollectionOptions({ dataCollection: { - userInfo: true, httpBodies: ['incomingRequest'], }, }); diff --git a/packages/core/test/lib/utils/request.test.ts b/packages/core/test/lib/utils/request.test.ts index 35652116e415..1569fc6a581a 100644 --- a/packages/core/test/lib/utils/request.test.ts +++ b/packages/core/test/lib/utils/request.test.ts @@ -9,6 +9,7 @@ import { winterCGRequestToRequestData, } from '../../../src/utils/request'; import type { ResolvedDataCollection } from '../../../src/types/datacollection'; +import { resolveDataCollectionOptions } from '../../../src/utils/data-collection/resolveDataCollectionOptions'; import type { Scope } from '../../../src/scope'; describe('request utils', () => { @@ -740,18 +741,11 @@ describe('request utils', () => { it.each([ { - dataCollection: { - userInfo: false, - cookies: true, - httpHeaders: { request: { deny: ['forwarded', '-ip', 'remote-', 'via', '-user'] }, response: true }, - httpBodies: [], - urlQueryParams: true, - graphQL: { document: true, variables: true }, - genAI: { inputs: true, outputs: true }, - databaseQueryData: true, - stackFrameVariables: true, - frameContextLines: 5, - }, + dataCollection: resolveDataCollectionOptions({ + dataCollection: { + httpHeaders: { request: { deny: ['forwarded', '-ip', 'remote-', 'via', '-user'] }, response: true }, + }, + }), expected: { 'http.request.header.content_type': 'application/json', 'http.request.header.user_agent': 'Mozilla/5.0', @@ -762,18 +756,7 @@ describe('request utils', () => { }, }, { - dataCollection: { - userInfo: true, - cookies: true, - httpHeaders: { request: true, response: true }, - httpBodies: [], - urlQueryParams: true, - graphQL: { document: true, variables: true }, - genAI: { inputs: true, outputs: true }, - databaseQueryData: true, - stackFrameVariables: true, - frameContextLines: 5, - }, + dataCollection: resolveDataCollectionOptions({}), expected: { 'http.request.header.content_type': 'application/json', 'http.request.header.user_agent': 'Mozilla/5.0', diff --git a/packages/deno/test/__snapshots__/mod.test.ts.snap b/packages/deno/test/__snapshots__/mod.test.ts.snap index 38a78fc1ad9d..cdaa2080c3b2 100644 --- a/packages/deno/test/__snapshots__/mod.test.ts.snap +++ b/packages/deno/test/__snapshots__/mod.test.ts.snap @@ -1,161 +1,5 @@ export const snapshot = {}; -snapshot[`captureException 1`] = ` -{ - contexts: { - app: { - app_start_time: "{{time}}", - }, - device: { - arch: "{{arch}}", - processor_count: 0, - }, - os: { - name: "{{platform}}", - version: "{{version}}", - }, - runtime: { - name: "deno", - version: "{{version}}", - }, - trace: { - span_id: "{{id}}", - trace_id: "{{id}}", - }, - typescript: { - name: "TypeScript", - version: "{{version}}", - }, - v8: { - name: "v8", - version: "{{version}}", - }, - }, - environment: "production", - event_id: "{{id}}", - exception: { - values: [ - { - mechanism: { - handled: true, - type: "generic", - }, - stacktrace: { - frames: [ - { - colno: 27, - context_line: " client.captureException(something());", - filename: "app:///test/mod.test.ts", - function: "?", - in_app: true, - lineno: 44, - post_context: [ - "", - " await delay(200);", - " await assertSnapshot(t, ev);", - "});", - "", - "Deno.test('captureMessage', async t => {", - " let ev: Event | undefined;", - ], - pre_context: [ - " ev = event;", - " });", - "", - " function something() {", - " return new Error('Some unhandled error');", - " }", - "", - ], - }, - { - colno: 12, - context_line: " return new Error('Some unhandled error');", - filename: "app:///test/mod.test.ts", - function: "something", - in_app: true, - lineno: 41, - post_context: [ - " }", - "", - " client.captureException(something());", - "", - " await delay(200);", - " await assertSnapshot(t, ev);", - "});", - ], - pre_context: [ - "Deno.test('captureException', async t => {", - " let ev: Event | undefined;", - " const client = getTestClient(event => {", - " ev = event;", - " });", - "", - " function something() {", - ], - }, - ], - }, - type: "Error", - value: "Some unhandled error", - }, - ], - }, - level: "error", - platform: "javascript", - sdk: { - integrations: [ - "InboundFilters", - "RequestData", - "FunctionToString", - "LinkedErrors", - "Dedupe", - "Breadcrumbs", - "DenoContext", - "DenoServe", - "DenoHttp", - "DenoRedis", - "Graphql", - "VercelAI", - "Amqplib", - "Anthropic_AI", - "Aws", - "Express", - "Firebase", - "GenericPool", - "Google_GenAI", - "Hapi", - "Kafka", - "Koa", - "LangChain", - "LangGraph", - "LruMemoizer", - "Mongo", - "Mongoose", - "Mysql", - "Mysql2", - "OpenAI", - "Postgres", - "PostgresJs", - "Tedious", - "ContextLines", - "NormalizePaths", - "GlobalHandlers", - ], - name: "sentry.javascript.deno", - packages: [ - { - name: "denoland:sentry", - version: "{{version}}", - }, - ], - version: "{{version}}", - }, - server_name: "{{server}}", - timestamp: 0, -} -`; - snapshot[`captureMessage 1`] = ` { breadcrumbs: [ diff --git a/packages/deno/test/deno-serve.test.ts b/packages/deno/test/deno-serve.test.ts index 4ae95c4eb494..2ca1070dbd51 100644 --- a/packages/deno/test/deno-serve.test.ts +++ b/packages/deno/test/deno-serve.test.ts @@ -281,7 +281,6 @@ Deno.test('Deno.serve should capture request headers and set response context', dsn: 'https://username@domain/123', tracesSampleRate: 1, traceLifecycle: 'static', - dataCollection: { httpHeaders: { request: true, response: true } }, beforeSendTransaction: (event: TransactionEvent) => { transactionEvents.push(event); return null; @@ -326,7 +325,7 @@ Deno.test('Deno.serve should capture request headers and set response context', assertEquals(transaction?.contexts?.trace?.data?.['http.response.header.x_custom_header'], 'test'); }); -Deno.test('Deno.serve should capture client address and port when userInfo data collection is enabled', async () => { +Deno.test('Deno.serve should capture client address and port by default', async () => { resetGlobals(); const transactionEvents: TransactionEvent[] = []; @@ -334,7 +333,6 @@ Deno.test('Deno.serve should capture client address and port when userInfo data dsn: 'https://username@domain/123', tracesSampleRate: 1, traceLifecycle: 'static', - dataCollection: { userInfo: true }, beforeSendTransaction: (event: TransactionEvent) => { transactionEvents.push(event); return null; @@ -362,7 +360,7 @@ Deno.test('Deno.serve should capture client address and port when userInfo data assertExists(transaction?.contexts?.trace?.data?.['client.port']); }); -Deno.test('Deno.serve should not capture client address by default', async () => { +Deno.test('Deno.serve should not capture client address when userInfo collection is disabled', async () => { resetGlobals(); const transactionEvents: TransactionEvent[] = []; @@ -370,6 +368,7 @@ Deno.test('Deno.serve should not capture client address by default', async () => dsn: 'https://username@domain/123', tracesSampleRate: 1, traceLifecycle: 'static', + dataCollection: { userInfo: false }, beforeSendTransaction: (event: TransactionEvent) => { transactionEvents.push(event); return null; @@ -397,7 +396,7 @@ Deno.test('Deno.serve should not capture client address by default', async () => assertEquals(transaction?.contexts?.trace?.data?.['client.port'], undefined); }); -Deno.test('Deno.serve should keep PII request headers when dataCollection enables header collection', async () => { +Deno.test('Deno.serve should keep PII request headers by default', async () => { resetGlobals(); const transactionEvents: TransactionEvent[] = []; @@ -405,7 +404,6 @@ Deno.test('Deno.serve should keep PII request headers when dataCollection enable dsn: 'https://username@domain/123', tracesSampleRate: 1, traceLifecycle: 'static', - dataCollection: { httpHeaders: { request: true } }, beforeSendTransaction: (event: TransactionEvent) => { transactionEvents.push(event); return null; @@ -434,7 +432,7 @@ Deno.test('Deno.serve should keep PII request headers when dataCollection enable assertEquals(transaction?.contexts?.trace?.data?.['http.request.header.x_forwarded_for'], '203.0.113.7'); }); -Deno.test('Deno.serve should filter PII request headers by default', async () => { +Deno.test('Deno.serve should filter PII request headers when configured', async () => { resetGlobals(); const transactionEvents: TransactionEvent[] = []; @@ -442,6 +440,7 @@ Deno.test('Deno.serve should filter PII request headers by default', async () => dsn: 'https://username@domain/123', tracesSampleRate: 1, traceLifecycle: 'static', + dataCollection: { httpHeaders: { request: { deny: ['forwarded'] } } }, beforeSendTransaction: (event: TransactionEvent) => { transactionEvents.push(event); return null; diff --git a/packages/deno/test/mod.test.ts b/packages/deno/test/mod.test.ts index 1f560f215460..3072ef7e19ba 100644 --- a/packages/deno/test/mod.test.ts +++ b/packages/deno/test/mod.test.ts @@ -31,7 +31,7 @@ function delay(time: number): Promise { }); } -Deno.test('captureException', async t => { +Deno.test('captureException', async () => { let ev: Event | undefined; const client = getTestClient(event => { ev = event; @@ -44,9 +44,44 @@ Deno.test('captureException', async t => { client.captureException(something()); await delay(200); - await assertSnapshot(t, ev); + expectCaptureExceptionEvent(ev); }); +function expectCaptureExceptionEvent(event: Event | undefined): void { + const exception = event?.exception?.values?.[0]; + + assertEquals(exception?.type, 'Error'); + assertEquals(exception?.value, 'Some unhandled error'); + assertEquals( + exception?.stacktrace?.frames?.map(frame => ({ + colno: frame.colno, + context_line: frame.context_line, + filename: frame.filename, + function: frame.function, + in_app: frame.in_app, + lineno: frame.lineno, + })), + [ + { + colno: 27, + context_line: ' client.captureException(something());', + filename: 'app:///test/mod.test.ts', + function: '?', + in_app: true, + lineno: 44, + }, + { + colno: 12, + context_line: " return new Error('Some unhandled error');", + filename: 'app:///test/mod.test.ts', + function: 'something', + in_app: true, + lineno: 41, + }, + ], + ); +} + Deno.test('captureMessage', async t => { let ev: Event | undefined; const client = getTestClient(event => { diff --git a/packages/nextjs/test/clientSdk.test.ts b/packages/nextjs/test/clientSdk.test.ts index 1a5aa116ca9a..4549fd1bf1f6 100644 --- a/packages/nextjs/test/clientSdk.test.ts +++ b/packages/nextjs/test/clientSdk.test.ts @@ -74,7 +74,7 @@ describe('Client init()', () => { }, ], settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, }, diff --git a/packages/nuxt/test/client/sdk.test.ts b/packages/nuxt/test/client/sdk.test.ts index e2179c4a0f62..af285e4adedc 100644 --- a/packages/nuxt/test/client/sdk.test.ts +++ b/packages/nuxt/test/client/sdk.test.ts @@ -28,7 +28,7 @@ describe('Nuxt Client SDK', () => { { name: 'npm:@sentry/vue', version: SDK_VERSION }, ], settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, }, diff --git a/packages/react-router/test/client/sdk.test.ts b/packages/react-router/test/client/sdk.test.ts index 46c629a0bbd5..ba4944a25f82 100644 --- a/packages/react-router/test/client/sdk.test.ts +++ b/packages/react-router/test/client/sdk.test.ts @@ -34,7 +34,7 @@ describe('React Router client SDK', () => { { name: 'npm:@sentry/browser', version: SDK_VERSION }, ], settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, }, diff --git a/packages/remix/test/index.client.test.ts b/packages/remix/test/index.client.test.ts index eea6e69da1fb..a75a296cb629 100644 --- a/packages/remix/test/index.client.test.ts +++ b/packages/remix/test/index.client.test.ts @@ -37,7 +37,7 @@ describe('Client init()', () => { }, ], settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, }, diff --git a/packages/solid/test/sdk.test.ts b/packages/solid/test/sdk.test.ts index cbef43425a32..37d9fb5a8226 100644 --- a/packages/solid/test/sdk.test.ts +++ b/packages/solid/test/sdk.test.ts @@ -22,7 +22,7 @@ describe('Initialize Solid SDK', () => { packages: [{ name: 'npm:@sentry/solid', version: SDK_VERSION }], version: SDK_VERSION, settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, }, diff --git a/packages/solidstart/test/client/sdk.test.ts b/packages/solidstart/test/client/sdk.test.ts index 159cc6da8bcb..80762894dcb4 100644 --- a/packages/solidstart/test/client/sdk.test.ts +++ b/packages/solidstart/test/client/sdk.test.ts @@ -26,7 +26,7 @@ describe('Initialize Solid Start SDK', () => { ], version: SDK_VERSION, settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, }, diff --git a/packages/svelte/test/sdk.test.ts b/packages/svelte/test/sdk.test.ts index 665805b95714..f151719bc4a2 100644 --- a/packages/svelte/test/sdk.test.ts +++ b/packages/svelte/test/sdk.test.ts @@ -26,7 +26,7 @@ describe('Initialize Svelte SDk', () => { packages: [{ name: 'npm:@sentry/svelte', version: SDK_VERSION }], version: SDK_VERSION, settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, }, diff --git a/packages/sveltekit/test/client/sdk.test.ts b/packages/sveltekit/test/client/sdk.test.ts index 91bc44d77b21..e9aaa68ce327 100644 --- a/packages/sveltekit/test/client/sdk.test.ts +++ b/packages/sveltekit/test/client/sdk.test.ts @@ -34,7 +34,7 @@ describe('Sentry client SDK', () => { { name: 'npm:@sentry/svelte', version: SDK_VERSION }, ], settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, }, diff --git a/packages/tanstackstart-react/test/client/sdk.test.ts b/packages/tanstackstart-react/test/client/sdk.test.ts index b8add33b4984..0364ee45a6aa 100644 --- a/packages/tanstackstart-react/test/client/sdk.test.ts +++ b/packages/tanstackstart-react/test/client/sdk.test.ts @@ -29,7 +29,7 @@ describe('TanStack Start React Client SDK', () => { { name: 'npm:@sentry/react', version: SDK_VERSION }, ], settings: { - infer_ip: 'never', + infer_ip: 'auto', }, }, },