From d47420db2db647846a09b1886d859a9bb02cb821 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Thu, 8 Oct 2026 17:07:32 +0200 Subject: [PATCH 1/2] test(node): Port incoming HTTP behavior to span streaming Co-Authored-By: GPT-6 --- .../node-suites/excludes.ts | 4 +- .../httpIntegration-streamed/instrument.mjs | 1 - .../instrument-overwrite-server-emit.mjs | 1 - .../suites/tracing/httpIntegration/test.ts | 278 +++++++++--------- .../instrument.mjs | 1 - .../server.mjs | 0 .../test.ts | 2 +- ...rument-with-datacollection-no-userinfo.mjs | 1 - .../instrument-without-request-data.mjs | 1 - .../instrument.mjs | 1 - .../server.mjs | 0 .../test.ts | 2 +- 12 files changed, 150 insertions(+), 142 deletions(-) rename dev-packages/node-integration-tests/suites/tracing/{httpServerSpans-streamed-unrouted => httpServerSpans-unrouted}/instrument.mjs (90%) rename dev-packages/node-integration-tests/suites/tracing/{httpServerSpans-streamed-unrouted => httpServerSpans-unrouted}/server.mjs (100%) rename dev-packages/node-integration-tests/suites/tracing/{httpServerSpans-streamed-unrouted => httpServerSpans-unrouted}/test.ts (96%) rename dev-packages/node-integration-tests/suites/tracing/{requestData-streamed => requestData}/instrument-with-datacollection-no-userinfo.mjs (91%) rename dev-packages/node-integration-tests/suites/tracing/{requestData-streamed => requestData}/instrument-without-request-data.mjs (92%) rename dev-packages/node-integration-tests/suites/tracing/{requestData-streamed => requestData}/instrument.mjs (90%) rename dev-packages/node-integration-tests/suites/tracing/{requestData-streamed => requestData}/server.mjs (100%) rename dev-packages/node-integration-tests/suites/tracing/{requestData-streamed => requestData}/test.ts (99%) diff --git a/dev-packages/bun-integration-tests/node-suites/excludes.ts b/dev-packages/bun-integration-tests/node-suites/excludes.ts index 5b99ffc866ab..427f5cc0c2cd 100644 --- a/dev-packages/bun-integration-tests/node-suites/excludes.ts +++ b/dev-packages/bun-integration-tests/node-suites/excludes.ts @@ -21,11 +21,11 @@ const NO_HTTP_SERVER_SPANS = [ 'suites/tracing/envelope-header/sampleRate-propagation/test.ts', 'suites/tracing/httpIntegration-streamed/test.ts', 'suites/tracing/httpIntegration/test.ts', - 'suites/tracing/httpServerSpans-streamed-unrouted/test.ts', + 'suites/tracing/httpServerSpans-unrouted/test.ts', 'suites/tracing/ignoreSpans-streamed/**', 'suites/tracing/meta-tags-twp-errors/test.ts', 'suites/tracing/meta-tags/test.ts', - 'suites/tracing/requestData-streamed/test.ts', + 'suites/tracing/requestData/test.ts', 'suites/tracing/sample-rand-propagation/test.ts', 'suites/tracing/sample-rate-propagation/**', 'suites/tracing/sampling-static/test.ts', diff --git a/dev-packages/node-integration-tests/suites/tracing/httpIntegration-streamed/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/httpIntegration-streamed/instrument.mjs index 53b9511a21f0..46a27dd03b74 100644 --- a/dev-packages/node-integration-tests/suites/tracing/httpIntegration-streamed/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/httpIntegration-streamed/instrument.mjs @@ -6,5 +6,4 @@ Sentry.init({ release: '1.0', tracesSampleRate: 1.0, transport: loggingTransport, - traceLifecycle: 'stream', }); diff --git a/dev-packages/node-integration-tests/suites/tracing/httpIntegration/instrument-overwrite-server-emit.mjs b/dev-packages/node-integration-tests/suites/tracing/httpIntegration/instrument-overwrite-server-emit.mjs index 680ed3d3c156..94ad8df95439 100644 --- a/dev-packages/node-integration-tests/suites/tracing/httpIntegration/instrument-overwrite-server-emit.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/httpIntegration/instrument-overwrite-server-emit.mjs @@ -2,7 +2,6 @@ import * as Sentry from '@sentry/node'; import { loggingTransport } from '@sentry-internal/node-integration-tests'; Sentry.init({ - traceLifecycle: 'static', dsn: 'https://public@dsn.ingest.sentry.io/1337', release: '1.0', tracesSampleRate: 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 3cbe232bb061..e3d1aa0f460e 100644 --- a/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts @@ -1,5 +1,6 @@ +import { HTTP_SERVER } from '@sentry/conventions/op'; import { createTestServer } from '@sentry-internal/test-utils'; -import { URL_FULL, URL_PATH } from '@sentry/conventions/attributes'; +import { HTTP_RESPONSE_STATUS_CODE, SENTRY_OP, URL_FULL, URL_PATH } from '@sentry/conventions/attributes'; import { afterAll, describe, expect, test } from 'vitest'; import { cleanupChildProcesses, createEsmAndCjsTests, createRunner } from '../../../utils/runner'; import { RUNTIME } from '../../../utils'; @@ -205,51 +206,54 @@ describe('httpIntegration', () => { test('handles server.emit being overwritten via classic monkey patching', async () => { const runner = createRunner() .expect({ - transaction: { - transaction: 'GET /test1', - contexts: { - trace: { + span: { + items: [ + expect.objectContaining({ + name: 'GET', + is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - data: { - 'http.response.status_code': 200, - 'sentry.op': 'http.server', - }, - }, - }, - spans: [], + attributes: expect.objectContaining({ + [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, + [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, + [URL_PATH]: { type: 'string', value: '/test1' }, + }), + }), + ], }, }) .expect({ - transaction: { - transaction: 'GET /test2', - contexts: { - trace: { + span: { + items: [ + expect.objectContaining({ + name: 'GET', + is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - data: { - 'http.response.status_code': 200, - 'sentry.op': 'http.server', - }, - }, - }, - spans: [], + attributes: expect.objectContaining({ + [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, + [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, + [URL_PATH]: { type: 'string', value: '/test2' }, + }), + }), + ], }, }) .expect({ - transaction: { - transaction: 'GET /test3', - contexts: { - trace: { + span: { + items: [ + expect.objectContaining({ + name: 'GET', + is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - data: { - 'http.response.status_code': 200, - 'sentry.op': 'http.server', - }, - }, - }, - spans: [], + attributes: expect.objectContaining({ + [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, + [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, + [URL_PATH]: { type: 'string', value: '/test3' }, + }), + }), + ], }, }) .start(); @@ -263,50 +267,54 @@ describe('httpIntegration', () => { test('handles server.emit being overwritten via proxy', async () => { const runner = createRunner() .expect({ - transaction: { - transaction: 'GET /test1-proxy', - contexts: { - trace: { + span: { + items: [ + expect.objectContaining({ + name: 'GET', + is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - data: { - 'http.response.status_code': 200, - 'sentry.op': 'http.server', - }, - }, - }, - spans: [], + attributes: expect.objectContaining({ + [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, + [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, + [URL_PATH]: { type: 'string', value: '/test1-proxy' }, + }), + }), + ], }, }) .expect({ - transaction: { - transaction: 'GET /test2-proxy', - contexts: { - trace: { + span: { + items: [ + expect.objectContaining({ + name: 'GET', + is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - data: { - 'http.response.status_code': 200, - 'sentry.op': 'http.server', - }, - }, - }, - spans: [], + attributes: expect.objectContaining({ + [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, + [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, + [URL_PATH]: { type: 'string', value: '/test2-proxy' }, + }), + }), + ], }, }) .expect({ - transaction: { - transaction: 'GET /test3-proxy', - contexts: { - trace: { + span: { + items: expect.arrayContaining([ + expect.objectContaining({ + name: 'GET', + is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - data: { - 'http.response.status_code': 200, - 'sentry.op': 'http.server', - }, - }, - }, + attributes: expect.objectContaining({ + [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, + [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, + [URL_PATH]: { type: 'string', value: '/test3-proxy' }, + }), + }), + ]), }, }) .start(); @@ -320,51 +328,54 @@ describe('httpIntegration', () => { test('handles server.emit being overwritten via classic monkey patching, using initial server.emit', async () => { const runner = createRunner() .expect({ - transaction: { - transaction: 'GET /test1-original', - contexts: { - trace: { + span: { + items: [ + expect.objectContaining({ + name: 'GET', + is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - data: { - 'http.response.status_code': 200, - 'sentry.op': 'http.server', - }, - }, - }, - spans: [], + attributes: expect.objectContaining({ + [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, + [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, + [URL_PATH]: { type: 'string', value: '/test1-original' }, + }), + }), + ], }, }) .expect({ - transaction: { - transaction: 'GET /test2-original', - contexts: { - trace: { + span: { + items: [ + expect.objectContaining({ + name: 'GET', + is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - data: { - 'http.response.status_code': 200, - 'sentry.op': 'http.server', - }, - }, - }, - spans: [], + attributes: expect.objectContaining({ + [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, + [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, + [URL_PATH]: { type: 'string', value: '/test2-original' }, + }), + }), + ], }, }) .expect({ - transaction: { - transaction: 'GET /test3-original', - contexts: { - trace: { + span: { + items: [ + expect.objectContaining({ + name: 'GET', + is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - data: { - 'http.response.status_code': 200, - 'sentry.op': 'http.server', - }, - }, - }, - spans: [], + attributes: expect.objectContaining({ + [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, + [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, + [URL_PATH]: { type: 'string', value: '/test3-original' }, + }), + }), + ], }, }) .start(); @@ -378,51 +389,54 @@ describe('httpIntegration', () => { test('handles server.emit being overwritten via proxy, using initial server.emit', async () => { const runner = createRunner() .expect({ - transaction: { - transaction: 'GET /test1-proxy-original', - contexts: { - trace: { + span: { + items: [ + expect.objectContaining({ + name: 'GET', + is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - data: { - 'http.response.status_code': 200, - 'sentry.op': 'http.server', - }, - }, - }, - spans: [], + attributes: expect.objectContaining({ + [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, + [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, + [URL_PATH]: { type: 'string', value: '/test1-proxy-original' }, + }), + }), + ], }, }) .expect({ - transaction: { - transaction: 'GET /test2-proxy-original', - contexts: { - trace: { + span: { + items: [ + expect.objectContaining({ + name: 'GET', + is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - data: { - 'http.response.status_code': 200, - 'sentry.op': 'http.server', - }, - }, - }, - spans: [], + attributes: expect.objectContaining({ + [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, + [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, + [URL_PATH]: { type: 'string', value: '/test2-proxy-original' }, + }), + }), + ], }, }) .expect({ - transaction: { - transaction: 'GET /test3-proxy-original', - contexts: { - trace: { + span: { + items: [ + expect.objectContaining({ + name: 'GET', + is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - data: { - 'http.response.status_code': 200, - 'sentry.op': 'http.server', - }, - }, - }, - spans: [], + attributes: expect.objectContaining({ + [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, + [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, + [URL_PATH]: { type: 'string', value: '/test3-proxy-original' }, + }), + }), + ], }, }) .start(); diff --git a/dev-packages/node-integration-tests/suites/tracing/httpServerSpans-streamed-unrouted/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/httpServerSpans-unrouted/instrument.mjs similarity index 90% rename from dev-packages/node-integration-tests/suites/tracing/httpServerSpans-streamed-unrouted/instrument.mjs rename to dev-packages/node-integration-tests/suites/tracing/httpServerSpans-unrouted/instrument.mjs index 53b9511a21f0..46a27dd03b74 100644 --- a/dev-packages/node-integration-tests/suites/tracing/httpServerSpans-streamed-unrouted/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/httpServerSpans-unrouted/instrument.mjs @@ -6,5 +6,4 @@ Sentry.init({ release: '1.0', tracesSampleRate: 1.0, transport: loggingTransport, - traceLifecycle: 'stream', }); diff --git a/dev-packages/node-integration-tests/suites/tracing/httpServerSpans-streamed-unrouted/server.mjs b/dev-packages/node-integration-tests/suites/tracing/httpServerSpans-unrouted/server.mjs similarity index 100% rename from dev-packages/node-integration-tests/suites/tracing/httpServerSpans-streamed-unrouted/server.mjs rename to dev-packages/node-integration-tests/suites/tracing/httpServerSpans-unrouted/server.mjs diff --git a/dev-packages/node-integration-tests/suites/tracing/httpServerSpans-streamed-unrouted/test.ts b/dev-packages/node-integration-tests/suites/tracing/httpServerSpans-unrouted/test.ts similarity index 96% rename from dev-packages/node-integration-tests/suites/tracing/httpServerSpans-streamed-unrouted/test.ts rename to dev-packages/node-integration-tests/suites/tracing/httpServerSpans-unrouted/test.ts index d488bf9bcd5a..b2bbda3797d4 100644 --- a/dev-packages/node-integration-tests/suites/tracing/httpServerSpans-streamed-unrouted/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/httpServerSpans-unrouted/test.ts @@ -1,7 +1,7 @@ import { afterAll, describe, expect } from 'vitest'; import { cleanupChildProcesses, createEsmAndCjsTests } from '../../../utils/runner'; -describe('httpServerSpans-streamed (no route)', () => { +describe('httpServerSpans (no route)', () => { afterAll(() => { cleanupChildProcesses(); }); diff --git a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument-with-datacollection-no-userinfo.mjs b/dev-packages/node-integration-tests/suites/tracing/requestData/instrument-with-datacollection-no-userinfo.mjs similarity index 91% rename from dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument-with-datacollection-no-userinfo.mjs rename to dev-packages/node-integration-tests/suites/tracing/requestData/instrument-with-datacollection-no-userinfo.mjs index 0ae53602ff0c..d12edc0ab2fa 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument-with-datacollection-no-userinfo.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/requestData/instrument-with-datacollection-no-userinfo.mjs @@ -6,7 +6,6 @@ Sentry.init({ release: '1.0', tracesSampleRate: 1.0, transport: loggingTransport, - traceLifecycle: 'stream', dataCollection: { userInfo: false, }, diff --git a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument-without-request-data.mjs b/dev-packages/node-integration-tests/suites/tracing/requestData/instrument-without-request-data.mjs similarity index 92% rename from dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument-without-request-data.mjs rename to dev-packages/node-integration-tests/suites/tracing/requestData/instrument-without-request-data.mjs index c1f011300062..a68ae15e47b1 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument-without-request-data.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/requestData/instrument-without-request-data.mjs @@ -6,6 +6,5 @@ Sentry.init({ release: '1.0', tracesSampleRate: 1.0, transport: loggingTransport, - traceLifecycle: 'stream', integrations: defaults => defaults.filter(i => i.name !== 'RequestData'), }); diff --git a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/requestData/instrument.mjs similarity index 90% rename from dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument.mjs rename to dev-packages/node-integration-tests/suites/tracing/requestData/instrument.mjs index 53b9511a21f0..46a27dd03b74 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/requestData/instrument.mjs @@ -6,5 +6,4 @@ Sentry.init({ release: '1.0', tracesSampleRate: 1.0, transport: loggingTransport, - traceLifecycle: 'stream', }); diff --git a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/server.mjs b/dev-packages/node-integration-tests/suites/tracing/requestData/server.mjs similarity index 100% rename from dev-packages/node-integration-tests/suites/tracing/requestData-streamed/server.mjs rename to dev-packages/node-integration-tests/suites/tracing/requestData/server.mjs diff --git a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/test.ts b/dev-packages/node-integration-tests/suites/tracing/requestData/test.ts similarity index 99% rename from dev-packages/node-integration-tests/suites/tracing/requestData-streamed/test.ts rename to dev-packages/node-integration-tests/suites/tracing/requestData/test.ts index 5a356e3d91e9..c6028677a738 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requestData-streamed/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requestData/test.ts @@ -1,7 +1,7 @@ import { afterAll, describe, expect } from 'vitest'; import { cleanupChildProcesses, createEsmAndCjsTests } from '../../../utils/runner'; -describe('requestData-streamed', () => { +describe('requestData', () => { afterAll(() => { cleanupChildProcesses(); }); From 9f709d1fbd956d242ce1f70ee442c5e34bbed644 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Fri, 9 Oct 2026 10:13:52 +0200 Subject: [PATCH 2/2] test(node): Remove redundant HTTP span matchers Co-Authored-By: GPT-6 --- .../suites/tracing/httpIntegration/test.ts | 88 +++++++++---------- 1 file changed, 44 insertions(+), 44 deletions(-) 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 e3d1aa0f460e..1225b5891e8f 100644 --- a/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/httpIntegration/test.ts @@ -208,51 +208,51 @@ describe('httpIntegration', () => { .expect({ span: { items: [ - expect.objectContaining({ + { name: 'GET', is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - attributes: expect.objectContaining({ + attributes: { [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, [URL_PATH]: { type: 'string', value: '/test1' }, - }), - }), + }, + }, ], }, }) .expect({ span: { items: [ - expect.objectContaining({ + { name: 'GET', is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - attributes: expect.objectContaining({ + attributes: { [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, [URL_PATH]: { type: 'string', value: '/test2' }, - }), - }), + }, + }, ], }, }) .expect({ span: { items: [ - expect.objectContaining({ + { name: 'GET', is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - attributes: expect.objectContaining({ + attributes: { [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, [URL_PATH]: { type: 'string', value: '/test3' }, - }), - }), + }, + }, ], }, }) @@ -269,34 +269,34 @@ describe('httpIntegration', () => { .expect({ span: { items: [ - expect.objectContaining({ + { name: 'GET', is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - attributes: expect.objectContaining({ + attributes: { [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, [URL_PATH]: { type: 'string', value: '/test1-proxy' }, - }), - }), + }, + }, ], }, }) .expect({ span: { items: [ - expect.objectContaining({ + { name: 'GET', is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - attributes: expect.objectContaining({ + attributes: { [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, [URL_PATH]: { type: 'string', value: '/test2-proxy' }, - }), - }), + }, + }, ], }, }) @@ -330,51 +330,51 @@ describe('httpIntegration', () => { .expect({ span: { items: [ - expect.objectContaining({ + { name: 'GET', is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - attributes: expect.objectContaining({ + attributes: { [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, [URL_PATH]: { type: 'string', value: '/test1-original' }, - }), - }), + }, + }, ], }, }) .expect({ span: { items: [ - expect.objectContaining({ + { name: 'GET', is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - attributes: expect.objectContaining({ + attributes: { [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, [URL_PATH]: { type: 'string', value: '/test2-original' }, - }), - }), + }, + }, ], }, }) .expect({ span: { items: [ - expect.objectContaining({ + { name: 'GET', is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - attributes: expect.objectContaining({ + attributes: { [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, [URL_PATH]: { type: 'string', value: '/test3-original' }, - }), - }), + }, + }, ], }, }) @@ -391,51 +391,51 @@ describe('httpIntegration', () => { .expect({ span: { items: [ - expect.objectContaining({ + { name: 'GET', is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - attributes: expect.objectContaining({ + attributes: { [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, [URL_PATH]: { type: 'string', value: '/test1-proxy-original' }, - }), - }), + }, + }, ], }, }) .expect({ span: { items: [ - expect.objectContaining({ + { name: 'GET', is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - attributes: expect.objectContaining({ + attributes: { [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, [URL_PATH]: { type: 'string', value: '/test2-proxy-original' }, - }), - }), + }, + }, ], }, }) .expect({ span: { items: [ - expect.objectContaining({ + { name: 'GET', is_segment: true, span_id: expect.stringMatching(/[a-f\d]{16}/), trace_id: expect.stringMatching(/[a-f\d]{32}/), - attributes: expect.objectContaining({ + attributes: { [HTTP_RESPONSE_STATUS_CODE]: { type: 'integer', value: 200 }, [SENTRY_OP]: { type: 'string', value: HTTP_SERVER }, [URL_PATH]: { type: 'string', value: '/test3-proxy-original' }, - }), - }), + }, + }, ], }, })