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 2901c482e2d2..5f661173a480 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 @@ -43,6 +43,8 @@ sentryTest('allows to setup a client manually & capture exceptions', async ({ ge version: expect.any(String), packages: [{ name: expect.any(String), version: expect.any(String) }], }, - contexts: { trace: { trace_id: expect.any(String), span_id: expect.any(String) } }, + contexts: { + trace: { trace_id: expect.stringMatching(/[a-f0-9]{32}/), span_id: expect.stringMatching(/[a-f0-9]{16}/) }, + }, }); }); diff --git a/dev-packages/browser-integration-tests/suites/replay/dsc/test.ts b/dev-packages/browser-integration-tests/suites/replay/dsc/test.ts index e95653f3cadc..a01583b585af 100644 --- a/dev-packages/browser-integration-tests/suites/replay/dsc/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/dsc/test.ts @@ -58,7 +58,7 @@ sentryTest( expect(envHeader.trace).toEqual({ environment: 'production', sample_rate: '1', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), public_key: 'public', replay_id: replay.session?.id, sampled: 'true', @@ -105,7 +105,7 @@ sentryTest( expect(envHeader.trace).toEqual({ environment: 'production', sample_rate: '1', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), public_key: 'public', sampled: 'true', }); @@ -157,7 +157,7 @@ sentryTest( expect(envHeader.trace).toEqual({ environment: 'production', sample_rate: '1', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), public_key: 'public', replay_id: replay.session?.id, sampled: 'true', @@ -199,7 +199,7 @@ sentryTest( expect(envHeader.trace).toEqual({ environment: 'production', sample_rate: '1', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), public_key: 'public', sampled: 'true', }); @@ -240,7 +240,7 @@ sentryTest('should add replay_id to error DSC while replay is active', async ({ expect(error1Header.trace).toBeDefined(); expect(error1Header.trace).toEqual({ environment: 'production', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), public_key: 'public', replay_id: replay.session?.id, ...(hasTracing @@ -261,7 +261,7 @@ sentryTest('should add replay_id to error DSC while replay is active', async ({ expect(error2Header.trace).toBeDefined(); expect(error2Header.trace).toEqual({ environment: 'production', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), public_key: 'public', ...(hasTracing ? { diff --git a/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/http-timings/test.ts b/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/http-timings/test.ts index 8d6e9124a86e..c5db8b6b18e9 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/http-timings/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/http-timings/test.ts @@ -35,7 +35,7 @@ sentryTest('should create fetch spans with http timing @firefox', async ({ brows expect(span).toMatchObject({ description: `GET http://example.com/${index}`, parent_span_id: tracingEvent.contexts?.trace?.span_id, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: tracingEvent.contexts?.trace?.trace_id, diff --git a/dev-packages/browser-integration-tests/suites/tracing/envelope-header-transaction-name/test.ts b/dev-packages/browser-integration-tests/suites/tracing/envelope-header-transaction-name/test.ts index f2f4b10ede46..11867eafdd94 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/envelope-header-transaction-name/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/envelope-header-transaction-name/test.ts @@ -24,7 +24,7 @@ sentryTest( environment: 'production', sample_rate: '1', transaction: expect.stringContaining('/index.html'), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), public_key: 'public', sampled: 'true', }); diff --git a/dev-packages/browser-integration-tests/suites/tracing/envelope-header/test.ts b/dev-packages/browser-integration-tests/suites/tracing/envelope-header/test.ts index fdfbac823166..c7db131176f6 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/envelope-header/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/envelope-header/test.ts @@ -27,7 +27,7 @@ sentryTest( expect(envHeader.trace).toEqual({ environment: 'production', sample_rate: '1', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), public_key: 'public', sampled: 'true', }); diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/fetch-relative-url/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/fetch-relative-url/test.ts index d4a6065a177b..623a27299077 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/fetch-relative-url/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/fetch-relative-url/test.ts @@ -24,7 +24,7 @@ sentryTest('should create spans for fetch requests', async ({ getLocalTestUrl, p expect(span).toMatchObject({ description: `GET /test-req/${index}`, parent_span_id: tracingEvent.contexts?.trace?.span_id, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: tracingEvent.contexts?.trace?.trace_id, diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/fetch/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/fetch/test.ts index 53ff985a3f1b..555eff1c2276 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/fetch/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/fetch/test.ts @@ -28,7 +28,7 @@ sentryTest('should create spans for fetch requests', async ({ getLocalTestUrl, p expect(span).toMatchObject({ description: `GET http://example.com/${index}`, parent_span_id: tracingEvent.contexts?.trace?.span_id, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: tracingEvent.contexts?.trace?.trace_id, diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/xhr-relative-url/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/xhr-relative-url/test.ts index f3dca9359b8b..7baedcae7a02 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/xhr-relative-url/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/xhr-relative-url/test.ts @@ -24,7 +24,7 @@ sentryTest('should create spans for xhr requests', async ({ getLocalTestUrl, pag expect(span).toMatchObject({ description: `GET /test-req/${index}`, parent_span_id: tracingEvent.contexts?.trace?.span_id, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: tracingEvent.contexts?.trace?.trace_id, diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/xhr/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/xhr/test.ts index 5cc65c872c08..23258137bb0f 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/xhr/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/xhr/test.ts @@ -20,7 +20,7 @@ sentryTest('should create spans for XHR requests', async ({ getLocalTestUrl, pag expect(span).toMatchObject({ description: `GET http://example.com/${index}`, parent_span_id: eventData.contexts?.trace?.span_id, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: eventData.contexts?.trace?.trace_id, diff --git a/dev-packages/e2e-tests/test-applications/aws-lambda-layer-cjs/tests/basic.test.ts b/dev-packages/e2e-tests/test-applications/aws-lambda-layer-cjs/tests/basic.test.ts index 53a44c424cf4..babd00bd4d7c 100644 --- a/dev-packages/e2e-tests/test-applications/aws-lambda-layer-cjs/tests/basic.test.ts +++ b/dev-packages/e2e-tests/test-applications/aws-lambda-layer-cjs/tests/basic.test.ts @@ -37,9 +37,9 @@ test('Lambda layer SDK bundle sends events', async ({ request }) => { }, op: 'function.aws.lambda', origin: 'auto.otel.aws-lambda', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(transactionEvent.spans).toHaveLength(2); diff --git a/dev-packages/e2e-tests/test-applications/aws-serverless-esm/tests/basic.test.ts b/dev-packages/e2e-tests/test-applications/aws-serverless-esm/tests/basic.test.ts index f6e57655ad08..62190c78f4a3 100644 --- a/dev-packages/e2e-tests/test-applications/aws-serverless-esm/tests/basic.test.ts +++ b/dev-packages/e2e-tests/test-applications/aws-serverless-esm/tests/basic.test.ts @@ -34,9 +34,9 @@ test('AWS Serverless SDK sends events in ESM mode', async ({ request }) => { }, op: 'function.aws.lambda', origin: 'auto.function.serverless', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(transactionEvent.spans).toHaveLength(2); diff --git a/dev-packages/e2e-tests/test-applications/create-next-app/tests/client-errors.test.ts b/dev-packages/e2e-tests/test-applications/create-next-app/tests/client-errors.test.ts index 5e06086f1a29..e0effa285b9f 100644 --- a/dev-packages/e2e-tests/test-applications/create-next-app/tests/client-errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/create-next-app/tests/client-errors.test.ts @@ -24,7 +24,7 @@ test('Sends a client-side exception to Sentry', async ({ page }) => { expect(errorEvent.transaction).toEqual('/'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/create-next-app/tests/client-transactions.test.ts b/dev-packages/e2e-tests/test-applications/create-next-app/tests/client-transactions.test.ts index d46191a77c03..8721a4d086bb 100644 --- a/dev-packages/e2e-tests/test-applications/create-next-app/tests/client-transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/create-next-app/tests/client-transactions.test.ts @@ -20,8 +20,8 @@ test('Sends a pageload transaction to Sentry', async ({ page }) => { version: '18.2.0', }, trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), op: 'pageload', origin: 'auto.pageload.nextjs.pages_router_instrumentation', data: expect.objectContaining({ @@ -65,8 +65,8 @@ test('captures a navigation transcation to Sentry', async ({ page }) => { version: '18.2.0', }, trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), op: 'navigation', origin: 'auto.navigation.nextjs.pages_router_instrumentation', data: expect.objectContaining({ diff --git a/dev-packages/e2e-tests/test-applications/create-next-app/tests/server-errors.test.ts b/dev-packages/e2e-tests/test-applications/create-next-app/tests/server-errors.test.ts index ed3263f5eb8b..08a47ace671f 100644 --- a/dev-packages/e2e-tests/test-applications/create-next-app/tests/server-errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/create-next-app/tests/server-errors.test.ts @@ -25,7 +25,7 @@ test('Sends a server-side exception to Sentry', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /api/error'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/create-next-app/tests/server-transactions.test.ts b/dev-packages/e2e-tests/test-applications/create-next-app/tests/server-transactions.test.ts index db5aec11ced0..731d1820ee61 100644 --- a/dev-packages/e2e-tests/test-applications/create-next-app/tests/server-transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/create-next-app/tests/server-transactions.test.ts @@ -19,8 +19,8 @@ test('Sends server-side transactions to Sentry', async ({ baseURL }) => { type: 'transaction', contexts: expect.objectContaining({ trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), op: 'http.server', origin: 'auto.http.nextjs', data: expect.objectContaining({ @@ -41,7 +41,7 @@ test('Sends server-side transactions to Sentry', async ({ baseURL }) => { description: 'test-span', origin: 'manual', parent_span_id: transactionEvent.contexts?.trace?.span_id, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), diff --git a/dev-packages/e2e-tests/test-applications/create-remix-app/tests/client-inp.test.ts b/dev-packages/e2e-tests/test-applications/create-remix-app/tests/client-inp.test.ts index 8fe1993db3f8..7e9a4fe96972 100644 --- a/dev-packages/e2e-tests/test-applications/create-remix-app/tests/client-inp.test.ts +++ b/dev-packages/e2e-tests/test-applications/create-remix-app/tests/client-inp.test.ts @@ -34,12 +34,12 @@ test('sends an INP span during pageload', async ({ page }) => { }, description: 'body > div > input#exception-button[type="button"]', op: 'ui.interaction.click', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), is_segment: true, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.browser.inp', exclusive_time: expect.any(Number), measurements: { inp: { unit: 'millisecond', value: expect.any(Number) } }, @@ -86,12 +86,12 @@ test('sends an INP span after pageload', async ({ page }) => { }, description: 'body > div > input#exception-button[type="button"]', op: 'ui.interaction.click', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), is_segment: true, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.browser.inp', exclusive_time: expect.any(Number), measurements: { inp: { unit: 'millisecond', value: expect.any(Number) } }, @@ -131,11 +131,11 @@ test('sends an INP span during navigation', async ({ page }) => { }, description: '', op: 'ui.interaction.click', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.browser.inp', exclusive_time: expect.any(Number), measurements: { inp: { unit: 'millisecond', value: expect.any(Number) } }, @@ -186,10 +186,10 @@ test('sends an INP span after navigation', async ({ page }) => { description: '', op: 'ui.interaction.click', is_segment: true, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.browser.inp', exclusive_time: expect.any(Number), measurements: { inp: { unit: 'millisecond', value: expect.any(Number) } }, diff --git a/dev-packages/e2e-tests/test-applications/default-browser/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/default-browser/tests/errors.test.ts index e4f2eda9a579..a84bfe6d4788 100644 --- a/dev-packages/e2e-tests/test-applications/default-browser/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/default-browser/tests/errors.test.ts @@ -24,8 +24,8 @@ test('captures an error', async ({ page }) => { }); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/ember-classic/tests/performance.test.ts b/dev-packages/e2e-tests/test-applications/ember-classic/tests/performance.test.ts index 47f3cdb0a6b4..e6aa4747bf92 100644 --- a/dev-packages/e2e-tests/test-applications/ember-classic/tests/performance.test.ts +++ b/dev-packages/e2e-tests/test-applications/ember-classic/tests/performance.test.ts @@ -157,7 +157,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.transition', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, @@ -174,7 +174,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.route.before_model', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, @@ -189,7 +189,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.route.before_model', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, @@ -207,7 +207,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.route.model', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, @@ -222,7 +222,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.route.model', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, @@ -240,7 +240,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.route.after_model', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, @@ -255,7 +255,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.route.after_model', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, @@ -271,7 +271,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.runloop.render', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, diff --git a/dev-packages/e2e-tests/test-applications/ember-embroider/tests/performance.test.ts b/dev-packages/e2e-tests/test-applications/ember-embroider/tests/performance.test.ts index a26bec292650..a82964b46a92 100644 --- a/dev-packages/e2e-tests/test-applications/ember-embroider/tests/performance.test.ts +++ b/dev-packages/e2e-tests/test-applications/ember-embroider/tests/performance.test.ts @@ -157,7 +157,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.transition', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, @@ -174,7 +174,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.route.before_model', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, @@ -189,7 +189,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.route.before_model', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, @@ -207,7 +207,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.route.model', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, @@ -222,7 +222,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.route.model', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, @@ -240,7 +240,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.route.after_model', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, @@ -255,7 +255,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.route.after_model', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, @@ -271,7 +271,7 @@ test('captures correct spans for navigation', async ({ page }) => { op: 'ui.ember.runloop.render', origin: 'auto.ui.ember', parent_span_id: spanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: traceId, diff --git a/dev-packages/e2e-tests/test-applications/nestjs-8/tests/cron-decorator.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-8/tests/cron-decorator.test.ts index dee95c1f1b01..d5d0cc44a418 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-8/tests/cron-decorator.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-8/tests/cron-decorator.test.ts @@ -27,8 +27,8 @@ test('Cron job triggers send of in_progress envelope', async ({ baseURL }) => { }, contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, }), @@ -43,8 +43,8 @@ test('Cron job triggers send of in_progress envelope', async ({ baseURL }) => { duration: expect.any(Number), contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, }), diff --git a/dev-packages/e2e-tests/test-applications/nestjs-8/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-8/tests/errors.test.ts index 72570f43efc4..2e50c90658ca 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-8/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-8/tests/errors.test.ts @@ -24,8 +24,8 @@ test('Sends exception to Sentry', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /test-exception/:id'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/nestjs-8/tests/span-decorator.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-8/tests/span-decorator.test.ts index 2aa097d5262c..57eca5bc9dfe 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-8/tests/span-decorator.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-8/tests/span-decorator.test.ts @@ -19,14 +19,14 @@ test('Transaction includes span and correct value for decorated async function', expect(transactionEvent.spans).toEqual( expect.arrayContaining([ expect.objectContaining({ - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'manual', 'sentry.op': 'wait and return a string', }, description: 'wait', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', op: 'wait and return a string', @@ -54,14 +54,14 @@ test('Transaction includes span and correct value for decorated sync function', expect(transactionEvent.spans).toEqual( expect.arrayContaining([ expect.objectContaining({ - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'manual', 'sentry.op': 'return a string', }, description: 'getString', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', op: 'return a string', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts index dc72d6c639e8..cab90847df50 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-8/tests/transactions.test.ts @@ -40,9 +40,9 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.http', }); @@ -59,12 +59,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { }, op: 'request_handler.express', description: '/test-transaction', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.express', }, { @@ -72,12 +72,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'test-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, { @@ -85,17 +85,17 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'child-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'auto.http.otel.nestjs', 'sentry.op': 'handler.nestjs', @@ -105,7 +105,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'nestjs.callback': 'testTransaction', }, description: 'testTransaction', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -141,14 +141,14 @@ test('API route transaction includes nest middleware span. Spans created in and expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleMiddleware', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -166,22 +166,22 @@ test('API route transaction includes nest middleware span. Spans created in and expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-controller-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-middleware-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -221,14 +221,14 @@ test('API route transaction includes nest guard span and span started in guard i expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleGuard', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -246,11 +246,11 @@ test('API route transaction includes nest guard span and span started in guard i expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-guard-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -285,14 +285,14 @@ test('API route transaction includes nest pipe span for valid request', async ({ expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ParseIntPipe', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -322,14 +322,14 @@ test('API route transaction includes nest pipe span for invalid request', async expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ParseIntPipe', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'unknown_error', @@ -361,14 +361,14 @@ test('API route transaction includes nest interceptor spans before route executi expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleInterceptor1', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -376,14 +376,14 @@ test('API route transaction includes nest interceptor spans before route executi origin: 'auto.middleware.nestjs', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleInterceptor2', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -405,33 +405,33 @@ test('API route transaction includes nest interceptor spans before route executi expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-controller-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-interceptor-span-1', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-interceptor-span-2', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -479,14 +479,14 @@ test('API route transaction includes exactly one nest interceptor span after rou expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'Interceptors - After Route', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -514,11 +514,11 @@ test('API route transaction includes exactly one nest interceptor span after rou expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-interceptor-span-after-route', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -561,14 +561,14 @@ test('API route transaction includes nest async interceptor spans before route e expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'AsyncInterceptor', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -588,22 +588,22 @@ test('API route transaction includes nest async interceptor spans before route e expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-controller-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-async-interceptor-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -646,14 +646,14 @@ test('API route transaction includes exactly one nest async interceptor span aft expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'Interceptors - After Route', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -681,11 +681,11 @@ test('API route transaction includes exactly one nest async interceptor span aft expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-async-interceptor-span-after-route', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-basic-with-graphql/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-basic-with-graphql/tests/errors.test.ts index 2071e436e133..babc9af99090 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-basic-with-graphql/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-basic-with-graphql/tests/errors.test.ts @@ -24,8 +24,8 @@ test('Sends exception to Sentry', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /test-exception/:id'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); @@ -112,7 +112,7 @@ test('Sends graphql exception to Sentry', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('POST /graphql'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/cron-decorator.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/cron-decorator.test.ts index 03ae6011d2b4..7896603b3bd9 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/cron-decorator.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/cron-decorator.test.ts @@ -35,8 +35,8 @@ test('Cron job triggers send of in_progress envelope', async ({ baseURL }) => { }, contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, }), @@ -51,8 +51,8 @@ test('Cron job triggers send of in_progress envelope', async ({ baseURL }) => { duration: expect.any(Number), contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, }), @@ -72,8 +72,8 @@ test('Sends exceptions to Sentry on error in cron job', async ({ baseURL }) => { expect(errorEvent.exception?.values).toHaveLength(1); expect(errorEvent.exception?.values?.[0]?.value).toBe('Test error from cron job'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); // kill cron so tests don't get stuck diff --git a/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/errors.test.ts index ee7d12dd22ca..7054f26562cb 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/errors.test.ts @@ -24,8 +24,8 @@ test('Sends exception to Sentry', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /test-exception/:id'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/span-decorator.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/span-decorator.test.ts index ee7666a50f18..b82213e6157a 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/span-decorator.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/span-decorator.test.ts @@ -19,14 +19,14 @@ test('Transaction includes span and correct value for decorated async function', expect(transactionEvent.spans).toEqual( expect.arrayContaining([ expect.objectContaining({ - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'manual', 'sentry.op': 'wait and return a string', }, description: 'wait', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', op: 'wait and return a string', @@ -54,14 +54,14 @@ test('Transaction includes span and correct value for decorated sync function', expect(transactionEvent.spans).toEqual( expect.arrayContaining([ expect.objectContaining({ - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'manual', 'sentry.op': 'return a string', }, description: 'getString', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', op: 'return a string', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts index a9c8ffea9117..c37eb8da7cc1 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-basic/tests/transactions.test.ts @@ -40,9 +40,9 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.http', }); @@ -59,12 +59,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { }, op: 'request_handler.express', description: '/test-transaction', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.express', }, { @@ -72,12 +72,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'test-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, { @@ -85,17 +85,17 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'child-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'auto.http.otel.nestjs', 'sentry.op': 'handler.nestjs', @@ -105,7 +105,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'nestjs.callback': 'testTransaction', }, description: 'testTransaction', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -141,14 +141,14 @@ test('API route transaction includes nest middleware span. Spans created in and expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleMiddleware', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -166,22 +166,22 @@ test('API route transaction includes nest middleware span. Spans created in and expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-controller-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-middleware-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -221,14 +221,14 @@ test('API route transaction includes nest guard span and span started in guard i expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleGuard', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -246,11 +246,11 @@ test('API route transaction includes nest guard span and span started in guard i expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-guard-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -285,14 +285,14 @@ test('API route transaction includes nest pipe span for valid request', async ({ expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ParseIntPipe', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -322,14 +322,14 @@ test('API route transaction includes nest pipe span for invalid request', async expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ParseIntPipe', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'unknown_error', @@ -361,14 +361,14 @@ test('API route transaction includes nest interceptor spans before route executi expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleInterceptor1', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -376,14 +376,14 @@ test('API route transaction includes nest interceptor spans before route executi origin: 'auto.middleware.nestjs', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleInterceptor2', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -405,33 +405,33 @@ test('API route transaction includes nest interceptor spans before route executi expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-controller-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-interceptor-span-1', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-interceptor-span-2', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -479,14 +479,14 @@ test('API route transaction includes exactly one nest interceptor span after rou expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'Interceptors - After Route', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -514,11 +514,11 @@ test('API route transaction includes exactly one nest interceptor span after rou expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-interceptor-span-after-route', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -561,14 +561,14 @@ test('API route transaction includes nest async interceptor spans before route e expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'AsyncInterceptor', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -588,22 +588,22 @@ test('API route transaction includes nest async interceptor spans before route e expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-controller-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-async-interceptor-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -646,14 +646,14 @@ test('API route transaction includes exactly one nest async interceptor span aft expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'Interceptors - After Route', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -681,11 +681,11 @@ test('API route transaction includes exactly one nest async interceptor span aft expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-async-interceptor-span-after-route', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/events.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/events.test.ts index b09eabb38980..227851d458cf 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/events.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/events.test.ts @@ -27,9 +27,9 @@ test('Event emitter', async () => { }); expect(successEventTransaction.contexts.trace).toEqual({ - parent_span_id: expect.any(String), - span_id: expect.any(String), - trace_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.source': 'custom', 'sentry.sample_rate': 1, diff --git a/dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/propagation.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/propagation.test.ts index d928deac08fd..f63b2ccf7b8e 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/propagation.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/propagation.test.ts @@ -78,7 +78,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.route': '/test-outgoing-http/:id', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -111,7 +111,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { }, op: 'http.server', parent_span_id: outgoingHttpSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -193,7 +193,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.route': '/test-outgoing-fetch/:id', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -226,7 +226,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { }), op: 'http.server', parent_span_id: outgoingHttpSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-graphql/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-graphql/tests/errors.test.ts index 48e0ef8c2c9f..0352557e7753 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-graphql/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-graphql/tests/errors.test.ts @@ -43,7 +43,7 @@ test('Sends exception to Sentry', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('POST /graphql'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/errors.test.ts index 94c742dd210a..89fd7a990138 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/errors.test.ts @@ -32,8 +32,8 @@ test('Sends unexpected exception to Sentry if thrown in module with global filte expect(errorEvent.transaction).toEqual('GET /example-module/unexpected-exception'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); @@ -68,8 +68,8 @@ test('Sends unexpected exception to Sentry if thrown in module with local filter expect(errorEvent.transaction).toEqual('GET /example-module-local-filter/unexpected-exception'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); @@ -106,8 +106,8 @@ test('Sends unexpected exception to Sentry if thrown in module that was register expect(errorEvent.transaction).toEqual('GET /example-module-registered-first/unexpected-exception'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts index 740ab6f5650c..5fb9c98ffc66 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules-decorator/tests/transactions.test.ts @@ -40,9 +40,9 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'http.route': '/example-module/transaction', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.http', }); @@ -59,12 +59,12 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { }, op: 'request_handler.express', description: '/example-module/transaction', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.express', }, { @@ -72,12 +72,12 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'test-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, { @@ -85,17 +85,17 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'child-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'auto.http.otel.nestjs', 'sentry.op': 'handler.nestjs', @@ -105,7 +105,7 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'nestjs.callback': 'testTransaction', }, description: 'testTransaction', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -142,14 +142,14 @@ test('API route transaction includes exception filter span for global filter in expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleExceptionFilter', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -181,14 +181,14 @@ test('API route transaction includes exception filter span for local filter in m expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'LocalExampleExceptionFilter', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -220,14 +220,14 @@ test('API route transaction includes exception filter span for global filter in expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleExceptionFilterRegisteredFirst', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', diff --git a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/errors.test.ts index 03d4679fa3c0..5501f058abbd 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/errors.test.ts @@ -24,8 +24,8 @@ test('Sends unexpected exception to Sentry if thrown in module with global filte expect(errorEvent.transaction).toEqual('GET /example-module/unexpected-exception'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); @@ -52,8 +52,8 @@ test('Sends unexpected exception to Sentry if thrown in module with local filter expect(errorEvent.transaction).toEqual('GET /example-module-local-filter/unexpected-exception'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); @@ -82,8 +82,8 @@ test('Sends unexpected exception to Sentry if thrown in module that was register expect(errorEvent.transaction).toEqual('GET /example-module-registered-first/unexpected-exception'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts index a2ea1db9c506..b95aa1fe4406 100644 --- a/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nestjs-with-submodules/tests/transactions.test.ts @@ -40,9 +40,9 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'http.route': '/example-module/transaction', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.http', }); @@ -59,12 +59,12 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { }, op: 'request_handler.express', description: '/example-module/transaction', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.express', }, { @@ -72,12 +72,12 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'test-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, { @@ -85,17 +85,17 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'child-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'auto.http.otel.nestjs', 'sentry.op': 'handler.nestjs', @@ -105,7 +105,7 @@ test('Sends an API route transaction from module', async ({ baseURL }) => { 'nestjs.callback': 'testTransaction', }, description: 'testTransaction', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -142,14 +142,14 @@ test('API route transaction includes exception filter span for global filter in expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleExceptionFilter', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -181,14 +181,14 @@ test('API route transaction includes exception filter span for local filter in m expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'LocalExampleExceptionFilter', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -220,14 +220,14 @@ test('API route transaction includes exception filter span for global filter in expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleExceptionFilterRegisteredFirst', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', diff --git a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/app-dir-pageloads.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/app-dir-pageloads.test.ts index d7d08eb22773..c656ade91202 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/app-dir-pageloads.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/app-dir-pageloads.test.ts @@ -30,8 +30,8 @@ test('should create a pageload transaction when the `app` directory is used', as }, op: 'pageload', origin: 'auto.pageload.nextjs.app_router_instrumentation', - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, environment: 'qa', diff --git a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/fetch.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/fetch.test.ts index 5b42e14269bc..a4608b2abab5 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/fetch.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/fetch.test.ts @@ -45,11 +45,11 @@ test('should correctly instrument `fetch` for performance tracing', async ({ pag }, description: 'GET http://example.com', op: 'http.client', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), status: expect.any(String), origin: 'auto.http.browser', }), diff --git a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/pages-dir-navigation.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/pages-dir-navigation.test.ts index 8bd128896b6c..1969429f3103 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/pages-dir-navigation.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/pages-dir-navigation.test.ts @@ -37,8 +37,8 @@ test('should report a navigation transaction for pages router navigations', asyn }, op: 'navigation', origin: 'auto.navigation.nextjs.pages_router_instrumentation', - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, platform: 'javascript', diff --git a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/pages-dir-pageload.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/pages-dir-pageload.test.ts index af59b41c2908..295fa762f636 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/pages-dir-pageload.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/pages-dir-pageload.test.ts @@ -30,8 +30,8 @@ test('should create a pageload transaction when the `pages` directory is used', }, op: 'pageload', origin: 'auto.pageload.nextjs.pages_router_instrumentation', - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, environment: 'qa', diff --git a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/cjs-api-endpoints.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/cjs-api-endpoints.test.ts index 8ef79f8cf146..42b2e3727bd6 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/cjs-api-endpoints.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/cjs-api-endpoints.test.ts @@ -44,9 +44,9 @@ test('should create a transaction for a CJS pages router API endpoint', async ({ }, op: 'http.server', origin: 'auto.http.nextjs', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, environment: 'qa', @@ -106,9 +106,9 @@ test('should not mess up require statements in CJS API endpoints', async ({ requ }, op: 'http.server', origin: 'auto.http.nextjs', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, environment: 'qa', diff --git a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/getServerSideProps.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/getServerSideProps.test.ts index 9ae79d7bd4b0..60f9842ca20e 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/getServerSideProps.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/getServerSideProps.test.ts @@ -17,7 +17,7 @@ test('Should report an error event for errors thrown in getServerSideProps', asy expect(await errorEventPromise).toMatchObject({ contexts: { - trace: { span_id: expect.any(String), trace_id: expect.any(String) }, + trace: { span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: expect.stringMatching(/[a-f0-9]{32}/) }, }, event_id: expect.any(String), exception: { @@ -65,9 +65,9 @@ test('Should report an error event for errors thrown in getServerSideProps', asy }, op: 'http.server', origin: 'auto', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'internal_error', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, event_id: expect.any(String), @@ -104,7 +104,7 @@ test('Should report an error event for errors thrown in getServerSideProps in pa expect(await errorEventPromise).toMatchObject({ contexts: { - trace: { span_id: expect.any(String), trace_id: expect.any(String) }, + trace: { span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: expect.stringMatching(/[a-f0-9]{32}/) }, }, event_id: expect.any(String), exception: { @@ -152,9 +152,9 @@ test('Should report an error event for errors thrown in getServerSideProps in pa }, op: 'http.server', origin: 'auto', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'internal_error', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, event_id: expect.any(String), diff --git a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/pages-router-api-endpoints.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/pages-router-api-endpoints.test.ts index 12196c08fcc1..36592b56fb94 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/pages-router-api-endpoints.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/pages-router-api-endpoints.test.ts @@ -20,7 +20,7 @@ test('Should report an error event for errors thrown in pages router api routes' expect(await errorEventPromise).toMatchObject({ contexts: { runtime: { name: 'node', version: expect.any(String) }, - trace: { span_id: expect.any(String), trace_id: expect.any(String) }, + trace: { span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: expect.stringMatching(/[a-f0-9]{32}/) }, }, exception: { values: [ @@ -60,7 +60,7 @@ test('Should report an error event for errors thrown in pages router api routes' }, op: 'http.server', origin: 'auto.http.nextjs', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'internal_error', trace_id: (await errorEventPromise).contexts?.trace?.trace_id, }, @@ -103,9 +103,9 @@ test('Should report a transaction event for a successful pages router api route' }, op: 'http.server', origin: 'auto.http.nextjs', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, platform: 'node', diff --git a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/server-component-error.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/server-component-error.test.ts index 0303fe6e583f..937d7c8da6c0 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/server-component-error.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/server-component-error.test.ts @@ -12,8 +12,8 @@ test('Should capture an error thrown in a server component', async ({ page }) => contexts: { runtime: { name: 'node', version: expect.any(String) }, trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, event_id: expect.any(String), diff --git a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/wrapApiHandlerWithSentry.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/wrapApiHandlerWithSentry.test.ts index 6b25cb6f74f7..3bcc1bbbea92 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/wrapApiHandlerWithSentry.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-13/tests/server/wrapApiHandlerWithSentry.test.ts @@ -40,9 +40,9 @@ cases.forEach(({ name, url, transactionName }) => { }, op: 'http.server', origin: 'auto.http.nextjs', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, platform: 'node', diff --git a/dev-packages/e2e-tests/test-applications/nextjs-14/tests/generation-functions.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-14/tests/generation-functions.test.ts index 28b9d8cab43f..346928c44ebc 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-14/tests/generation-functions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-14/tests/generation-functions.test.ts @@ -18,10 +18,10 @@ test('Should emit a span for a generateMetadata() function invocation', async ({ expect.objectContaining({ description: 'generateMetadata /generation-functions/page', origin: 'auto', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }), ); @@ -75,10 +75,10 @@ test('Should send a transaction event for a generateViewport() function invocati expect.objectContaining({ description: 'generateViewport /generation-functions/page', origin: 'auto', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }), ); }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/client-errors.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/client-errors.test.ts index d1ea09ac2c76..091c8fc1e46c 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/client-errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/client-errors.test.ts @@ -32,7 +32,7 @@ test('Sends a client-side exception to Sentry', async ({ page }) => { // Next.js >= 15 propagates a trace ID to the client via a meta tag. Also, only dev mode emits a meta tag because // the requested page is static and only in dev mode SSR is kicked off. parent_span_id: nextjsMajor >= 15 && isDevMode ? expect.any(String) : undefined, - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/middleware.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/middleware.test.ts index a00a29672ed6..14eb40f2d2dd 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/middleware.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/middleware.test.ts @@ -82,12 +82,12 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru description: 'GET http://localhost:3030/', op: 'http.client', origin: 'auto.http.wintercg_fetch', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, ]), ); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/server-components.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/server-components.test.ts index ff61cb3bd682..f2e73c892a9b 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/server-components.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/server-components.test.ts @@ -28,9 +28,9 @@ test('Sends a transaction for a request to app router', async ({ page }) => { }), op: 'http.server', origin: 'auto', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(transactionEvent.request).toEqual({ diff --git a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/transactions.test.ts index cc22b9da1a40..fa5cd062d862 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-app-dir/tests/transactions.test.ts @@ -29,8 +29,8 @@ test('Sends a pageload transaction', async ({ page }) => { // Next.js >= 15 propagates a trace ID to the client via a meta tag. Also, only dev mode emits a meta tag because // the requested page is static and only in dev mode SSR is kicked off. parent_span_id: nextjsMajor >= 15 && isDevMode ? expect.any(String) : undefined, - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), op: 'pageload', origin: 'auto.pageload.nextjs.app_router_instrumentation', data: expect.objectContaining({ diff --git a/dev-packages/e2e-tests/test-applications/node-connect/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/node-connect/tests/errors.test.ts index e0b39ed16bc5..2aa569915eb4 100644 --- a/dev-packages/e2e-tests/test-applications/node-connect/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-connect/tests/errors.test.ts @@ -23,7 +23,7 @@ test('Sends correct error event', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /test-exception'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-connect/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-connect/tests/transactions.test.ts index f0da250d8be9..ec02acca77d6 100644 --- a/dev-packages/e2e-tests/test-applications/node-connect/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-connect/tests/transactions.test.ts @@ -41,9 +41,9 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.http', }); @@ -55,12 +55,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'test-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, { @@ -73,12 +73,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { }, op: 'request_handler.connect', description: '/test-transaction', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.connect', }, ], diff --git a/dev-packages/e2e-tests/test-applications/node-express-cjs-preload/tests/server.test.ts b/dev-packages/e2e-tests/test-applications/node-express-cjs-preload/tests/server.test.ts index 5316cc377358..75e718016a90 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-cjs-preload/tests/server.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-cjs-preload/tests/server.test.ts @@ -72,12 +72,12 @@ test('Should record a transaction for route with parameters', async ({ request } op: 'middleware.express', description: 'query', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spans).toContainEqual({ @@ -91,12 +91,12 @@ test('Should record a transaction for route with parameters', async ({ request } op: 'middleware.express', description: 'expressInit', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spans).toContainEqual({ @@ -110,11 +110,11 @@ test('Should record a transaction for route with parameters', async ({ request } op: 'request_handler.express', description: '/test-transaction/:param', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts b/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts index 06e2c2e09434..a1b596072a6a 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-esm-loader/tests/server.test.ts @@ -72,12 +72,12 @@ test('Should record a transaction for route with parameters', async ({ request } op: 'middleware.express', description: 'query', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spans).toContainEqual({ @@ -91,12 +91,12 @@ test('Should record a transaction for route with parameters', async ({ request } op: 'middleware.express', description: 'expressInit', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spans).toContainEqual({ @@ -110,11 +110,11 @@ test('Should record a transaction for route with parameters', async ({ request } op: 'request_handler.express', description: '/test-transaction/:param', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-express-esm-preload/tests/server.test.ts b/dev-packages/e2e-tests/test-applications/node-express-esm-preload/tests/server.test.ts index 9d6b10a3dd74..2f3208a33bbb 100644 --- a/dev-packages/e2e-tests/test-applications/node-express-esm-preload/tests/server.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express-esm-preload/tests/server.test.ts @@ -72,12 +72,12 @@ test('Should record a transaction for route with parameters', async ({ request } op: 'middleware.express', description: 'query', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spans).toContainEqual({ @@ -91,12 +91,12 @@ test('Should record a transaction for route with parameters', async ({ request } op: 'middleware.express', description: 'expressInit', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spans).toContainEqual({ @@ -110,12 +110,12 @@ test('Should record a transaction for route with parameters', async ({ request } op: 'request_handler.express', description: '/test-transaction/:param', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); @@ -133,8 +133,8 @@ test.skip('Should record spans from http instrumentation', async ({ request }) = const httpClientSpan = transactionEvent.spans?.find(span => span.op === 'http.client'); expect(httpClientSpan).toEqual({ - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'http.flavor': '1.1', 'http.host': 'example.com:80', @@ -155,7 +155,7 @@ test.skip('Should record spans from http instrumentation', async ({ request }) = url: 'http://example.com/', }, description: 'GET http://example.com/', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', diff --git a/dev-packages/e2e-tests/test-applications/node-express/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/node-express/tests/errors.test.ts index 0a61c8665e30..bf0c5c5fb6b2 100644 --- a/dev-packages/e2e-tests/test-applications/node-express/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express/tests/errors.test.ts @@ -23,8 +23,8 @@ test('Sends correct error event', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /test-exception/:id'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts index fede408d258e..3b51ae415b03 100644 --- a/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-express/tests/transactions.test.ts @@ -40,9 +40,9 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.http', }); @@ -69,12 +69,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { description: 'query', op: 'middleware.express', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spans).toContainEqual({ @@ -88,12 +88,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { description: 'expressInit', op: 'middleware.express', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spans).toContainEqual({ @@ -107,12 +107,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { description: '/test-transaction', op: 'request_handler.express', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); @@ -147,12 +147,12 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) description: 'query', op: 'middleware.express', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spans).toContainEqual({ @@ -166,12 +166,12 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) description: 'expressInit', op: 'middleware.express', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spans).toContainEqual({ @@ -185,11 +185,11 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) description: '/test-exception/:id', op: 'request_handler.express', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/errors.test.ts index 67b27a6c0e5e..55a59fc90080 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/errors.test.ts @@ -23,7 +23,7 @@ test('Sends correct error event', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /test-exception/:id'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/propagation.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/propagation.test.ts index 050ce19c6a3c..ad15e187ea01 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/propagation.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify-5/tests/propagation.test.ts @@ -78,7 +78,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.route': '/test-outgoing-http/:id', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -111,7 +111,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { }, op: 'http.server', parent_span_id: outgoingHttpSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -193,7 +193,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.route': '/test-outgoing-fetch/:id', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -226,7 +226,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { }), op: 'http.server', parent_span_id: outgoingHttpSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', 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 6ca2d19f3b32..d226009dcc1f 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 @@ -40,9 +40,9 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.http', }); @@ -68,12 +68,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { }, description: 'sentry-fastify-error-handler', op: 'middleware.fastify', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.fastify', }); @@ -87,12 +87,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { }, description: 'sentry-fastify-error-handler', op: 'request_handler.fastify', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.fastify', }); @@ -101,12 +101,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'test-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }); @@ -115,12 +115,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'child-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-fastify/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify/tests/errors.test.ts index 3ef2bba479db..4e147b969199 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify/tests/errors.test.ts @@ -23,7 +23,7 @@ test('Sends correct error event', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /test-exception/:id'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-fastify/tests/propagation.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify/tests/propagation.test.ts index d2e9a188da9f..ee83d3d4af2b 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify/tests/propagation.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify/tests/propagation.test.ts @@ -78,7 +78,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.route': '/test-outgoing-http/:id', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -111,7 +111,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { }, op: 'http.server', parent_span_id: outgoingHttpSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -193,7 +193,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.route': '/test-outgoing-fetch/:id', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -226,7 +226,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { }), op: 'http.server', parent_span_id: outgoingHttpSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', diff --git a/dev-packages/e2e-tests/test-applications/node-fastify/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-fastify/tests/transactions.test.ts index c9cb53afb94c..01e07538dc72 100644 --- a/dev-packages/e2e-tests/test-applications/node-fastify/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-fastify/tests/transactions.test.ts @@ -40,9 +40,9 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.http', }); @@ -68,12 +68,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { }, description: 'sentry-fastify-error-handler', op: 'middleware.fastify', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.fastify', }); @@ -87,12 +87,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { }, description: 'sentry-fastify-error-handler', op: 'request_handler.fastify', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.fastify', }); @@ -101,12 +101,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'test-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }); @@ -115,12 +115,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'child-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-hapi/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/node-hapi/tests/errors.test.ts index f28250f26f3c..6531b83baa8e 100644 --- a/dev-packages/e2e-tests/test-applications/node-hapi/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-hapi/tests/errors.test.ts @@ -17,8 +17,8 @@ test('Sends thrown error to Sentry', async ({ baseURL }) => { expect(transactionEvent.transaction).toBe('GET /test-failure'); expect(transactionEvent.contexts?.trace).toMatchObject({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); expect(errorEvent.exception?.values).toHaveLength(1); @@ -34,8 +34,8 @@ test('Sends thrown error to Sentry', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /test-failure'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); expect(errorEvent.contexts?.trace?.trace_id).toBe(transactionEvent.contexts?.trace?.trace_id); diff --git a/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts index c3237de74a5a..3f332992d0e7 100644 --- a/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts @@ -39,9 +39,9 @@ test('Sends successful transaction', async ({ baseURL }) => { 'http.route': '/test-success', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.http', }); @@ -69,12 +69,12 @@ test('Sends successful transaction', async ({ baseURL }) => { description: 'GET /test-success', op: 'router.hapi', origin: 'auto.http.otel.hapi', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, { // this comes from "onPreResponse" @@ -87,12 +87,12 @@ test('Sends successful transaction', async ({ baseURL }) => { description: 'ext - onPreResponse', op: 'server.ext.hapi', origin: 'auto.http.otel.hapi', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, ]); }); diff --git a/dev-packages/e2e-tests/test-applications/node-koa/tests/assert.test.ts b/dev-packages/e2e-tests/test-applications/node-koa/tests/assert.test.ts index 0f9f724ef237..1180303eb708 100644 --- a/dev-packages/e2e-tests/test-applications/node-koa/tests/assert.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-koa/tests/assert.test.ts @@ -24,8 +24,8 @@ test('Returns 400 from failed assert', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /test-assert/:condition'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-koa/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/node-koa/tests/errors.test.ts index 1fbb1fd42613..f28bb17372bd 100644 --- a/dev-packages/e2e-tests/test-applications/node-koa/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-koa/tests/errors.test.ts @@ -23,7 +23,7 @@ test('Sends correct error event', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /test-exception/:id'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-koa/tests/propagation.test.ts b/dev-packages/e2e-tests/test-applications/node-koa/tests/propagation.test.ts index 1f5413af0cbe..b62891265863 100644 --- a/dev-packages/e2e-tests/test-applications/node-koa/tests/propagation.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-koa/tests/propagation.test.ts @@ -78,7 +78,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.route': '/test-outgoing-http/:id', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -111,7 +111,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { }, op: 'http.server', parent_span_id: outgoingHttpSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -193,7 +193,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.route': '/test-outgoing-fetch/:id', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -226,7 +226,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { }), op: 'http.server', parent_span_id: outgoingHttpSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', 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 1197575d1a96..966dbc5937e3 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 @@ -40,9 +40,9 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.http', }); @@ -65,12 +65,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { description: 'bodyParser', op: 'middleware.koa', origin: 'auto.http.otel.koa', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, { data: { @@ -82,12 +82,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { op: 'middleware.koa', origin: 'auto.http.otel.koa', description: '< unknown >', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, { data: { @@ -99,12 +99,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { }, op: 'router.koa', description: '/test-transaction', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.koa', }, { @@ -112,12 +112,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'test-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, { @@ -125,12 +125,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'child-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, ]); diff --git a/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/cron-decorator.test.ts b/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/cron-decorator.test.ts index 1475a1449f44..dc4c98aebf40 100644 --- a/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/cron-decorator.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/cron-decorator.test.ts @@ -27,8 +27,8 @@ test('Cron job triggers send of in_progress envelope', async ({ baseURL }) => { }, contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, }), @@ -43,8 +43,8 @@ test('Cron job triggers send of in_progress envelope', async ({ baseURL }) => { duration: expect.any(Number), contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, }), diff --git a/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/errors.test.ts index 0155c3887805..491a64e7166c 100644 --- a/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/errors.test.ts @@ -24,8 +24,8 @@ test('Sends exception to Sentry', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /test-exception/:id'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/span-decorator.test.ts b/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/span-decorator.test.ts index 831dfd4400dc..fa155b6dd674 100644 --- a/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/span-decorator.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/span-decorator.test.ts @@ -19,14 +19,14 @@ test('Transaction includes span and correct value for decorated async function', expect(transactionEvent.spans).toEqual( expect.arrayContaining([ expect.objectContaining({ - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'manual', 'sentry.op': 'wait and return a string', }, description: 'wait', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', op: 'wait and return a string', @@ -54,14 +54,14 @@ test('Transaction includes span and correct value for decorated sync function', expect(transactionEvent.spans).toEqual( expect.arrayContaining([ expect.objectContaining({ - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'manual', 'sentry.op': 'return a string', }, description: 'getString', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', op: 'return a string', diff --git a/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/transactions.test.ts index 23855d1f55b8..0245b7fdb7b3 100644 --- a/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-nestjs-basic/tests/transactions.test.ts @@ -40,9 +40,9 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.http', }); @@ -59,12 +59,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { }, op: 'request_handler.express', description: '/test-transaction', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.express', }, { @@ -72,12 +72,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'test-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, { @@ -85,17 +85,17 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'sentry.origin': 'manual', }, description: 'child-span', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'auto.http.otel.nestjs', 'sentry.op': 'handler.nestjs', @@ -105,7 +105,7 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'nestjs.callback': 'testTransaction', }, description: 'testTransaction', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -141,14 +141,14 @@ test('API route transaction includes nest middleware span. Spans created in and expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleMiddleware', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -166,22 +166,22 @@ test('API route transaction includes nest middleware span. Spans created in and expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-controller-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-middleware-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -221,14 +221,14 @@ test('API route transaction includes nest guard span and span started in guard i expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleGuard', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -246,11 +246,11 @@ test('API route transaction includes nest guard span and span started in guard i expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-guard-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -284,14 +284,14 @@ test('API route transaction includes nest pipe span for valid request', async ({ expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ParseIntPipe', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -320,14 +320,14 @@ test('API route transaction includes nest pipe span for invalid request', async expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ParseIntPipe', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'unknown_error', @@ -359,14 +359,14 @@ test('API route transaction includes nest interceptor spans before route executi expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleInterceptor1', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -374,14 +374,14 @@ test('API route transaction includes nest interceptor spans before route executi origin: 'auto.middleware.nestjs', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'ExampleInterceptor2', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -403,33 +403,33 @@ test('API route transaction includes nest interceptor spans before route executi expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-controller-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-interceptor-span-1', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-interceptor-span-2', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -477,14 +477,14 @@ test('API route transaction includes exactly one nest interceptor span after rou expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'Interceptors - After Route', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -512,11 +512,11 @@ test('API route transaction includes exactly one nest interceptor span after rou expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-interceptor-span-after-route', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -559,14 +559,14 @@ test('API route transaction includes nest async interceptor spans before route e expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'AsyncInterceptor', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -586,22 +586,22 @@ test('API route transaction includes nest async interceptor spans before route e expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-controller-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', origin: 'manual', }, { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-async-interceptor-span', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -644,14 +644,14 @@ test('API route transaction includes exactly one nest async interceptor span aft expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.op': 'middleware.nestjs', 'sentry.origin': 'auto.middleware.nestjs', }, description: 'Interceptors - After Route', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -679,11 +679,11 @@ test('API route transaction includes exactly one nest async interceptor span aft expect.objectContaining({ spans: expect.arrayContaining([ { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: expect.any(Object), description: 'test-async-interceptor-span-after-route', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', diff --git a/dev-packages/e2e-tests/test-applications/node-nestjs-distributed-tracing/tests/propagation.test.ts b/dev-packages/e2e-tests/test-applications/node-nestjs-distributed-tracing/tests/propagation.test.ts index 49b827ca7e27..ee95224ed26a 100644 --- a/dev-packages/e2e-tests/test-applications/node-nestjs-distributed-tracing/tests/propagation.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-nestjs-distributed-tracing/tests/propagation.test.ts @@ -78,7 +78,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { 'http.route': '/test-outgoing-http/:id', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -111,7 +111,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => { }, op: 'http.server', parent_span_id: outgoingHttpSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -193,7 +193,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { 'http.route': '/test-outgoing-fetch/:id', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', @@ -226,7 +226,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => { }), op: 'http.server', parent_span_id: outgoingHttpSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', trace_id: traceId, origin: 'auto.http.otel.http', diff --git a/dev-packages/e2e-tests/test-applications/node-otel-custom-sampler/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/node-otel-custom-sampler/tests/errors.test.ts index 18d14cd12080..4627c86bf03f 100644 --- a/dev-packages/e2e-tests/test-applications/node-otel-custom-sampler/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-otel-custom-sampler/tests/errors.test.ts @@ -23,7 +23,7 @@ test('Sends correct error event', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /test-exception/:id'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-otel-custom-sampler/tests/sampling.test.ts b/dev-packages/e2e-tests/test-applications/node-otel-custom-sampler/tests/sampling.test.ts index cb374ec8d440..c3e40d06d6b0 100644 --- a/dev-packages/e2e-tests/test-applications/node-otel-custom-sampler/tests/sampling.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-otel-custom-sampler/tests/sampling.test.ts @@ -11,8 +11,8 @@ test('Sends a sampled API route transaction', async ({ baseURL }) => { const transactionEvent = await transactionEventPromise; expect(transactionEvent.contexts?.trace).toEqual({ - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.source': 'route', 'sentry.op': 'http.server', @@ -45,8 +45,8 @@ test('Sends a sampled API route transaction', async ({ baseURL }) => { expect(transactionEvent.spans?.length).toBe(4); expect(transactionEvent.spans).toContainEqual({ - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'auto.http.otel.express', 'sentry.op': 'middleware.express', @@ -55,7 +55,7 @@ test('Sends a sampled API route transaction', async ({ baseURL }) => { 'express.type': 'middleware', }, description: 'query', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -64,8 +64,8 @@ test('Sends a sampled API route transaction', async ({ baseURL }) => { }); expect(transactionEvent.spans).toContainEqual({ - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'auto.http.otel.express', 'sentry.op': 'middleware.express', @@ -74,7 +74,7 @@ test('Sends a sampled API route transaction', async ({ baseURL }) => { 'express.type': 'middleware', }, description: 'expressInit', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -83,8 +83,8 @@ test('Sends a sampled API route transaction', async ({ baseURL }) => { }); expect(transactionEvent.spans).toContainEqual({ - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'auto.http.otel.express', 'sentry.op': 'request_handler.express', @@ -93,7 +93,7 @@ test('Sends a sampled API route transaction', async ({ baseURL }) => { 'express.type': 'request_handler', }, description: '/task', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', @@ -102,14 +102,14 @@ test('Sends a sampled API route transaction', async ({ baseURL }) => { }); expect(transactionEvent.spans).toContainEqual({ - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { 'sentry.origin': 'manual', 'sentry.op': 'custom.op', }, description: 'Long task', - parent_span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), status: 'ok', diff --git a/dev-packages/e2e-tests/test-applications/node-otel-sdk-node/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/node-otel-sdk-node/tests/errors.test.ts index 7dbb66a4119d..bb3c8c70b629 100644 --- a/dev-packages/e2e-tests/test-applications/node-otel-sdk-node/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-otel-sdk-node/tests/errors.test.ts @@ -23,7 +23,7 @@ test('Sends correct error event', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /test-exception/:id'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-otel-sdk-node/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/node-otel-sdk-node/tests/transactions.test.ts index ebf500ffb09c..0f978f72cf57 100644 --- a/dev-packages/e2e-tests/test-applications/node-otel-sdk-node/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-otel-sdk-node/tests/transactions.test.ts @@ -52,9 +52,9 @@ test('Sends an API route transaction', async ({ baseURL }) => { 'http.route': '/test-transaction', }, op: 'http.server', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.otel.http', }); @@ -81,12 +81,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { description: 'query', op: 'middleware.express', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spans).toContainEqual({ @@ -100,12 +100,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { description: 'expressInit', op: 'middleware.express', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spans).toContainEqual({ @@ -119,12 +119,12 @@ test('Sends an API route transaction', async ({ baseURL }) => { description: '/test-transaction', op: 'request_handler.express', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); @@ -159,12 +159,12 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) description: 'query', op: 'middleware.express', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spans).toContainEqual({ @@ -178,12 +178,12 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) description: 'expressInit', op: 'middleware.express', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spans).toContainEqual({ @@ -197,11 +197,11 @@ test('Sends an API route transaction for an errored route', async ({ baseURL }) description: '/test-exception/:id', op: 'request_handler.express', origin: 'auto.http.otel.express', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/node-otel-without-tracing/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/node-otel-without-tracing/tests/errors.test.ts index 36231f87a464..5e44ed93fa6c 100644 --- a/dev-packages/e2e-tests/test-applications/node-otel-without-tracing/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/node-otel-without-tracing/tests/errors.test.ts @@ -24,8 +24,8 @@ test('Sends correct error event', async ({ baseURL }) => { expect(errorEvent.transaction).toEqual('GET /test-exception/123'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3-min/tests/tracing.client.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-3-min/tests/tracing.client.test.ts index 9d0b3c694a1c..b726636974c9 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3-min/tests/tracing.client.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-3-min/tests/tracing.client.test.ts @@ -45,11 +45,11 @@ test('sends component tracking spans when `trackComponents` is enabled', async ( data: { 'sentry.origin': 'auto.ui.vue', 'sentry.op': 'ui.vue.mount' }, description: 'Vue ', op: 'ui.vue.mount', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.ui.vue', }; diff --git a/dev-packages/e2e-tests/test-applications/nuxt-3/tests/tracing.client.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-3/tests/tracing.client.test.ts index 76b2a9094531..f779bbcee69f 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-3/tests/tracing.client.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-3/tests/tracing.client.test.ts @@ -45,11 +45,11 @@ test('sends component tracking spans when `trackComponents` is enabled', async ( data: { 'sentry.origin': 'auto.ui.vue', 'sentry.op': 'ui.vue.mount' }, description: 'Vue ', op: 'ui.vue.mount', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.ui.vue', }; diff --git a/dev-packages/e2e-tests/test-applications/nuxt-4/tests/tracing.client.test.ts b/dev-packages/e2e-tests/test-applications/nuxt-4/tests/tracing.client.test.ts index 9119e279e491..d1f2b4fdea47 100644 --- a/dev-packages/e2e-tests/test-applications/nuxt-4/tests/tracing.client.test.ts +++ b/dev-packages/e2e-tests/test-applications/nuxt-4/tests/tracing.client.test.ts @@ -45,11 +45,11 @@ test('sends component tracking spans when `trackComponents` is enabled', async ( data: { 'sentry.origin': 'auto.ui.vue', 'sentry.op': 'ui.vue.mount' }, description: 'Vue ', op: 'ui.vue.mount', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.ui.vue', }; diff --git a/dev-packages/e2e-tests/test-applications/react-17/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/react-17/tests/errors.test.ts index 444e30fc0067..7088cd12e3bf 100644 --- a/dev-packages/e2e-tests/test-applications/react-17/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-17/tests/errors.test.ts @@ -24,8 +24,8 @@ test('Sends correct error event', async ({ page }) => { expect(errorEvent.transaction).toEqual('/'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/react-17/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/react-17/tests/transactions.test.ts index 3b9c5ab1fdaf..58e3df1ee8d6 100644 --- a/dev-packages/e2e-tests/test-applications/react-17/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-17/tests/transactions.test.ts @@ -86,11 +86,11 @@ test('sends an INP span', async ({ page }) => { }, description: 'body > div#root > input#exception-button[type="button"]', op: 'ui.interaction.click', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.browser.inp', exclusive_time: expect.any(Number), measurements: { inp: { unit: 'millisecond', value: expect.any(Number) } }, diff --git a/dev-packages/e2e-tests/test-applications/react-create-hash-router/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/react-create-hash-router/tests/errors.test.ts index 1602f10c3e3e..9a5675b8698a 100644 --- a/dev-packages/e2e-tests/test-applications/react-create-hash-router/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-create-hash-router/tests/errors.test.ts @@ -24,7 +24,7 @@ test('Captures exception correctly', async ({ page }) => { expect(errorEvent.transaction).toEqual('/'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/react-create-hash-router/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/react-create-hash-router/tests/transactions.test.ts index 7fd15646dff2..7abb269d15b0 100644 --- a/dev-packages/e2e-tests/test-applications/react-create-hash-router/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-create-hash-router/tests/transactions.test.ts @@ -28,8 +28,8 @@ test('Captures a pageload transaction', async ({ page }) => { 'lcp.loadTime': expect.any(Number), }, op: 'pageload', - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.pageload.react.reactrouter_v6', }); @@ -50,11 +50,11 @@ test('Captures a pageload transaction', async ({ page }) => { }, description: page.url(), op: 'browser.domContentLoadedEvent', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.ui.browser.metrics', }); expect(transactionEvent.spans).toContainEqual({ @@ -64,11 +64,11 @@ test('Captures a pageload transaction', async ({ page }) => { }, description: page.url(), op: 'browser.connect', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.ui.browser.metrics', }); expect(transactionEvent.spans).toContainEqual({ @@ -78,11 +78,11 @@ test('Captures a pageload transaction', async ({ page }) => { }, description: page.url(), op: 'browser.request', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.ui.browser.metrics', }); expect(transactionEvent.spans).toContainEqual({ @@ -92,11 +92,11 @@ test('Captures a pageload transaction', async ({ page }) => { }, description: page.url(), op: 'browser.response', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.ui.browser.metrics', }); }); @@ -123,8 +123,8 @@ test('Captures a navigation transaction', async ({ page }) => { 'sentry.source': 'route', }), op: 'navigation', - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.navigation.react.reactrouter_v6', }); diff --git a/dev-packages/e2e-tests/test-applications/react-router-5/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/react-router-5/tests/errors.test.ts index 11ba3f8df5d5..96b4a042c08b 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-5/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-router-5/tests/errors.test.ts @@ -24,8 +24,8 @@ test('Sends correct error event', async ({ page }) => { expect(errorEvent.transaction).toEqual('/'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/react-router-6-use-routes/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/react-router-6-use-routes/tests/errors.test.ts index 10fea8625a51..272025d95877 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-6-use-routes/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-router-6-use-routes/tests/errors.test.ts @@ -24,8 +24,8 @@ test('Sends correct error event', async ({ page }) => { expect(errorEvent.transaction).toEqual('/'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/react-router-6/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/react-router-6/tests/errors.test.ts index 8ffbfcae282a..e34699420ccf 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-6/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-router-6/tests/errors.test.ts @@ -24,8 +24,8 @@ test('Sends correct error event', async ({ page }) => { expect(errorEvent.transaction).toEqual('/'); expect(errorEvent.contexts?.trace).toEqual({ - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }); }); diff --git a/dev-packages/e2e-tests/test-applications/react-router-6/tests/transactions.test.ts b/dev-packages/e2e-tests/test-applications/react-router-6/tests/transactions.test.ts index 3f108931b00e..555e0655c52e 100644 --- a/dev-packages/e2e-tests/test-applications/react-router-6/tests/transactions.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-router-6/tests/transactions.test.ts @@ -86,11 +86,11 @@ test('sends an INP span', async ({ page }) => { }, description: 'body > div#root > input#exception-button[type="button"]', op: 'ui.interaction.click', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.http.browser.inp', exclusive_time: expect.any(Number), measurements: { inp: { unit: 'millisecond', value: expect.any(Number) } }, diff --git a/dev-packages/node-integration-tests/suites/anr/test.ts b/dev-packages/node-integration-tests/suites/anr/test.ts index 0352212a8293..b23dc0a7ffa9 100644 --- a/dev-packages/node-integration-tests/suites/anr/test.ts +++ b/dev-packages/node-integration-tests/suites/anr/test.ts @@ -6,8 +6,8 @@ const ANR_EVENT = { // Ensure we have context contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, device: { arch: expect.any(String), diff --git a/dev-packages/node-integration-tests/suites/cron/cron/test.ts b/dev-packages/node-integration-tests/suites/cron/cron/test.ts index ee83f4dc1226..acd7815aebe1 100644 --- a/dev-packages/node-integration-tests/suites/cron/cron/test.ts +++ b/dev-packages/node-integration-tests/suites/cron/cron/test.ts @@ -15,8 +15,8 @@ test('cron instrumentation', done => { monitor_config: { schedule: { type: 'crontab', value: '* * * * * *' } }, contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }, }, }, @@ -30,8 +30,8 @@ test('cron instrumentation', done => { duration: expect.any(Number), contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }, }, }, @@ -45,8 +45,8 @@ test('cron instrumentation', done => { monitor_config: { schedule: { type: 'crontab', value: '* * * * * *' } }, contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }, }, }, @@ -60,8 +60,8 @@ test('cron instrumentation', done => { duration: expect.any(Number), contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }, }, }, diff --git a/dev-packages/node-integration-tests/suites/cron/node-cron/test.ts b/dev-packages/node-integration-tests/suites/cron/node-cron/test.ts index 2c3be50907a3..904da8180087 100644 --- a/dev-packages/node-integration-tests/suites/cron/node-cron/test.ts +++ b/dev-packages/node-integration-tests/suites/cron/node-cron/test.ts @@ -15,8 +15,8 @@ test('node-cron instrumentation', done => { monitor_config: { schedule: { type: 'crontab', value: '* * * * * *' } }, contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }, }, }, @@ -30,8 +30,8 @@ test('node-cron instrumentation', done => { duration: expect.any(Number), contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }, }, }, @@ -45,8 +45,8 @@ test('node-cron instrumentation', done => { monitor_config: { schedule: { type: 'crontab', value: '* * * * * *' } }, contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }, }, }, @@ -60,8 +60,8 @@ test('node-cron instrumentation', done => { duration: expect.any(Number), contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }, }, }, diff --git a/dev-packages/node-integration-tests/suites/cron/node-schedule/test.ts b/dev-packages/node-integration-tests/suites/cron/node-schedule/test.ts index 84d94c54ad8d..74d815e56c88 100644 --- a/dev-packages/node-integration-tests/suites/cron/node-schedule/test.ts +++ b/dev-packages/node-integration-tests/suites/cron/node-schedule/test.ts @@ -15,8 +15,8 @@ test('node-schedule instrumentation', done => { monitor_config: { schedule: { type: 'crontab', value: '* * * * * *' } }, contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }, }, }, @@ -30,8 +30,8 @@ test('node-schedule instrumentation', done => { duration: expect.any(Number), contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }, }, }, @@ -45,8 +45,8 @@ test('node-schedule instrumentation', done => { monitor_config: { schedule: { type: 'crontab', value: '* * * * * *' } }, contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }, }, }, @@ -60,8 +60,8 @@ test('node-schedule instrumentation', done => { duration: expect.any(Number), contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), }, }, }, diff --git a/dev-packages/node-integration-tests/suites/express/tracing/test.ts b/dev-packages/node-integration-tests/suites/express/tracing/test.ts index 0b56d354759c..1c1d8439822d 100644 --- a/dev-packages/node-integration-tests/suites/express/tracing/test.ts +++ b/dev-packages/node-integration-tests/suites/express/tracing/test.ts @@ -12,8 +12,8 @@ describe('express tracing', () => { transaction: { contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { url: expect.stringMatching(/\/test\/express$/), 'http.response.status_code': 200, @@ -58,8 +58,8 @@ describe('express tracing', () => { }, contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), data: { url: expect.stringMatching(/\/test\/regex$/), 'http.response.status_code': 200, @@ -86,8 +86,8 @@ describe('express tracing', () => { }, contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), data: { url: expect.stringMatching(`/test/${segment}$`), 'http.response.status_code': 200, @@ -122,8 +122,8 @@ describe('express tracing', () => { }, contexts: { trace: { - trace_id: expect.any(String), - span_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), data: { url: expect.stringMatching(`/test/${segment}$`), 'http.response.status_code': 200, diff --git a/dev-packages/node-integration-tests/suites/public-api/startSpan/parallel-spans-in-scope-with-parentSpanId/test.ts b/dev-packages/node-integration-tests/suites/public-api/startSpan/parallel-spans-in-scope-with-parentSpanId/test.ts index 9a561ffd391a..b0f79680eea7 100644 --- a/dev-packages/node-integration-tests/suites/public-api/startSpan/parallel-spans-in-scope-with-parentSpanId/test.ts +++ b/dev-packages/node-integration-tests/suites/public-api/startSpan/parallel-spans-in-scope-with-parentSpanId/test.ts @@ -11,7 +11,7 @@ test('should send manually started parallel root spans outside of root context w transaction: 'test_span_1', contexts: { trace: { - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), parent_span_id: '1234567890123456', trace_id: '12345678901234567890123456789012', }, @@ -23,7 +23,7 @@ test('should send manually started parallel root spans outside of root context w transaction: 'test_span_2', contexts: { trace: { - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), parent_span_id: '1234567890123456', trace_id: '12345678901234567890123456789012', }, diff --git a/dev-packages/node-integration-tests/suites/tracing/dsc-txn-name-update/test.ts b/dev-packages/node-integration-tests/suites/tracing/dsc-txn-name-update/test.ts index cefaba1ad97f..82f86baa835f 100644 --- a/dev-packages/node-integration-tests/suites/tracing/dsc-txn-name-update/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/dsc-txn-name-update/test.ts @@ -67,7 +67,7 @@ test('adds current transaction name to trace envelope header when the txn name i release: '1.0', sample_rate: '1', sampled: 'true', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, }) @@ -79,7 +79,7 @@ test('adds current transaction name to trace envelope header when the txn name i release: '1.0', sample_rate: '1', sampled: 'true', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), transaction: 'updated-name-1', }, }, @@ -92,7 +92,7 @@ test('adds current transaction name to trace envelope header when the txn name i release: '1.0', sample_rate: '1', sampled: 'true', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), transaction: 'updated-name-2', }, }, @@ -105,7 +105,7 @@ test('adds current transaction name to trace envelope header when the txn name i release: '1.0', sample_rate: '1', sampled: 'true', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), transaction: 'updated-name-2', }, }, diff --git a/dev-packages/node-integration-tests/suites/tracing/envelope-header/error-active-span-unsampled/test.ts b/dev-packages/node-integration-tests/suites/tracing/envelope-header/error-active-span-unsampled/test.ts index c962bc36800d..8ac2dd53a089 100644 --- a/dev-packages/node-integration-tests/suites/tracing/envelope-header/error-active-span-unsampled/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/envelope-header/error-active-span-unsampled/test.ts @@ -6,7 +6,7 @@ test('envelope header for error event during active unsampled span is correct', .expectHeader({ event: { trace: { - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), public_key: 'public', environment: 'production', release: '1.0', diff --git a/dev-packages/node-integration-tests/suites/tracing/envelope-header/error-active-span/test.ts b/dev-packages/node-integration-tests/suites/tracing/envelope-header/error-active-span/test.ts index f81364dec824..6749f275035b 100644 --- a/dev-packages/node-integration-tests/suites/tracing/envelope-header/error-active-span/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/envelope-header/error-active-span/test.ts @@ -6,7 +6,7 @@ test('envelope header for error event during active span is correct', done => { .expectHeader({ event: { trace: { - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), public_key: 'public', environment: 'production', release: '1.0', diff --git a/dev-packages/node-integration-tests/suites/tracing/envelope-header/error/test.ts b/dev-packages/node-integration-tests/suites/tracing/envelope-header/error/test.ts index 87229650bfb4..efb1ce409efd 100644 --- a/dev-packages/node-integration-tests/suites/tracing/envelope-header/error/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/envelope-header/error/test.ts @@ -5,7 +5,7 @@ test('envelope header for error events is correct', done => { .expectHeader({ event: { trace: { - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), environment: 'production', public_key: 'public', release: '1.0', diff --git a/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-route/test.ts b/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-route/test.ts index a9d7a3ac04e8..592d75f30ae6 100644 --- a/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-route/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-route/test.ts @@ -5,7 +5,7 @@ test('envelope header for transaction event of route correct', done => { .expectHeader({ transaction: { trace: { - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), public_key: 'public', transaction: 'GET /route', environment: 'production', diff --git a/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-url/test.ts b/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-url/test.ts index 2656835cd98d..a7de2f95c965 100644 --- a/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-url/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction-url/test.ts @@ -5,7 +5,7 @@ test('envelope header for transaction event with source=url correct', done => { .expectHeader({ transaction: { trace: { - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), public_key: 'public', environment: 'production', release: '1.0', diff --git a/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction/test.ts b/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction/test.ts index 436c7d7adf2e..3d4ff2d8d96a 100644 --- a/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/envelope-header/transaction/test.ts @@ -5,7 +5,7 @@ test('envelope header for transaction event is correct', done => { .expectHeader({ transaction: { trace: { - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), public_key: 'public', environment: 'production', release: '1.0', diff --git a/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts b/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts index 016ad078d34e..7fc6a5f05efa 100644 --- a/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts @@ -18,8 +18,8 @@ describe('httpIntegration', () => { transaction: { contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { url: expect.stringMatching(/\/test$/), 'http.response.status_code': 200, @@ -59,8 +59,8 @@ describe('httpIntegration', () => { transaction: { contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { url: expect.stringMatching(/\/test$/), 'http.response.status_code': 200, @@ -83,8 +83,8 @@ describe('httpIntegration', () => { transaction: { contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { url: expect.stringMatching(/\/test$/), 'http.response.status_code': 200, @@ -108,8 +108,8 @@ describe('httpIntegration', () => { transaction: { contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), data: { url: expect.stringMatching(/\/test$/), 'http.response.status_code': 200, diff --git a/packages/browser/test/tracing/browserTracingIntegration.test.ts b/packages/browser/test/tracing/browserTracingIntegration.test.ts index 605b46919580..ecaf9ccd4c59 100644 --- a/packages/browser/test/tracing/browserTracingIntegration.test.ts +++ b/packages/browser/test/tracing/browserTracingIntegration.test.ts @@ -105,9 +105,9 @@ describe('browserTracingIntegration', () => { [SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1, [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', }, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); @@ -176,9 +176,9 @@ describe('browserTracingIntegration', () => { [SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1, [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', }, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); // this is what is used to get the span name - JSDOM does not update this on it's own! @@ -203,9 +203,9 @@ describe('browserTracingIntegration', () => { [SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1, [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', }, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); // this is what is used to get the span name - JSDOM does not update this on it's own! @@ -230,9 +230,9 @@ describe('browserTracingIntegration', () => { [SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1, [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', }, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); @@ -290,9 +290,9 @@ describe('browserTracingIntegration', () => { [SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1, [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom', }, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spanIsSampled(span!)).toBe(true); }); @@ -327,9 +327,9 @@ describe('browserTracingIntegration', () => { [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom', testy: 'yes', }, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); @@ -483,9 +483,9 @@ describe('browserTracingIntegration', () => { [SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1, [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom', }, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(spanIsSampled(span!)).toBe(true); }); @@ -520,9 +520,9 @@ describe('browserTracingIntegration', () => { [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom', testy: 'yes', }, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); diff --git a/packages/cloudflare/test/handler.test.ts b/packages/cloudflare/test/handler.test.ts index 861360c7906f..5d1337df4349 100644 --- a/packages/cloudflare/test/handler.test.ts +++ b/packages/cloudflare/test/handler.test.ts @@ -213,8 +213,8 @@ describe('withSentry', () => { }, op: 'faas.cron', origin: 'auto.faas.cloudflare', - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); }); diff --git a/packages/cloudflare/test/request.test.ts b/packages/cloudflare/test/request.test.ts index d35ccf3d50a7..7a3fbfa35460 100644 --- a/packages/cloudflare/test/request.test.ts +++ b/packages/cloudflare/test/request.test.ts @@ -217,7 +217,7 @@ describe('withSentry', () => { ); expect(sentryEvent.contexts?.trace).toEqual({ parent_span_id: '1121201211212012', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: '12312012123120121231201212312012', }); }); @@ -267,9 +267,9 @@ describe('withSentry', () => { }, op: 'http.server', origin: 'auto.http.cloudflare', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); }); diff --git a/packages/core/test/lib/baseclient.test.ts b/packages/core/test/lib/baseclient.test.ts index 4e2bcdb334ef..f0fd4c0a40b7 100644 --- a/packages/core/test/lib/baseclient.test.ts +++ b/packages/core/test/lib/baseclient.test.ts @@ -29,7 +29,7 @@ declare var global: any; const clientEventFromException = jest.spyOn(TestClient.prototype, 'eventFromException'); const clientProcess = jest.spyOn(TestClient.prototype as any, '_process'); -jest.spyOn(miscModule, 'uuid4').mockImplementation(() => '42'); +jest.spyOn(miscModule, 'uuid4').mockImplementation(() => '12312012123120121231201212312012'); jest.spyOn(loggerModule, 'consoleSandbox').mockImplementation(cb => cb()); jest.spyOn(stringModule, 'truncate').mockImplementation(str => str); jest.spyOn(timeModule, 'dateTimestampInSeconds').mockImplementation(() => 2020); @@ -265,7 +265,7 @@ describe('BaseClient', () => { expect(TestClient.instance!.event).toEqual( expect.objectContaining({ environment: 'production', - event_id: '42', + event_id: '12312012123120121231201212312012', exception: { values: [ { @@ -378,7 +378,7 @@ describe('BaseClient', () => { expect(TestClient.instance!.event).toEqual( expect.objectContaining({ environment: 'production', - event_id: '42', + event_id: '12312012123120121231201212312012', level: 'info', message: 'test message', timestamp: 2020, @@ -488,7 +488,7 @@ describe('BaseClient', () => { expect(TestClient.instance!.event).toEqual( expect.objectContaining({ environment: 'production', - event_id: '42', + event_id: '12312012123120121231201212312012', message: 'message', timestamp: 2020, }), @@ -516,14 +516,14 @@ describe('BaseClient', () => { expect(TestClient.instance!.event).toEqual( expect.objectContaining({ environment: 'production', - event_id: '42', + event_id: '12312012123120121231201212312012', message: 'message', timestamp: 1234, }), ); }); - test('it adds a trace context all events', () => { + test('it adds a trace context to all events xxx', () => { expect.assertions(1); const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN }); @@ -532,17 +532,11 @@ describe('BaseClient', () => { client.captureEvent({ message: 'message' }, { event_id: 'wat' }, scope); - expect(TestClient.instance!.event!).toEqual( - expect.objectContaining({ - contexts: { - trace: { - parent_span_id: undefined, - span_id: expect.any(String), - trace_id: expect.any(String), - }, - }, - }), - ); + expect(TestClient.instance?.event?.contexts?.trace).toEqual({ + parent_span_id: undefined, + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), + }); }); test('adds `event_id` from hint if available', () => { @@ -576,7 +570,7 @@ describe('BaseClient', () => { expect(TestClient.instance!.event!).toEqual( expect.objectContaining({ environment: 'production', - event_id: '42', + event_id: '12312012123120121231201212312012', message: 'message', timestamp: 2020, }), @@ -595,7 +589,7 @@ describe('BaseClient', () => { expect(TestClient.instance!.event!).toEqual( expect.objectContaining({ environment: 'env', - event_id: '42', + event_id: '12312012123120121231201212312012', message: 'message', timestamp: 2020, }), @@ -614,7 +608,7 @@ describe('BaseClient', () => { expect(TestClient.instance!.event!).toEqual( expect.objectContaining({ environment: 'production', - event_id: '42', + event_id: '12312012123120121231201212312012', message: 'message', timestamp: 2020, }), @@ -633,7 +627,7 @@ describe('BaseClient', () => { expect(TestClient.instance!.event!).toEqual( expect.objectContaining({ environment: 'production', - event_id: '42', + event_id: '12312012123120121231201212312012', message: 'message', release: 'v1.0.0', timestamp: 2020, @@ -651,7 +645,7 @@ describe('BaseClient', () => { client.captureEvent({ message: 'message' }, undefined, scope); - expect(TestClient.instance!.event!).toHaveProperty('event_id', '42'); + expect(TestClient.instance!.event!).toHaveProperty('event_id', '12312012123120121231201212312012'); expect(TestClient.instance!.event!).toHaveProperty('message', 'message'); expect(TestClient.instance!.event!).toHaveProperty('breadcrumbs'); expect(TestClient.instance!.event!.breadcrumbs![0]).toHaveProperty('message', 'breadcrumb'); @@ -690,7 +684,7 @@ describe('BaseClient', () => { expect(TestClient.instance!.event!).toEqual( expect.objectContaining({ environment: 'production', - event_id: '42', + event_id: '12312012123120121231201212312012', extra: { b: 'b' }, message: 'message', tags: { a: 'a' }, @@ -713,7 +707,7 @@ describe('BaseClient', () => { expect(TestClient.instance!.event!).toEqual( expect.objectContaining({ environment: 'production', - event_id: '42', + event_id: '12312012123120121231201212312012', fingerprint: ['abcd'], message: 'message', timestamp: 2020, @@ -813,7 +807,7 @@ describe('BaseClient', () => { // also has trace context from global scope contexts: { ...normalizedObject, trace: expect.anything() }, environment: 'production', - event_id: '42', + event_id: '12312012123120121231201212312012', extra: normalizedObject, timestamp: 2020, user: normalizedObject, @@ -863,7 +857,7 @@ describe('BaseClient', () => { // also has trace context from global scope contexts: { ...normalizedObject, trace: expect.anything() }, environment: 'production', - event_id: '42', + event_id: '12312012123120121231201212312012', extra: normalizedObject, timestamp: 2020, user: normalizedObject, @@ -918,7 +912,7 @@ describe('BaseClient', () => { // also has trace context from global scope contexts: { ...normalizedObject, trace: expect.anything() }, environment: 'production', - event_id: '42', + event_id: '12312012123120121231201212312012', extra: normalizedObject, timestamp: 2020, user: normalizedObject, diff --git a/packages/core/test/lib/feedback.test.ts b/packages/core/test/lib/feedback.test.ts index cd9e99e43bdb..9a1cace05e5a 100644 --- a/packages/core/test/lib/feedback.test.ts +++ b/packages/core/test/lib/feedback.test.ts @@ -52,7 +52,7 @@ describe('captureFeedback', () => { trace: { environment: 'production', public_key: 'dsn', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, [ @@ -62,8 +62,8 @@ describe('captureFeedback', () => { breadcrumbs: undefined, contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, feedback: { message: 'test', @@ -112,7 +112,7 @@ describe('captureFeedback', () => { trace: { environment: 'production', public_key: 'dsn', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, [ @@ -122,8 +122,8 @@ describe('captureFeedback', () => { breadcrumbs: undefined, contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, feedback: { name: 'doe', @@ -194,7 +194,7 @@ describe('captureFeedback', () => { trace: { environment: 'production', public_key: 'dsn', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }, [ @@ -204,8 +204,8 @@ describe('captureFeedback', () => { breadcrumbs: undefined, contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, feedback: { message: 'test', @@ -417,7 +417,7 @@ describe('captureFeedback', () => { event_id: expect.any(String), sent_at: expect.any(String), trace: { - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), environment: 'production', public_key: 'dsn', }, @@ -429,8 +429,8 @@ describe('captureFeedback', () => { breadcrumbs: [{ message: 'test breadcrumb', timestamp: 12345 }], contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, feedback: { contact_email: 're@example.org', diff --git a/packages/core/test/lib/tracing/sentryNonRecordingSpan.test.ts b/packages/core/test/lib/tracing/sentryNonRecordingSpan.test.ts index d5643c3d3651..722e84ff0e05 100644 --- a/packages/core/test/lib/tracing/sentryNonRecordingSpan.test.ts +++ b/packages/core/test/lib/tracing/sentryNonRecordingSpan.test.ts @@ -16,8 +16,8 @@ describe('SentryNonRecordingSpan', () => { expect(spanIsSampled(span)).toBe(false); expect(span.isRecording()).toBe(false); expect(spanToJSON(span)).toEqual({ - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); // Ensure all methods work @@ -30,8 +30,8 @@ describe('SentryNonRecordingSpan', () => { // but nothing is actually set/readable expect(spanToJSON(span)).toEqual({ - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); }); diff --git a/packages/core/test/lib/tracing/trace.test.ts b/packages/core/test/lib/tracing/trace.test.ts index fe58ce6f9f7d..0d4c77a3d8aa 100644 --- a/packages/core/test/lib/tracing/trace.test.ts +++ b/packages/core/test/lib/tracing/trace.test.ts @@ -198,11 +198,11 @@ describe('startSpan', () => { }, origin: 'auto.http.browser', description: 'GET users/[id]', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: isError ? 'internal_error' : undefined, timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); }); @@ -350,8 +350,8 @@ describe('startSpan', () => { 'sentry.sample_rate': 1, 'sentry.origin': 'manual', }, - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, }); @@ -375,7 +375,7 @@ describe('startSpan', () => { 'sentry.origin': 'manual', }, parent_span_id: innerParentSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: outerTraceId, origin: 'manual', }, @@ -774,8 +774,8 @@ describe('startSpanManual', () => { 'sentry.sample_rate': 1, 'sentry.origin': 'manual', }, - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, }); @@ -799,7 +799,7 @@ describe('startSpanManual', () => { 'sentry.origin': 'manual', }, parent_span_id: innerParentSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: outerTraceId, origin: 'manual', }, @@ -1096,8 +1096,8 @@ describe('startInactiveSpan', () => { 'sentry.sample_rate': 1, 'sentry.origin': 'manual', }, - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, }); @@ -1121,7 +1121,7 @@ describe('startInactiveSpan', () => { 'sentry.origin': 'manual', }, parent_span_id: innerParentSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: outerTraceId, origin: 'manual', }, diff --git a/packages/core/test/utils-hoist/envelope.test.ts b/packages/core/test/utils-hoist/envelope.test.ts index 9ebfd447fb14..8a621151a654 100644 --- a/packages/core/test/utils-hoist/envelope.test.ts +++ b/packages/core/test/utils-hoist/envelope.test.ts @@ -62,10 +62,10 @@ describe('envelope', () => { }, description: expect.any(String), op: expect.any(String), - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: expect.any(String), exclusive_time: expect.any(Number), measurements: { inp: { value: expect.any(Number), unit: expect.any(String) } }, diff --git a/packages/feedback/src/core/sendFeedback.test.ts b/packages/feedback/src/core/sendFeedback.test.ts index 96df79828ac8..826dd3f05daf 100644 --- a/packages/feedback/src/core/sendFeedback.test.ts +++ b/packages/feedback/src/core/sendFeedback.test.ts @@ -49,7 +49,7 @@ describe('sendFeedback', () => { event_id: expect.any(String), sent_at: expect.any(String), trace: { - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), environment: 'production', public_key: 'dsn', }, @@ -61,8 +61,8 @@ describe('sendFeedback', () => { breadcrumbs: undefined, contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, feedback: { message: 'mi', @@ -105,7 +105,7 @@ describe('sendFeedback', () => { event_id: expect.any(String), sent_at: expect.any(String), trace: { - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), environment: 'production', public_key: 'dsn', }, @@ -117,8 +117,8 @@ describe('sendFeedback', () => { breadcrumbs: undefined, contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, feedback: { name: 'doe', @@ -157,7 +157,7 @@ describe('sendFeedback', () => { event_id: expect.any(String), sent_at: expect.any(String), trace: { - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), environment: 'production', public_key: 'dsn', sample_rate: '1', @@ -172,8 +172,8 @@ describe('sendFeedback', () => { breadcrumbs: undefined, contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, feedback: { contact_email: 're@example.org', @@ -221,7 +221,7 @@ describe('sendFeedback', () => { event_id: expect.any(String), sent_at: expect.any(String), trace: { - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), environment: 'production', public_key: 'dsn', }, @@ -233,8 +233,8 @@ describe('sendFeedback', () => { breadcrumbs: [{ message: 'test breadcrumb', timestamp: 12345 }], contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, feedback: { contact_email: 're@example.org', @@ -374,7 +374,7 @@ describe('sendFeedback', () => { event_id: eventId, sent_at: expect.any(String), trace: { - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), environment: 'production', public_key: 'dsn', }, @@ -386,8 +386,8 @@ describe('sendFeedback', () => { breadcrumbs: undefined, contexts: { trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, feedback: { contact_email: 're@example.org', diff --git a/packages/node/test/integration/transactions.test.ts b/packages/node/test/integration/transactions.test.ts index a9d524ea0285..f372c8cce06f 100644 --- a/packages/node/test/integration/transactions.test.ts +++ b/packages/node/test/integration/transactions.test.ts @@ -94,9 +94,9 @@ describe('Integration | Transactions', () => { 'test.outer': 'test value', }, op: 'test op', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.test', }); @@ -107,7 +107,7 @@ describe('Integration | Transactions', () => { sample_rate: '1', sampled: 'true', release: '8.0.0', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), transaction: 'test name', }); @@ -136,12 +136,12 @@ describe('Integration | Transactions', () => { }, description: 'inner span 1', origin: 'manual', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, { data: { @@ -150,12 +150,12 @@ describe('Integration | Transactions', () => { }, description: 'inner span 2', origin: 'manual', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, ]); }); @@ -245,9 +245,9 @@ describe('Integration | Transactions', () => { 'sentry.sample_rate': 1, }, op: 'test op', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.test', }, }), @@ -283,9 +283,9 @@ describe('Integration | Transactions', () => { 'sentry.sample_rate': 1, }, op: 'test op b', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, }), @@ -386,9 +386,9 @@ describe('Integration | Transactions', () => { 'test.outer': 'test value', 'sentry.sample_rate': 1, }, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, }), @@ -421,9 +421,9 @@ describe('Integration | Transactions', () => { 'test.outer': 'test value b', 'sentry.sample_rate': 1, }, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, }), @@ -494,7 +494,7 @@ describe('Integration | Transactions', () => { 'sentry.sample_rate': 1, }, op: 'test op', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), parent_span_id: parentSpanId, status: 'ok', trace_id: traceId, @@ -528,8 +528,8 @@ describe('Integration | Transactions', () => { }, description: 'inner span 1', origin: 'manual', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), @@ -541,8 +541,8 @@ describe('Integration | Transactions', () => { }, description: 'inner span 2', origin: 'manual', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), diff --git a/packages/opentelemetry/test/integration/transactions.test.ts b/packages/opentelemetry/test/integration/transactions.test.ts index 8dacab4412c0..a3ed3356d734 100644 --- a/packages/opentelemetry/test/integration/transactions.test.ts +++ b/packages/opentelemetry/test/integration/transactions.test.ts @@ -109,9 +109,9 @@ describe('Integration | Transactions', () => { 'test.outer': 'test value', }, op: 'test op', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.test', }); @@ -121,7 +121,7 @@ describe('Integration | Transactions', () => { public_key: expect.any(String), sample_rate: '1', sampled: 'true', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), transaction: 'test name', release: '8.0.0', }); @@ -151,12 +151,12 @@ describe('Integration | Transactions', () => { }, description: 'inner span 1', origin: 'manual', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, { data: { @@ -165,12 +165,12 @@ describe('Integration | Transactions', () => { }, description: 'inner span 2', origin: 'manual', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, ]); }); @@ -260,9 +260,9 @@ describe('Integration | Transactions', () => { 'sentry.sample_rate': 1, }, op: 'test op', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.test', }, }), @@ -298,9 +298,9 @@ describe('Integration | Transactions', () => { 'sentry.sample_rate': 1, }, op: 'test op b', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), status: 'ok', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', }, }), @@ -377,7 +377,7 @@ describe('Integration | Transactions', () => { 'sentry.sample_rate': 1, }, op: 'test op', - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), parent_span_id: parentSpanId, status: 'ok', trace_id: traceId, @@ -411,8 +411,8 @@ describe('Integration | Transactions', () => { }, description: 'inner span 1', origin: 'manual', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), @@ -424,8 +424,8 @@ describe('Integration | Transactions', () => { }, description: 'inner span 2', origin: 'manual', - parent_span_id: expect.any(String), - span_id: expect.any(String), + parent_span_id: expect.stringMatching(/[a-f0-9]{16}/), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), status: 'ok', timestamp: expect.any(Number), diff --git a/packages/opentelemetry/test/trace.test.ts b/packages/opentelemetry/test/trace.test.ts index 0a709c9fb5da..f00cdb781dc2 100644 --- a/packages/opentelemetry/test/trace.test.ts +++ b/packages/opentelemetry/test/trace.test.ts @@ -391,8 +391,8 @@ describe('trace', () => { 'sentry.sample_rate': 1, 'sentry.origin': 'manual', }, - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', status: 'ok', }); @@ -416,7 +416,7 @@ describe('trace', () => { 'sentry.sample_rate': 1, }, parent_span_id: innerParentSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: outerTraceId, origin: 'manual', status: 'ok', @@ -651,8 +651,8 @@ describe('trace', () => { 'sentry.sample_rate': 1, 'sentry.origin': 'manual', }, - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', status: 'ok', }); @@ -676,7 +676,7 @@ describe('trace', () => { 'sentry.sample_rate': 1, }, parent_span_id: innerParentSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: outerTraceId, origin: 'manual', status: 'ok', @@ -948,8 +948,8 @@ describe('trace', () => { 'sentry.sample_rate': 1, 'sentry.origin': 'manual', }, - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'manual', status: 'ok', }); @@ -973,7 +973,7 @@ describe('trace', () => { 'sentry.sample_rate': 1, }, parent_span_id: innerParentSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), trace_id: outerTraceId, origin: 'manual', status: 'ok', @@ -1522,7 +1522,7 @@ describe('continueTrace', () => { expect(span).toBeDefined(); expect(spanToJSON(span)).toEqual({ span_id: '', - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(getSamplingDecision(span.spanContext())).toBe(undefined); expect(spanIsSampled(span)).toBe(false); diff --git a/packages/opentelemetry/test/utils/setupEventContextTrace.test.ts b/packages/opentelemetry/test/utils/setupEventContextTrace.test.ts index 029c25ad968d..95c68e5416f1 100644 --- a/packages/opentelemetry/test/utils/setupEventContextTrace.test.ts +++ b/packages/opentelemetry/test/utils/setupEventContextTrace.test.ts @@ -51,8 +51,8 @@ describe('setupEventContextTrace', () => { expect.objectContaining({ contexts: expect.objectContaining({ trace: { - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }, }), }), diff --git a/packages/svelte/test/performance.test.ts b/packages/svelte/test/performance.test.ts index 929bb9394e95..8a10c1c16312 100644 --- a/packages/svelte/test/performance.test.ts +++ b/packages/svelte/test/performance.test.ts @@ -66,7 +66,7 @@ describe('Sentry.trackComponent()', () => { span_id: initSpanId, start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(transaction.spans![1]).toEqual({ @@ -78,10 +78,10 @@ describe('Sentry.trackComponent()', () => { op: 'ui.svelte.update', origin: 'auto.ui.svelte', parent_span_id: rootSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); @@ -121,7 +121,7 @@ describe('Sentry.trackComponent()', () => { span_id: initSpanId, start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(transaction.spans![1]).toEqual({ @@ -133,10 +133,10 @@ describe('Sentry.trackComponent()', () => { op: 'ui.svelte.update', origin: 'auto.ui.svelte', parent_span_id: rootSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); expect(transaction.spans![2]).toEqual({ @@ -148,10 +148,10 @@ describe('Sentry.trackComponent()', () => { op: 'ui.svelte.update', origin: 'auto.ui.svelte', parent_span_id: rootSpanId, - span_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), start_timestamp: expect.any(Number), timestamp: expect.any(Number), - trace_id: expect.any(String), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), }); }); diff --git a/packages/sveltekit/test/server/load.test.ts b/packages/sveltekit/test/server/load.test.ts index c2ee2b2943a3..29917dd5a1e0 100644 --- a/packages/sveltekit/test/server/load.test.ts +++ b/packages/sveltekit/test/server/load.test.ts @@ -265,8 +265,8 @@ describe('wrapServerLoadWithSentry calls `startSpan`', () => { 'sentry.sample_rate': 1, }, op: 'function.sveltekit.server.load', - span_id: expect.any(String), - trace_id: expect.any(String), + span_id: expect.stringMatching(/[a-f0-9]{16}/), + trace_id: expect.stringMatching(/[a-f0-9]{32}/), origin: 'auto.function.sveltekit', }); expect(transaction.transaction).toEqual('/users/123');