Skip to content

Commit a0319eb

Browse files
committed
fix otel tests (maybe)
1 parent d3729ba commit a0319eb

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

packages/opentelemetry-node/test/spanprocessor.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ describe('SentrySpanProcessor', () => {
570570

571571
child.end();
572572

573-
const { description, data } = spanToJSON(sentrySpan!);
573+
const { description, data, op } = spanToJSON(sentrySpan!);
574574

575575
expect(description).toBe('GET http://example.com/my/route/123');
576576
expect(data).toEqual({
@@ -579,7 +579,9 @@ describe('SentrySpanProcessor', () => {
579579
'http.url': 'http://example.com/my/route/123',
580580
'otel.kind': 'INTERNAL',
581581
url: 'http://example.com/my/route/123',
582+
'sentry.op': 'http',
582583
});
584+
expect(op).toBe('http');
583585

584586
parentOtelSpan.end();
585587
});
@@ -599,7 +601,7 @@ describe('SentrySpanProcessor', () => {
599601

600602
child.end();
601603

602-
const { description, data } = spanToJSON(sentrySpan!);
604+
const { description, data, op } = spanToJSON(sentrySpan!);
603605

604606
expect(description).toBe('GET http://example.com/my/route/123');
605607
expect(data).toEqual({
@@ -610,7 +612,9 @@ describe('SentrySpanProcessor', () => {
610612
url: 'http://example.com/my/route/123',
611613
'http.query': '?what=123',
612614
'http.fragment': '#myHash',
615+
'sentry.op': 'http',
613616
});
617+
expect(op).toBe('http');
614618

615619
parentOtelSpan.end();
616620
});

packages/opentelemetry/test/integration/transactions.test.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe('Integration | Transactions', () => {
8383
},
8484
},
8585
trace: {
86-
data: { 'otel.kind': 'INTERNAL' },
86+
data: { 'otel.kind': 'INTERNAL', 'sentry.op': 'test op' },
8787
op: 'test op',
8888
span_id: expect.any(String),
8989
status: 'ok',
@@ -144,7 +144,9 @@ describe('Integration | Transactions', () => {
144144
// This is the same behavior as for the "regular" SDKs
145145
expect(spans.map(span => spanToJSON(span))).toEqual([
146146
{
147-
data: { 'otel.kind': 'INTERNAL' },
147+
data: {
148+
'otel.kind': 'INTERNAL',
149+
},
148150
description: 'inner span 1',
149151
origin: 'manual',
150152
parent_span_id: expect.any(String),
@@ -236,7 +238,7 @@ describe('Integration | Transactions', () => {
236238
},
237239
}),
238240
trace: {
239-
data: { 'otel.kind': 'INTERNAL' },
241+
data: { 'otel.kind': 'INTERNAL', 'sentry.op': 'test op' },
240242
op: 'test op',
241243
span_id: expect.any(String),
242244
status: 'ok',
@@ -278,7 +280,7 @@ describe('Integration | Transactions', () => {
278280
},
279281
}),
280282
trace: {
281-
data: { 'otel.kind': 'INTERNAL' },
283+
data: { 'otel.kind': 'INTERNAL', 'sentry.op': 'test op b' },
282284
op: 'test op b',
283285
span_id: expect.any(String),
284286
status: 'ok',
@@ -355,7 +357,10 @@ describe('Integration | Transactions', () => {
355357
attributes: {},
356358
}),
357359
trace: {
358-
data: { 'otel.kind': 'INTERNAL' },
360+
data: {
361+
'otel.kind': 'INTERNAL',
362+
'sentry.op': 'test op',
363+
},
359364
op: 'test op',
360365
span_id: expect.any(String),
361366
parent_span_id: parentSpanId,

0 commit comments

Comments
 (0)