From ce0371cd5307c85754939347338ee028389be708 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Thu, 8 Oct 2026 16:54:35 +0200 Subject: [PATCH 1/3] test(node): Port HTTP request suites to span streaming Co-Authored-By: GPT-6 --- .../requests/http-breadcrumbs/instrument.mjs | 1 - .../requests/http-maxed-out-sockets/instrument.mjs | 1 - .../requests/http-maxed-out-sockets/test.ts | 4 +--- .../http-no-trace-propagation/instrument.mjs | 1 - .../http-no-tracing-no-spans/instrument.mjs | 1 - .../requests/http-no-tracing/instrument.mjs | 1 - .../http-sampled-no-active-span/instrument.mjs | 1 - .../tracing/requests/http-sampled/instrument.mjs | 1 - .../suites/tracing/requests/http-sampled/test.ts | 4 +--- .../tracing/requests/http-unsampled/instrument.mjs | 1 - .../tracing/requests/traceparent/instrument.mjs | 1 - .../suites/tracing/requests/traceparent/test.ts | 14 +++++++------- 12 files changed, 9 insertions(+), 22 deletions(-) diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/http-breadcrumbs/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/requests/http-breadcrumbs/instrument.mjs index 3e95fc68c6bc..dfe7b95bfeb7 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-breadcrumbs/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-breadcrumbs/instrument.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', tracePropagationTargets: [/\/v0/, 'v1'], diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/http-maxed-out-sockets/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/requests/http-maxed-out-sockets/instrument.mjs index 170ad6f6a702..46a27dd03b74 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-maxed-out-sockets/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-maxed-out-sockets/instrument.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/requests/http-maxed-out-sockets/test.ts b/dev-packages/node-integration-tests/suites/tracing/requests/http-maxed-out-sockets/test.ts index 0dbe7867110f..5bc52fb115f2 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-maxed-out-sockets/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-maxed-out-sockets/test.ts @@ -21,9 +21,7 @@ describe('outgoing http with maxed-out agent sockets', () => { await createRunner() .withEnv({ SERVER_URL }) .expect({ - transaction: { - // we're not too concerned with the actual transaction here since this is tested elsewhere - }, + span: {}, }) .start() .completed(); diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/http-no-trace-propagation/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/requests/http-no-trace-propagation/instrument.mjs index 8d1cf5e660fb..3eacba8fd6c8 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-no-trace-propagation/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-no-trace-propagation/instrument.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', integrations: [Sentry.httpIntegration({ tracePropagation: false, spans: false })], diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing-no-spans/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing-no-spans/instrument.mjs index 5a2c1a2ab1fd..9f713557b30a 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing-no-spans/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing-no-spans/instrument.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', tracePropagationTargets: [/\/v0/, 'v1'], diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing/instrument.mjs index 3e95fc68c6bc..dfe7b95bfeb7 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-no-tracing/instrument.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', tracePropagationTargets: [/\/v0/, 'v1'], diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled-no-active-span/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled-no-active-span/instrument.mjs index 459b690e0801..518e3f83de83 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled-no-active-span/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled-no-active-span/instrument.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/requests/http-sampled/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/instrument.mjs index 459b690e0801..518e3f83de83 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/instrument.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/requests/http-sampled/test.ts b/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/test.ts index ebd6198bfd4e..f338f9cca367 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/test.ts @@ -31,9 +31,7 @@ describe('outgoing http', () => { await createRunner() .withEnv({ SERVER_URL }) .expect({ - transaction: { - // we're not too concerned with the actual transaction here since this is tested elsewhere - }, + span: {}, }) .start() .completed(); diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/http-unsampled/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/requests/http-unsampled/instrument.mjs index 0aa2b791f9cd..9063352bc6d9 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-unsampled/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-unsampled/instrument.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', tracePropagationTargets: [/\/v0/, 'v1'], diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/traceparent/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/requests/traceparent/instrument.mjs index dbbe03ce5e0c..886377ef59e7 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/traceparent/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/requests/traceparent/instrument.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, diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/traceparent/test.ts b/dev-packages/node-integration-tests/suites/tracing/requests/traceparent/test.ts index 1367c3ed3a07..24209d0a87de 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/traceparent/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requests/traceparent/test.ts @@ -1,3 +1,5 @@ +import { SENTRY_OP } from '@sentry/conventions/attributes'; +import { HTTP_CLIENT } from '@sentry/conventions/op'; import { createTestServer } from '@sentry-internal/test-utils'; import { describe, expect } from 'vitest'; import { RUNTIME } from '../../../../utils'; @@ -23,14 +25,14 @@ describe('outgoing traceparent', () => { await createRunner() .withEnv({ SERVER_URL }) .expect({ - // The propagated `sentry-trace` must reference the `http.client` span, not the surrounding transaction span. - transaction: event => { + // The propagated `sentry-trace` must reference the `http.client` span, not the surrounding segment span. + span: container => { const propagatedSpanId = outgoingSentryTrace?.split('-')[1]; - const httpClientSpan = event.spans?.find(span => span.op === 'http.client'); + const httpClientSpan = container.items.find(span => span.attributes[SENTRY_OP]?.value === HTTP_CLIENT); expect(httpClientSpan).toBeDefined(); expect(propagatedSpanId).toBe(httpClientSpan?.span_id); - expect(propagatedSpanId).not.toBe(event.contexts?.trace?.span_id); + expect(propagatedSpanId).not.toBe(container.items.find(span => span.is_segment)?.span_id); }, }) .start() @@ -57,9 +59,7 @@ describe('outgoing traceparent', () => { await createRunner() .withEnv({ SERVER_URL }) .expect({ - transaction: { - // we're not too concerned with the actual transaction here since this is tested elsewhere - }, + span: {}, }) .start() .completed(); From 5a66be8ac76014ec31a34c4e526a78375f15b934 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Thu, 8 Oct 2026 17:59:30 +0200 Subject: [PATCH 2/3] test(node): Restore comments explaining empty span expectations Co-Authored-By: GPT-6 --- .../suites/tracing/requests/http-maxed-out-sockets/test.ts | 4 +++- .../suites/tracing/requests/http-sampled/test.ts | 4 +++- .../suites/tracing/requests/traceparent/test.ts | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/http-maxed-out-sockets/test.ts b/dev-packages/node-integration-tests/suites/tracing/requests/http-maxed-out-sockets/test.ts index 5bc52fb115f2..1f3f507c699f 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-maxed-out-sockets/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-maxed-out-sockets/test.ts @@ -21,7 +21,9 @@ describe('outgoing http with maxed-out agent sockets', () => { await createRunner() .withEnv({ SERVER_URL }) .expect({ - span: {}, + span: { + // Span contents are tested elsewhere. + }, }) .start() .completed(); diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/test.ts b/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/test.ts index f338f9cca367..a92e7d795896 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/test.ts @@ -31,7 +31,9 @@ describe('outgoing http', () => { await createRunner() .withEnv({ SERVER_URL }) .expect({ - span: {}, + span: { + // Span contents are tested elsewhere. + }, }) .start() .completed(); diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/traceparent/test.ts b/dev-packages/node-integration-tests/suites/tracing/requests/traceparent/test.ts index 24209d0a87de..32c7204baeb2 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/traceparent/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requests/traceparent/test.ts @@ -59,7 +59,9 @@ describe('outgoing traceparent', () => { await createRunner() .withEnv({ SERVER_URL }) .expect({ - span: {}, + span: { + // Span contents are tested elsewhere. + }, }) .start() .completed(); From dc512ac314c997f4d0475a7dc1a7900a87e4d7b9 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Fri, 9 Oct 2026 11:13:22 +0200 Subject: [PATCH 3/3] Update dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/test.ts Co-authored-by: Lukas Stracke --- .../suites/tracing/requests/http-sampled/test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/test.ts b/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/test.ts index a92e7d795896..fe3621236b80 100644 --- a/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/requests/http-sampled/test.ts @@ -32,7 +32,7 @@ describe('outgoing http', () => { .withEnv({ SERVER_URL }) .expect({ span: { - // Span contents are tested elsewhere. + // Span contents are tested elsewhere, we just want to know that a span envelope was sent }, }) .start()