Skip to content

Commit 4c22a84

Browse files
nicohrubeccodex
andauthored
test(node): Port span linking and raw OTel tests to streaming (#25219)
Exercise span links and raw OTel error behavior with the default streaming lifecycle. Part of #24140 --------- Co-authored-by: GPT-6 <codex@openai.com>
1 parent b8b6239 commit 4c22a84

8 files changed

Lines changed: 137 additions & 143 deletions

File tree

‎dev-packages/node-integration-tests/suites/tracing/linking/scenario-addLink-nested.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { SENTRY_LINK_TYPE } from '@sentry/conventions/attributes';
12
import * as Sentry from '@sentry/node';
23
import { loggingTransport } from '@sentry-internal/node-integration-tests';
34

45
Sentry.init({
5-
traceLifecycle: 'static',
66
dsn: 'https://public@dsn.ingest.sentry.io/1337',
77
release: '1.0',
88
tracesSampleRate: 1.0,
@@ -16,7 +16,7 @@ Sentry.startSpan({ name: 'parent1' }, async parentSpan1 => {
1616
Sentry.startSpan({ name: 'child1.1' }, async childSpan1 => {
1717
childSpan1.addLink({
1818
context: parentSpan1.spanContext(),
19-
attributes: { 'sentry.link.type': 'previous_trace' },
19+
attributes: { [SENTRY_LINK_TYPE]: 'previous_trace' },
2020
});
2121

2222
childSpan1.end();
@@ -26,7 +26,7 @@ Sentry.startSpan({ name: 'parent1' }, async parentSpan1 => {
2626
Sentry.startSpan({ name: 'child1.2' }, async childSpan2 => {
2727
childSpan2.addLink({
2828
context: parentSpan1.spanContext(),
29-
attributes: { 'sentry.link.type': 'previous_trace' },
29+
attributes: { [SENTRY_LINK_TYPE]: 'previous_trace' },
3030
});
3131

3232
childSpan2.end();

‎dev-packages/node-integration-tests/suites/tracing/linking/scenario-addLink.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { SENTRY_LINK_TYPE } from '@sentry/conventions/attributes';
12
import * as Sentry from '@sentry/node';
23
import { loggingTransport } from '@sentry-internal/node-integration-tests';
34

45
Sentry.init({
5-
traceLifecycle: 'static',
66
dsn: 'https://public@dsn.ingest.sentry.io/1337',
77
release: '1.0',
88
tracesSampleRate: 1.0,
@@ -16,6 +16,6 @@ span1.end();
1616
Sentry.startSpan({ name: 'rootSpan' }, rootSpan => {
1717
rootSpan.addLink({
1818
context: span1.spanContext(),
19-
attributes: { 'sentry.link.type': 'previous_trace' },
19+
attributes: { [SENTRY_LINK_TYPE]: 'previous_trace' },
2020
});
2121
});

‎dev-packages/node-integration-tests/suites/tracing/linking/scenario-addLinks-nested.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { SENTRY_LINK_TYPE } from '@sentry/conventions/attributes';
12
import * as Sentry from '@sentry/node';
23
import { loggingTransport } from '@sentry-internal/node-integration-tests';
34

45
Sentry.init({
5-
traceLifecycle: 'static',
66
dsn: 'https://public@dsn.ingest.sentry.io/1337',
77
release: '1.0',
88
tracesSampleRate: 1.0,
@@ -20,7 +20,7 @@ Sentry.startSpan({ name: 'parent1' }, async parentSpan1 => {
2020
{ context: parentSpan1.spanContext() },
2121
{
2222
context: childSpan1.spanContext(),
23-
attributes: { 'sentry.link.type': 'previous_trace' },
23+
attributes: { [SENTRY_LINK_TYPE]: 'previous_trace' },
2424
},
2525
]);
2626

‎dev-packages/node-integration-tests/suites/tracing/linking/scenario-addLinks.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { SENTRY_LINK_TYPE } from '@sentry/conventions/attributes';
12
import * as Sentry from '@sentry/node';
23
import { loggingTransport } from '@sentry-internal/node-integration-tests';
34

45
Sentry.init({
5-
traceLifecycle: 'static',
66
dsn: 'https://public@dsn.ingest.sentry.io/1337',
77
release: '1.0',
88
tracesSampleRate: 1.0,
@@ -21,7 +21,7 @@ Sentry.startSpan({ name: 'rootSpan' }, rootSpan => {
2121
{ context: span1.spanContext() },
2222
{
2323
context: span2.spanContext(),
24-
attributes: { 'sentry.link.type': 'previous_trace' },
24+
attributes: { [SENTRY_LINK_TYPE]: 'previous_trace' },
2525
},
2626
]);
2727
});

‎dev-packages/node-integration-tests/suites/tracing/linking/scenario-span-options.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { SENTRY_LINK_TYPE } from '@sentry/conventions/attributes';
12
import * as Sentry from '@sentry/node';
23
import { loggingTransport } from '@sentry-internal/node-integration-tests';
34

45
Sentry.init({
5-
traceLifecycle: 'static',
66
dsn: 'https://public@dsn.ingest.sentry.io/1337',
77
release: '1.0',
88
tracesSampleRate: 1.0,
@@ -17,7 +17,7 @@ parentSpan1.end();
1717
Sentry.startSpan(
1818
{
1919
name: 'parent2',
20-
links: [{ context: parentSpan1.spanContext(), attributes: { 'sentry.link.type': 'previous_trace' } }],
20+
links: [{ context: parentSpan1.spanContext(), attributes: { [SENTRY_LINK_TYPE]: 'previous_trace' } }],
2121
},
2222
async () => {
2323
// eslint-disable-next-line @typescript-eslint/no-floating-promises

0 commit comments

Comments
 (0)